Class: Aws::SNS::PlatformApplication
- Inherits:
-
Object
- Object
- Aws::SNS::PlatformApplication
- Extended by:
- Deprecations
- Defined in:
- lib/aws-sdk-sns/platform_application.rb
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
- #arn ⇒ String
-
#attributes ⇒ Hash<String,String>
Attributes include the following:.
Actions collapse
- #create_platform_endpoint(options = {}) ⇒ PlatformEndpoint
- #delete(options = {}) ⇒ EmptyStructure
- #set_attributes(options = {}) ⇒ EmptyStructure
Associations collapse
- #endpoints(options = {}) ⇒ PlatformEndpoint::Collection
- #identifiers ⇒ Object deprecated private Deprecated.
Instance Method Summary collapse
- #client ⇒ Client
-
#data ⇒ Types::GetPlatformApplicationAttributesResponse
Returns the data for this PlatformApplication.
-
#data_loaded? ⇒ Boolean
Returns ‘true` if this resource is loaded.
-
#initialize(*args) ⇒ PlatformApplication
constructor
A new instance of PlatformApplication.
-
#load ⇒ self
(also: #reload)
Loads, or reloads #data for the current PlatformApplication.
Constructor Details
#initialize(arn, options = {}) ⇒ PlatformApplication #initialize(options = {}) ⇒ PlatformApplication
Returns a new instance of PlatformApplication.
19 20 21 22 23 24 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 19 def initialize(*args) = Hash === args.last ? args.pop.dup : {} @arn = extract_arn(args, ) @data = .delete(:data) @client = .delete(:client) || Client.new() end |
Instance Method Details
#arn ⇒ String
29 30 31 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 29 def arn @arn end |
#attributes ⇒ Hash<String,String>
Attributes include the following:
-
‘EventEndpointCreated` – Topic ARN to which EndpointCreated event notifications should be sent.
-
‘EventEndpointDeleted` – Topic ARN to which EndpointDeleted event notifications should be sent.
-
‘EventEndpointUpdated` – Topic ARN to which EndpointUpdate event notifications should be sent.
-
‘EventDeliveryFailure` – Topic ARN to which DeliveryFailure event notifications should be sent upon Direct Publish delivery failure (permanent) to one of the application’s endpoints.
48 49 50 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 48 def attributes data[:attributes] end |
#client ⇒ Client
55 56 57 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 55 def client @client end |
#create_platform_endpoint(options = {}) ⇒ PlatformEndpoint
116 117 118 119 120 121 122 123 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 116 def create_platform_endpoint( = {}) = .merge(platform_application_arn: @arn) resp = @client.create_platform_endpoint() PlatformEndpoint.new( arn: resp.data.endpoint_arn, client: @client ) end |
#data ⇒ Types::GetPlatformApplicationAttributesResponse
Returns the data for this Aws::SNS::PlatformApplication. Calls Client#get_platform_application_attributes if #data_loaded? is ‘false`.
75 76 77 78 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 75 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
83 84 85 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 83 def data_loaded? !!@data end |
#delete(options = {}) ⇒ EmptyStructure
130 131 132 133 134 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 130 def delete( = {}) = .merge(platform_application_arn: @arn) resp = @client.delete_platform_application() resp.data end |
#endpoints(options = {}) ⇒ PlatformEndpoint::Collection
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 193 def endpoints( = {}) batches = Enumerator.new do |y| = .merge(platform_application_arn: @arn) resp = @client.list_endpoints_by_platform_application() resp.each_page do |page| batch = [] page.data.endpoints.each do |e| batch << PlatformEndpoint.new( arn: e.endpoint_arn, client: @client ) end y.yield(batch) end end PlatformEndpoint::Collection.new(batches) end |
#identifiers ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
213 214 215 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 213 def identifiers { arn: @arn } end |
#load ⇒ self Also known as: reload
Loads, or reloads #data for the current Aws::SNS::PlatformApplication. Returns ‘self` making it possible to chain methods.
platform_application.reload.data
65 66 67 68 69 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 65 def load resp = @client.get_platform_application_attributes(platform_application_arn: @arn) @data = resp.data self end |
#set_attributes(options = {}) ⇒ EmptyStructure
180 181 182 183 184 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 180 def set_attributes( = {}) = .merge(platform_application_arn: @arn) resp = @client.set_platform_application_attributes() resp.data end |