Sha256: 262078060ed3321baf91820f3a55ba32a8f529733ccfad22cb36fe44f6ee8b8e

Contents?: true

Size: 1.15 KB

Versions: 14

Compression:

Stored size: 1.15 KB

Contents

module Fog
  module DNS
    class Google
      class Changes < Fog::Collection
        model Fog::DNS::Google::Change

        attribute :zone

        ##
        # Enumerates the list of Changes
        #
        # @return [Array<Fog::DNS::Google::Change>] List of Changes resources
        def all
          requires :zone

          data = service.list_changes(zone.identity).body["changes"] || []
          load(data)
        rescue Fog::Errors::NotFound
          []
        end

        ##
        # Fetches the representation of an existing Change
        #
        # @param [String] identity Change identity
        # @return [Fog::DNS::Google::Change] Change resource
        def get(identity)
          requires :zone

          if change = service.get_change(zone.identity, identity).body
            new(change)
          end
        rescue Fog::Errors::NotFound
          nil
        end

        ##
        # Creates a new instance of a Change
        #
        # @return [Fog::DNS::Google::Change] Change resource
        def new(attributes = {})
          requires :zone

          super({ :zone => zone }.merge!(attributes))
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
fog-google-0.6.0 lib/fog/dns/google/models/changes.rb
fog-google-0.5.5 lib/fog/dns/google/models/changes.rb
fog-google-0.5.4 lib/fog/dns/google/models/changes.rb
fog-google-0.5.3 lib/fog/dns/google/models/changes.rb
fog-google-0.5.2 lib/fog/dns/google/models/changes.rb
fog-google-0.5.1 lib/fog/dns/google/models/changes.rb
fog-google-0.5.0 lib/fog/dns/google/models/changes.rb
fog-google-0.4.2 lib/fog/dns/google/models/changes.rb
fog-google-0.4.1 lib/fog/dns/google/models/changes.rb
fog-google-0.4.0 lib/fog/dns/google/models/changes.rb
fog-google-0.3.2 lib/fog/dns/google/models/changes.rb
fog-google-0.3.1 lib/fog/dns/google/models/changes.rb
fog-google-0.3.0 lib/fog/dns/google/models/changes.rb
fog-google-0.2.0 lib/fog/dns/google/models/changes.rb