Class: Files::InboxRegistration

Inherits:
Object
  • Object
show all
Defined in:
lib/files.com/models/inbox_registration.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}, options = {}) ⇒ InboxRegistration

Returns a new instance of InboxRegistration.



7
8
9
10
# File 'lib/files.com/models/inbox_registration.rb', line 7

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



5
6
7
# File 'lib/files.com/models/inbox_registration.rb', line 5

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/files.com/models/inbox_registration.rb', line 5

def options
  @options
end

Class Method Details

.all(params = {}, options = {}) ⇒ Object



62
63
64
# File 'lib/files.com/models/inbox_registration.rb', line 62

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

.list(params = {}, options = {}) ⇒ Object

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).
folder_behavior_id (required) - int64 - ID of the associated Inbox.


51
52
53
54
55
56
57
58
59
60
# File 'lib/files.com/models/inbox_registration.rb', line 51

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)
  raise InvalidParameterError.new("Bad parameter: folder_behavior_id must be an Integer") if params.dig(:folder_behavior_id) and !params.dig(:folder_behavior_id).is_a?(Integer)
  raise MissingParameterError.new("Parameter missing: folder_behavior_id") unless params.dig(:folder_behavior_id)

  List.new(InboxRegistration, params) do
    Api.send_request("/inbox_registrations", :get, params, options)
  end
end

Instance Method Details

#clickwrap_bodyObject

string - Clickwrap text that was shown to the registrant



33
34
35
# File 'lib/files.com/models/inbox_registration.rb', line 33

def clickwrap_body
  @attributes[:clickwrap_body]
end

#codeObject

string - Registration cookie code



13
14
15
# File 'lib/files.com/models/inbox_registration.rb', line 13

def code
  @attributes[:code]
end

#companyObject

string - Registrant company name



23
24
25
# File 'lib/files.com/models/inbox_registration.rb', line 23

def company
  @attributes[:company]
end

#emailObject

string - Registrant email address



28
29
30
# File 'lib/files.com/models/inbox_registration.rb', line 28

def email
  @attributes[:email]
end

#form_field_dataObject

string - Data for form field set with form field ids as keys and user data as values



43
44
45
# File 'lib/files.com/models/inbox_registration.rb', line 43

def form_field_data
  @attributes[:form_field_data]
end

#form_field_set_idObject

int64 - Id of associated form field set



38
39
40
# File 'lib/files.com/models/inbox_registration.rb', line 38

def form_field_set_id
  @attributes[:form_field_set_id]
end

#nameObject

string - Registrant name



18
19
20
# File 'lib/files.com/models/inbox_registration.rb', line 18

def name
  @attributes[:name]
end