Sha256: 9250cf9b7a18b32d947913c98fa49a5c88977832aa22628567cfa51cf76477b5

Contents?: true

Size: 1.49 KB

Versions: 61

Compression:

Stored size: 1.49 KB

Contents

# frozen_string_literal: true

module Files
  class DnsRecord
    attr_reader :options, :attributes

    def initialize(attributes = {}, options = {})
      @attributes = attributes || {}
      @options = options || {}
    end

    # string - Unique label for DNS record; used by Zapier and other integrations.
    def id
      @attributes[:id]
    end

    # string - DNS record domain name
    def domain
      @attributes[:domain]
    end

    # string - DNS record type
    def rrtype
      @attributes[:rrtype]
    end

    # string - DNS record value
    def value
      @attributes[:value]
    end

    # Parameters:
    #   cursor - string - Used for pagination.  Send a cursor value to resume an existing list from the point at which you left off.  Get a cursor from an existing list via either the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header.
    #   per_page - int64 - Number of records to show per page.  (Max: 10,000, 1,000 or less is recommended).
    def self.list(params = {}, options = {})
      raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
      raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)

      List.new(DnsRecord, params) do
        Api.send_request("/dns_records", :get, params, options)
      end
    end

    def self.all(params = {}, options = {})
      list(params, options)
    end
  end
end

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
files.com-1.0.289 lib/files.com/models/dns_record.rb
files.com-1.0.288 lib/files.com/models/dns_record.rb
files.com-1.0.287 lib/files.com/models/dns_record.rb
files.com-1.0.286 lib/files.com/models/dns_record.rb
files.com-1.0.285 lib/files.com/models/dns_record.rb
files.com-1.0.284 lib/files.com/models/dns_record.rb
files.com-1.0.283 lib/files.com/models/dns_record.rb
files.com-1.0.282 lib/files.com/models/dns_record.rb
files.com-1.0.281 lib/files.com/models/dns_record.rb
files.com-1.0.280 lib/files.com/models/dns_record.rb
files.com-1.0.279 lib/files.com/models/dns_record.rb
files.com-1.0.278 lib/files.com/models/dns_record.rb
files.com-1.0.277 lib/files.com/models/dns_record.rb
files.com-1.0.276 lib/files.com/models/dns_record.rb
files.com-1.0.275 lib/files.com/models/dns_record.rb
files.com-1.0.274 lib/files.com/models/dns_record.rb
files.com-1.0.273 lib/files.com/models/dns_record.rb
files.com-1.0.272 lib/files.com/models/dns_record.rb
files.com-1.0.271 lib/files.com/models/dns_record.rb
files.com-1.0.270 lib/files.com/models/dns_record.rb