Class: Aws::SNS::PlatformApplication

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

Overview

Defined Under Namespace

Classes: Collection

Read-Only Attributes collapse

Actions collapse

Associations 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_application.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_application.rb', line 33

def arn
  @arn
end

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

Returns:

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


68
69
70
# File 'lib/aws-sdk-sns/platform_application.rb', line 68

def attributes
  data[:attributes]
end

#clientClient

Returns:



75
76
77
# File 'lib/aws-sdk-sns/platform_application.rb', line 75

def client
  @client
end

#create_platform_endpoint(options = {}) ⇒ Object



138
139
140
141
142
143
144
145
146
147
# File 'lib/aws-sdk-sns/platform_application.rb', line 138

def create_platform_endpoint(options = {})
  options = options.merge(platform_application_arn: @arn)
  resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
    @client.create_platform_endpoint(options)
  end
  PlatformEndpoint.new(
    arn: resp.data.endpoint_arn,
    client: @client
  )
end

#dataTypes::GetPlatformApplicationAttributesResponse



97
98
99
100
# File 'lib/aws-sdk-sns/platform_application.rb', line 97

def data
  load unless @data
  @data
end

#data_loaded?Boolean

Returns:

  • (Boolean)


105
106
107
# File 'lib/aws-sdk-sns/platform_application.rb', line 105

def data_loaded?
  !!@data
end

#delete(options = {}) ⇒ Object



154
155
156
157
158
159
160
# File 'lib/aws-sdk-sns/platform_application.rb', line 154

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

#endpoints(options = {}) ⇒ Object



258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
# File 'lib/aws-sdk-sns/platform_application.rb', line 258

def endpoints(options = {})
  batches = Enumerator.new do |y|
    options = options.merge(platform_application_arn: @arn)
    resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
      @client.list_endpoints_by_platform_application(options)
    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

#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.


280
281
282
# File 'lib/aws-sdk-sns/platform_application.rb', line 280

def identifiers
  { arn: @arn }
end

#loadself Also known as: reload

Returns:

  • (self)


85
86
87
88
89
90
91
# File 'lib/aws-sdk-sns/platform_application.rb', line 85

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 = {}) ⇒ Object



243
244
245
246
247
248
249
# File 'lib/aws-sdk-sns/platform_application.rb', line 243

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