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.
22 23 24 25 26 27 28 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 22 def initialize(*args) = Hash === args.last ? args.pop.dup : {} @arn = extract_arn(args, ) @data = .delete(:data) @client = .delete(:client) || Client.new() @waiter_block_warned = false end |
Instance Method Details
#arn ⇒ String
33 34 35 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 33 def arn @arn end |
#attributes ⇒ Hash<String,String>
Attributes include the following:
-
‘AppleCertificateExpiryDate` – The expiry date of the SSL certificate used to configure certificate-based authentication.
-
‘ApplePlatformTeamID` – The Apple developer account ID used to configure token-based authentication.
-
‘ApplePlatformBundleID` – The app identifier used to configure token-based authentication.
-
‘AuthenticationMethod` – Returns the credential type used when sending push notifications from application to APNS/APNS_Sandbox, or application to GCM.
-
APNS – Returns the token or certificate.
-
GCM – Returns the token or key.
-
-
‘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.
69 70 71 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 69 def attributes data[:attributes] end |
#client ⇒ Client
76 77 78 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 76 def client @client end |
#create_platform_endpoint(options = {}) ⇒ PlatformEndpoint
139 140 141 142 143 144 145 146 147 148 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 139 def create_platform_endpoint( = {}) = .merge(platform_application_arn: @arn) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.create_platform_endpoint() end 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`.
98 99 100 101 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 98 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
106 107 108 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 106 def data_loaded? !!@data end |
#delete(options = {}) ⇒ EmptyStructure
155 156 157 158 159 160 161 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 155 def delete( = {}) = .merge(platform_application_arn: @arn) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.delete_platform_application() end resp.data end |
#endpoints(options = {}) ⇒ PlatformEndpoint::Collection
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 259 def endpoints( = {}) batches = Enumerator.new do |y| = .merge(platform_application_arn: @arn) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.list_endpoints_by_platform_application() end 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.
281 282 283 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 281 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
86 87 88 89 90 91 92 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 86 def load resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.get_platform_application_attributes(platform_application_arn: @arn) end @data = resp.data self end |
#set_attributes(options = {}) ⇒ EmptyStructure
244 245 246 247 248 249 250 |
# File 'lib/aws-sdk-sns/platform_application.rb', line 244 def set_attributes( = {}) = .merge(platform_application_arn: @arn) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.set_platform_application_attributes() end resp.data end |