class AWS::SNS::Topic

def to_h

Returns:
  • (Hash) - Returns a hash of attributes about this topic,
def to_h
  attributes = client.get_topic_attributes(:topic_arn => arn).attributes
  {
    :arn => arn,
    :name => name,
    :owner => attributes['Owner'],
    :display_name => attributes['DisplayName'] || name,
    :policy => parse_policy(attributes['Policy']),
    :num_subscriptions_confirmed => attributes['SubscriptionsConfirmed'].to_i,
    :num_subscriptions_pending => attributes['SubscriptionsPending'].to_i,
    :num_subscriptions_deleted => attributes['SubscriptionsDeleted'].to_i,
    :delivery_policy_json => attributes['DeliveryPolicy'],
    :effective_delivery_policy_json => attributes['EffectiveDeliveryPolicy'],
  }
end