Class: Aws::SNS::PlatformEndpoint
- Inherits:
-
Object
- Object
- Aws::SNS::PlatformEndpoint
- Extended by:
- Deprecations
- Defined in:
- 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
- #identifiers ⇒ Object deprecated private Deprecated.
- #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.
19 20 21 22 23 24 |
# File 'lib/aws-sdk-sns/platform_endpoint.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_endpoint.rb', line 29 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.
49 50 51 |
# File 'lib/aws-sdk-sns/platform_endpoint.rb', line 49 def attributes data[:attributes] end |
#client ⇒ Client
56 57 58 |
# File 'lib/aws-sdk-sns/platform_endpoint.rb', line 56 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`.
76 77 78 79 |
# File 'lib/aws-sdk-sns/platform_endpoint.rb', line 76 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
84 85 86 |
# File 'lib/aws-sdk-sns/platform_endpoint.rb', line 84 def data_loaded? !!@data end |
#delete(options = {}) ⇒ EmptyStructure
95 96 97 98 99 |
# File 'lib/aws-sdk-sns/platform_endpoint.rb', line 95 def delete( = {}) = .merge(endpoint_arn: @arn) resp = @client.delete_endpoint() resp.data 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.
264 265 266 |
# File 'lib/aws-sdk-sns/platform_endpoint.rb', line 264 def identifiers { arn: @arn } 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
66 67 68 69 70 |
# File 'lib/aws-sdk-sns/platform_endpoint.rb', line 66 def load resp = @client.get_endpoint_attributes(endpoint_arn: @arn) @data = resp.data self end |
#publish(options = {}) ⇒ Types::PublishResponse
224 225 226 227 228 |
# File 'lib/aws-sdk-sns/platform_endpoint.rb', line 224 def publish( = {}) = .merge(target_arn: @arn) resp = @client.publish() resp.data end |
#set_attributes(options = {}) ⇒ EmptyStructure
256 257 258 259 260 |
# File 'lib/aws-sdk-sns/platform_endpoint.rb', line 256 def set_attributes( = {}) = .merge(endpoint_arn: @arn) resp = @client.set_endpoint_attributes() resp.data end |