Class: Aws::SNS::PlatformEndpoint

Inherits:
Object
  • Object
show all
Extended by:
Deprecations
Defined in:
sig/platform_endpoint.rbs,
lib/aws-sdk-sns/platform_endpoint.rb

Overview

Defined Under Namespace

Classes: Collection

Read-Only Attributes collapse

Actions collapse

Instance Method Summary collapse

Constructor Details

#initialize(arn, options) ⇒ void #initialize(arn:, client:) ⇒ void #initialize(args) ⇒ void

Overloads:

  • #initialize(arn, options) ⇒ void

    Parameters:

    • arn (String)
    • options (Hash[Symbol, untyped])
  • #initialize(arn:, client:) ⇒ void

    Parameters:

    • arn: (String)
    • client: (Client)
  • #initialize(args) ⇒ void

    Parameters:

    • args (Hash[Symbol, untyped])


22
23
24
25
26
27
28
# File 'lib/aws-sdk-sns/platform_endpoint.rb', line 22

def initialize(*args)
  options = Hash === args.last ? args.pop.dup : {}
  @arn = extract_arn(args, options)
  @data = options.delete(:data)
  @client = options.delete(:client) || Client.new(options)
  @waiter_block_warned = false
end

Instance Method Details

#arnString

Returns:

  • (String)


33
34
35
# File 'lib/aws-sdk-sns/platform_endpoint.rb', line 33

def arn
  @arn
end

#attributes::Hash[::String, ::String]

Returns:

  • (::Hash[::String, ::String])


57
58
59
# File 'lib/aws-sdk-sns/platform_endpoint.rb', line 57

def attributes
  data[:attributes]
end

#clientClient

Returns:



64
65
66
# File 'lib/aws-sdk-sns/platform_endpoint.rb', line 64

def client
  @client
end

#dataTypes::GetEndpointAttributesResponse



86
87
88
89
# File 'lib/aws-sdk-sns/platform_endpoint.rb', line 86

def data
  load unless @data
  @data
end

#data_loaded?Boolean

Returns:

  • (Boolean)


94
95
96
# File 'lib/aws-sdk-sns/platform_endpoint.rb', line 94

def data_loaded?
  !!@data
end

#delete(options = {}) ⇒ Object



105
106
107
108
109
110
111
# File 'lib/aws-sdk-sns/platform_endpoint.rb', line 105

def delete(options = {})
  options = options.merge(endpoint_arn: @arn)
  resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
    @client.delete_endpoint(options)
  end
  resp.data
end

#identifiersObject

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.

Deprecated.


333
334
335
# File 'lib/aws-sdk-sns/platform_endpoint.rb', line 333

def identifiers
  { arn: @arn }
end

#loadself Also known as: reload

Returns:

  • (self)


74
75
76
77
78
79
80
# File '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 = {}) ⇒ Object



289
290
291
292
293
294
295
# File 'lib/aws-sdk-sns/platform_endpoint.rb', line 289

def publish(options = {})
  options = options.merge(target_arn: @arn)
  resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
    @client.publish(options)
  end
  resp.data
end

#set_attributes(options = {}) ⇒ Object



323
324
325
326
327
328
329
# File 'lib/aws-sdk-sns/platform_endpoint.rb', line 323

def set_attributes(options = {})
  options = options.merge(endpoint_arn: @arn)
  resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
    @client.set_endpoint_attributes(options)
  end
  resp.data
end