Sha256: b36f52fcc4bc111656225eb66d633f2b373c2d8381d3756904d755e619996e35

Contents?: true

Size: 1.01 KB

Versions: 7

Compression:

Stored size: 1.01 KB

Contents

module Fog
  module DNS
    class Google
      ##
      # Deletes a previously created Managed Zone.
      #
      # @see https://developers.google.com/cloud-dns/api/v1/managedZones/delete
      class Real
        def delete_managed_zone(name_or_id)
          api_method = @dns.managed_zones.delete
          parameters = {
            'project' => @project,
            'managedZone' => name_or_id,
          }

          request(api_method, parameters)
        end
      end

      class Mock
        def delete_managed_zone(name_or_id)
          if self.data[:managed_zones].has_key?(name_or_id)
            self.data[:managed_zones].delete(name_or_id)
          elsif zone = self.data[:managed_zones].values.find { |zone| zone['name'] = name_or_id }
            self.data[:managed_zones].delete(zone['id'])
          else
            raise Fog::Errors::NotFound, "The 'parameters.managedZone' resource named '#{name_or_id}' does not exist."
          end

          build_excon_response(nil)
        end
      end
    end
  end
end

Version data entries

7 entries across 5 versions & 2 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-google-0.1.0/lib/fog/google/requests/dns/delete_managed_zone.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-google-0.1.0/lib/fog/google/requests/dns/delete_managed_zone.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-google-0.1.0/lib/fog/google/requests/dns/delete_managed_zone.rb
fog-google-0.1.3 lib/fog/google/requests/dns/delete_managed_zone.rb
fog-google-0.1.2 lib/fog/google/requests/dns/delete_managed_zone.rb
fog-google-0.1.1 lib/fog/google/requests/dns/delete_managed_zone.rb
fog-google-0.1.0 lib/fog/google/requests/dns/delete_managed_zone.rb