Sha256: 175c2f73092bfe39c85d65281950231705e59926ffa760def4c7b18d15f299a4

Contents?: true

Size: 1.6 KB

Versions: 24

Compression:

Stored size: 1.6 KB

Contents

# frozen_string_literal: true

module Files
  class IpAddress
    attr_reader :options, :attributes

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

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

    # string - The object that this public IP address list is associated with.
    def associated_with
      @attributes[:associated_with]
    end

    # int64 - Group ID
    def group_id
      @attributes[:group_id]
    end

    # array - A list of IP addresses.
    def ip_addresses
      @attributes[:ip_addresses]
    end

    # Parameters:
    #   page - integer - Current page number.
    #   per_page - integer - 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("/ip_addresses", :get, params, options)
    end

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

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
files.com-1.0.57 lib/files.com/models/ip_address.rb
files.com-1.0.56 lib/files.com/models/ip_address.rb
files.com-1.0.55 lib/files.com/models/ip_address.rb
files.com-1.0.54 lib/files.com/models/ip_address.rb
files.com-1.0.53 lib/files.com/models/ip_address.rb
files.com-1.0.52 lib/files.com/models/ip_address.rb
files.com-1.0.51 lib/files.com/models/ip_address.rb
files.com-1.0.50 lib/files.com/models/ip_address.rb
files.com-1.0.49 lib/files.com/models/ip_address.rb
files.com-1.0.48 lib/files.com/models/ip_address.rb
files.com-1.0.47 lib/files.com/models/ip_address.rb
files.com-1.0.46 lib/files.com/models/ip_address.rb
files.com-1.0.45 lib/files.com/models/ip_address.rb
files.com-1.0.44 lib/files.com/models/ip_address.rb
files.com-1.0.43 lib/files.com/models/ip_address.rb
files.com-1.0.42 lib/files.com/models/ip_address.rb
files.com-1.0.41 lib/files.com/models/ip_address.rb
files.com-1.0.40 lib/files.com/models/ip_address.rb
files.com-1.0.39 lib/files.com/models/ip_address.rb
files.com-1.0.38 lib/files.com/models/ip_address.rb