class Aws::RDS::EventSubscription

def add_subscriber(options = {})

Returns:
  • (EventSubscription) -

Options Hash: (**options)
  • :source_identifier (required, String) --

Parameters:
  • options (Hash) -- ({})

Other tags:
    Example: Request syntax with placeholder values -
def add_subscriber(options = {})
  options = options.merge(subscription_name: @name)
  resp = Aws::Plugins::UserAgent.feature('resource') do
    @client.add_source_identifier_to_subscription(options)
  end
  EventSubscription.new(
    name: resp.data.event_subscription.cust_subscription_id,
    data: resp.data.event_subscription,
    client: @client
  )
end

def client

Returns:
  • (Client) -
def client
  @client
end

def create(options = {})

Returns:
  • (EventSubscription) -

Options Hash: (**options)
  • :tags (Array) --
  • :enabled (Boolean) --
  • :source_ids (Array) --
  • :event_categories (Array) --
  • :source_type (String) --
  • :sns_topic_arn (required, String) --

Parameters:
  • options (Hash) -- ({})

Other tags:
    Example: Request syntax with placeholder values -
def create(options = {})
  options = options.merge(subscription_name: @name)
  resp = Aws::Plugins::UserAgent.feature('resource') do
    @client.create_event_subscription(options)
  end
  EventSubscription.new(
    name: resp.data.event_subscription.cust_subscription_id,
    data: resp.data.event_subscription,
    client: @client
  )
end

def customer_aws_id

Returns:
  • (String) -
def customer_aws_id
  data[:customer_aws_id]
end

def data

Returns:
  • (Types::EventSubscription) -
def data
  load unless @data
  @data
end

def data_loaded?

Returns:
  • (Boolean) -
def data_loaded?
  !!@data
end

def delete(options = {})

Returns:
  • (EventSubscription) -

Parameters:
  • options (Hash) -- ({})

Other tags:
    Example: Request syntax with placeholder values -
def delete(options = {})
  options = options.merge(subscription_name: @name)
  resp = Aws::Plugins::UserAgent.feature('resource') do
    @client.delete_event_subscription(options)
  end
  EventSubscription.new(
    name: resp.data.event_subscription.cust_subscription_id,
    data: resp.data.event_subscription,
    client: @client
  )
end

def enabled

Returns:
  • (Boolean) -
def enabled
  data[:enabled]
end

def event_categories_list

Returns:
  • (Array) -
def event_categories_list
  data[:event_categories_list]
end

def event_subscription_arn

Returns:
  • (String) -
def event_subscription_arn
  data[:event_subscription_arn]
end

def extract_name(args, options)

def extract_name(args, options)
  value = args[0] || options.delete(:name)
  case value
  when String then value
  when nil then raise ArgumentError, "missing required option :name"
  else
    msg = "expected :name to be a String, got #{value.class}"
    raise ArgumentError, msg
  end
end

def identifiers

Other tags:
    Api: - private

Deprecated:
def identifiers
  { name: @name }
end

def initialize(*args)

Options Hash: (**options)
  • :client (Client) --
  • :name (required, String) --
  • :client (Client) --

Overloads:
  • def initialize(options = {})
  • def initialize(name, options = {})

Parameters:
  • name (String) --
def initialize(*args)
  options = Hash === args.last ? args.pop.dup : {}
  @name = extract_name(args, options)
  @data = options.delete(:data)
  @client = options.delete(:client) || Client.new(options)
  @waiter_block_warned = false
end

def load

Returns:
  • (self) -
def load
  resp = Aws::Plugins::UserAgent.feature('resource') do
    @client.describe_event_subscriptions(subscription_name: @name)
  end
  @data = resp.event_subscriptions_list[0]
  self
end

def modify(options = {})

Returns:
  • (EventSubscription) -

Options Hash: (**options)
  • :enabled (Boolean) --
  • :event_categories (Array) --
  • :source_type (String) --
  • :sns_topic_arn (String) --

Parameters:
  • options (Hash) -- ({})

Other tags:
    Example: Request syntax with placeholder values -
def modify(options = {})
  options = options.merge(subscription_name: @name)
  resp = Aws::Plugins::UserAgent.feature('resource') do
    @client.modify_event_subscription(options)
  end
  EventSubscription.new(
    name: resp.data.event_subscription.cust_subscription_id,
    data: resp.data.event_subscription,
    client: @client
  )
end

def name

Returns:
  • (String) -
def name
  @name
end

def remove_subscriber(options = {})

Returns:
  • (EventSubscription) -

Options Hash: (**options)
  • :source_identifier (required, String) --

Parameters:
  • options (Hash) -- ({})

Other tags:
    Example: Request syntax with placeholder values -
def remove_subscriber(options = {})
  options = options.merge(subscription_name: @name)
  resp = Aws::Plugins::UserAgent.feature('resource') do
    @client.remove_source_identifier_from_subscription(options)
  end
  EventSubscription.new(
    name: resp.data.event_subscription.cust_subscription_id,
    data: resp.data.event_subscription,
    client: @client
  )
end

def sns_topic_arn

Returns:
  • (String) -
def sns_topic_arn
  data[:sns_topic_arn]
end

def source_ids_list

Returns:
  • (Array) -
def source_ids_list
  data[:source_ids_list]
end

def source_type

Returns:
  • (String) -
def source_type
  data[:source_type]
end

def status

Returns:
  • (String) -
def status
  data[:status]
end

def subscription_creation_time

Returns:
  • (String) -
def subscription_creation_time
  data[:subscription_creation_time]
end

def wait_until(options = {}, &block)

Returns:
  • (Resource) - if the waiter was successful

Options Hash: (**options)
  • :before_wait (Proc) -- Callback
  • :before_attempt (Proc) -- Callback
  • :delay (Integer) -- Delay between each
  • :max_attempts (Integer) -- Maximum number of

Raises:
  • (NotImplementedError) - Raised when the resource does not
  • (Aws::Waiters::Errors::UnexpectedError) - Raised when an error is
  • (Aws::Waiters::Errors::FailureStateError) - Raised when the waiter

Other tags:
    Yieldparam: resource - to be used in the waiting condition.

Other tags:
    Note: - The waiting operation is performed on a copy. The original resource

Deprecated:
  • Use [Aws::RDS::Client] #wait_until instead
def wait_until(options = {}, &block)
  self_copy = self.dup
  attempts = 0
  options[:max_attempts] = 10 unless options.key?(:max_attempts)
  options[:delay] ||= 10
  options[:poller] = Proc.new do
    attempts += 1
    if block.call(self_copy)
      [:success, self_copy]
    else
      self_copy.reload unless attempts == options[:max_attempts]
      :retry
    end
  end
  Aws::Plugins::UserAgent.feature('resource') do
    Aws::Waiters::Waiter.new(options).wait({})
  end
end