Class: Aws::SNS::PlatformEndpoint
- Inherits:
-
Object
- Object
- Aws::SNS::PlatformEndpoint
- Defined in:
- gems/aws-sdk-sns/lib/aws-sdk-sns/platform_endpoint.rb
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
-
#arn ⇒ String
-
#attributes ⇒ Hash<String,String>
Attributes include the following:.
Actions collapse
-
#delete(options = {}) ⇒ EmptyStructure
-
#publish(options = {}) ⇒ Types::PublishResponse
-
#set_attributes(options = {}) ⇒ EmptyStructure
Instance Method Summary collapse
-
#client ⇒ Client
-
#data ⇒ Types::GetEndpointAttributesResponse
Returns the data for this PlatformEndpoint.
-
#data_loaded? ⇒ Boolean
Returns
true
if this resource is loaded. -
#initialize(*args) ⇒ PlatformEndpoint
constructor
A new instance of PlatformEndpoint.
-
#load ⇒ self
(also: #reload)
Loads, or reloads #data for the current PlatformEndpoint.
Constructor Details
#initialize(arn, options = {}) ⇒ PlatformEndpoint #initialize(options = {}) ⇒ PlatformEndpoint
Returns a new instance of PlatformEndpoint.
22 23 24 25 26 27 28 |
# File 'gems/aws-sdk-sns/lib/aws-sdk-sns/platform_endpoint.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 'gems/aws-sdk-sns/lib/aws-sdk-sns/platform_endpoint.rb', line 33 def arn @arn end |
#attributes ⇒ Hash<String,String>
Attributes include the following:
CustomUserData
– arbitrary user data to associate with the endpoint. Amazon SNS does not use this data. The data must be in UTF-8 format and less than 2KB.Enabled
– flag that enables/disables delivery to the endpoint. Amazon SNS will set this to false when a notification service indicates to Amazon SNS that the endpoint is invalid. Users can set it back to true, typically after updating Token.Token
– device token, also referred to as a registration id, for an app and mobile device. This is returned from the notification service when an app and mobile device are registered with the notification service.The device token for the iOS platform is returned in lowercase.
57 58 59 |
# File 'gems/aws-sdk-sns/lib/aws-sdk-sns/platform_endpoint.rb', line 57 def attributes data[:attributes] end |
#client ⇒ Client
64 65 66 |
# File 'gems/aws-sdk-sns/lib/aws-sdk-sns/platform_endpoint.rb', line 64 def client @client end |
#data ⇒ Types::GetEndpointAttributesResponse
Returns the data for this Aws::SNS::PlatformEndpoint. Calls
Client#get_endpoint_attributes if #data_loaded? is false
.
86 87 88 89 |
# File 'gems/aws-sdk-sns/lib/aws-sdk-sns/platform_endpoint.rb', line 86 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
94 95 96 |
# File 'gems/aws-sdk-sns/lib/aws-sdk-sns/platform_endpoint.rb', line 94 def data_loaded? !!@data end |
#delete(options = {}) ⇒ EmptyStructure
105 106 107 108 109 110 111 |
# File 'gems/aws-sdk-sns/lib/aws-sdk-sns/platform_endpoint.rb', line 105 def delete( = {}) = .merge(endpoint_arn: @arn) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.delete_endpoint() end resp.data end |
#load ⇒ self Also known as: reload
Loads, or reloads #data for the current Aws::SNS::PlatformEndpoint.
Returns self
making it possible to chain methods.
platform_endpoint.reload.data
74 75 76 77 78 79 80 |
# File 'gems/aws-sdk-sns/lib/aws-sdk-sns/platform_endpoint.rb', line 74 def load resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.get_endpoint_attributes(endpoint_arn: @arn) end @data = resp.data self end |
#publish(options = {}) ⇒ Types::PublishResponse
249 250 251 252 253 254 255 |
# File 'gems/aws-sdk-sns/lib/aws-sdk-sns/platform_endpoint.rb', line 249 def publish( = {}) = .merge(target_arn: @arn) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.publish() end resp.data end |
#set_attributes(options = {}) ⇒ EmptyStructure
283 284 285 286 287 288 289 |
# File 'gems/aws-sdk-sns/lib/aws-sdk-sns/platform_endpoint.rb', line 283 def set_attributes( = {}) = .merge(endpoint_arn: @arn) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.set_endpoint_attributes() end resp.data end |