Sha256: c4ea5e72ad80c0a01b2099a38c5cb96ea2c39f479e767b8ae9795a5b510a5734

Contents?: true

Size: 1.31 KB

Versions: 76

Compression:

Stored size: 1.31 KB

Contents

module Fog
  module AWS
    class SNS
      class Topic < Fog::Model
        identity :id, :aliases => "TopicArn"

        attribute :owner,                     :aliases => "Owner"
        attribute :policy,                    :aliases => "Policy"
        attribute :display_name,              :aliases => "DisplayName"
        attribute :subscriptions_pending,     :aliases => "SubscriptionsPending"
        attribute :subscriptions_confirmed,   :aliases => "SubscriptionsConfirmed"
        attribute :subscriptions_deleted,     :aliases => "SubscriptionsDeleted"
        attribute :delivery_policy,           :aliases => "DeliveryPolicy"
        attribute :effective_delivery_policy, :aliases => "EffectiveDeliveryPolicy"

        def ready?
          display_name
        end

        def update_topic_attribute(attribute, new_value)
          requires :id
          service.set_topic_attributes(id, attribute, new_value).body
          reload
        end

        def destroy
          requires :id
          service.delete_topic(id)
          true
        end

        def save
          requires :id

          data = service.create_topic(id).body["TopicArn"]
          if data
            data = {"id" => data}
            merge_attributes(data)
            true
          else false
          end
        end
      end
    end
  end
end

Version data entries

76 entries across 74 versions & 3 rubygems

Version Path
fog-aws-3.30.0 lib/fog/aws/models/sns/topic.rb
fog-aws-3.29.0 lib/fog/aws/models/sns/topic.rb
fog-aws-3.28.0 lib/fog/aws/models/sns/topic.rb
fog-aws-3.27.0 lib/fog/aws/models/sns/topic.rb
fog-aws-3.26.0 lib/fog/aws/models/sns/topic.rb
fog-aws-3.25.0 lib/fog/aws/models/sns/topic.rb
fog-aws-3.24.0 lib/fog/aws/models/sns/topic.rb
fog-aws-3.23.0 lib/fog/aws/models/sns/topic.rb
fog-aws-3.22.0 lib/fog/aws/models/sns/topic.rb
fog-aws-3.21.1 lib/fog/aws/models/sns/topic.rb
fog-aws-3.21.0 lib/fog/aws/models/sns/topic.rb
fog-aws-3.20.0 lib/fog/aws/models/sns/topic.rb
fog-aws-3.19.0 lib/fog/aws/models/sns/topic.rb
fog-aws-3.18.0 lib/fog/aws/models/sns/topic.rb
fog-aws-3.17.0 lib/fog/aws/models/sns/topic.rb
fog-aws-3.16.0 lib/fog/aws/models/sns/topic.rb
fog-aws-3.15.0 lib/fog/aws/models/sns/topic.rb
fog-aws-3.14.0 lib/fog/aws/models/sns/topic.rb
fog-aws-3.13.0 lib/fog/aws/models/sns/topic.rb
fog-aws-3.12.0 lib/fog/aws/models/sns/topic.rb