Sha256: 07a44c86fc8f69bbc121aa81a03ce4d6466dc9fcd79633864edac29c884bdb11

Contents?: true

Size: 1.53 KB

Versions: 11

Compression:

Stored size: 1.53 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:
    #   page - int64 - Current page number.
    #   per_page - int64 - Number of records to show per page.  (Max: 10,000, 1,000 or less is recommended).
    #   action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
    def self.list(params = {}, options = {})
      raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
      raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
      raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)

      response, options = Api.send_request("/dns_records", :get, params, options)
    end

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
files.com-1.0.68 lib/files.com/models/dns_record.rb
files.com-1.0.67 lib/files.com/models/dns_record.rb
files.com-1.0.66 lib/files.com/models/dns_record.rb
files.com-1.0.65 lib/files.com/models/dns_record.rb
files.com-1.0.64 lib/files.com/models/dns_record.rb
files.com-1.0.63 lib/files.com/models/dns_record.rb
files.com-1.0.62 lib/files.com/models/dns_record.rb
files.com-1.0.61 lib/files.com/models/dns_record.rb
files.com-1.0.60 lib/files.com/models/dns_record.rb
files.com-1.0.59 lib/files.com/models/dns_record.rb
files.com-1.0.58 lib/files.com/models/dns_record.rb