Sha256: b1879c3a4da969b489c6ca56e90fe8553d45086ec6b162558f21ea021b6f9da6

Contents?: true

Size: 1.45 KB

Versions: 107

Compression:

Stored size: 1.45 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 the X-Files-Cursor-Next 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

107 entries across 107 versions & 1 rubygems

Version Path
files.com-1.0.228 lib/files.com/models/dns_record.rb
files.com-1.0.227 lib/files.com/models/dns_record.rb
files.com-1.0.226 lib/files.com/models/dns_record.rb
files.com-1.0.225 lib/files.com/models/dns_record.rb
files.com-1.0.224 lib/files.com/models/dns_record.rb
files.com-1.0.223 lib/files.com/models/dns_record.rb
files.com-1.0.222 lib/files.com/models/dns_record.rb
files.com-1.0.221 lib/files.com/models/dns_record.rb
files.com-1.0.220 lib/files.com/models/dns_record.rb
files.com-1.0.219 lib/files.com/models/dns_record.rb
files.com-1.0.218 lib/files.com/models/dns_record.rb
files.com-1.0.217 lib/files.com/models/dns_record.rb
files.com-1.0.216 lib/files.com/models/dns_record.rb
files.com-1.0.215 lib/files.com/models/dns_record.rb
files.com-1.0.214 lib/files.com/models/dns_record.rb
files.com-1.0.213 lib/files.com/models/dns_record.rb
files.com-1.0.212 lib/files.com/models/dns_record.rb
files.com-1.0.211 lib/files.com/models/dns_record.rb
files.com-1.0.210 lib/files.com/models/dns_record.rb
files.com-1.0.209 lib/files.com/models/dns_record.rb