Sha256: 1f11120719db662aba05f2f0b9eb29070f0cd5b6e7d08fcefc5fa08b774d706e
Contents?: true
Size: 1.86 KB
Versions: 1
Compression:
Stored size: 1.86 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). 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) List.new(DnsRecord, params) do Api.send_request("/dns_records", :get, params, options) end end def self.all(params = {}, options = {}) list(params, options) end def self.create_export(params = {}, options = {}) response, options = Api.send_request("/dns_records/create_export", :post, params, options) response.data.map do |entity_data| Export.new(entity_data, options) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
files.com-1.1.179 | lib/files.com/models/dns_record.rb |