Sha256: 31bfaeb0250f28a7947d88575a692e6342ff53a6b7a3659d11007f521ca81412

Contents?: true

Size: 1.92 KB

Versions: 15

Compression:

Stored size: 1.92 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.  When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`.  Send one of those cursor value here to resume an existing list from the next available record.  Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
    #   per_page - int64 - Number of records to show per page.  (Max: 10,000, 1,000 or less is recommended).
    #   action - string
    #   page - int64
    def self.list(params = {}, options = {})
      raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
      raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
      raise InvalidParameterError.new("Bad parameter: action must be an String") if params[:action] and !params[:action].is_a?(String)
      raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params[:page] and !params[: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

15 entries across 15 versions & 1 rubygems

Version Path
files.com-1.1.108 lib/files.com/models/dns_record.rb
files.com-1.1.107 lib/files.com/models/dns_record.rb
files.com-1.1.106 lib/files.com/models/dns_record.rb
files.com-1.1.105 lib/files.com/models/dns_record.rb
files.com-1.1.104 lib/files.com/models/dns_record.rb
files.com-1.1.103 lib/files.com/models/dns_record.rb
files.com-1.1.102 lib/files.com/models/dns_record.rb
files.com-1.1.101 lib/files.com/models/dns_record.rb
files.com-1.1.100 lib/files.com/models/dns_record.rb
files.com-1.1.99 lib/files.com/models/dns_record.rb
files.com-1.1.98 lib/files.com/models/dns_record.rb
files.com-1.1.97 lib/files.com/models/dns_record.rb
files.com-1.1.96 lib/files.com/models/dns_record.rb
files.com-1.1.95 lib/files.com/models/dns_record.rb
files.com-1.1.94 lib/files.com/models/dns_record.rb