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



168
169
170
# File 'lib/files.com/models/inbox_registration.rb', line 168

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

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

Parameters:

inbox_code (required) - string - Inbox URL code
inbox_recipient_registration_code - string - Inbox recipient registration code
password - string - Inbox password
name - string - Registrant name
company - string - Registrant company name
email - string - Registrant email address


179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/files.com/models/inbox_registration.rb', line 179

def self.create(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: inbox_code must be an String") if params[:inbox_code] and !params[:inbox_code].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: inbox_recipient_registration_code must be an String") if params[:inbox_recipient_registration_code] and !params[:inbox_recipient_registration_code].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: password must be an String") if params[:password] and !params[:password].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: company must be an String") if params[:company] and !params[:company].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: email must be an String") if params[:email] and !params[:email].is_a?(String)
  raise MissingParameterError.new("Parameter missing: inbox_code") unless params[:inbox_code]

  response, options = Api.send_request("/inbox_registrations", :post, params, options)
  InboxRegistration.new(response.data, options)
end

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

Parameters:

folder_behavior_id - int64 - ID of the associated Inbox. This is required if the user is not a site admin.


204
205
206
207
208
209
# File 'lib/files.com/models/inbox_registration.rb', line 204

def self.create_export(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: folder_behavior_id must be an Integer") if params[:folder_behavior_id] and !params[:folder_behavior_id].is_a?(Integer)

  response, options = Api.send_request("/inbox_registrations/create_export", :post, params, options)
  Export.new(response.data, options)
end

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

Parameters:

inbox_registration_code (required) - string - Inbox registration cookie code


194
195
196
197
198
199
200
# File 'lib/files.com/models/inbox_registration.rb', line 194

def self.last_activity(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: inbox_registration_code must be an String") if params[:inbox_registration_code] and !params[:inbox_registration_code].is_a?(String)
  raise MissingParameterError.new("Parameter missing: inbox_registration_code") unless params[:inbox_registration_code]

  Api.send_request("/inbox_registrations/last_activity", :post, params, options)
  nil
end

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

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: 10000, 1,000 or less is recommended).
folder_behavior_id - int64 - ID of the associated Inbox. This is required if the user is not a site admin.


158
159
160
161
162
163
164
165
166
# File 'lib/files.com/models/inbox_registration.rb', line 158

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

  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



58
59
60
# File 'lib/files.com/models/inbox_registration.rb', line 58

def clickwrap_body
  @attributes[:clickwrap_body]
end

#clickwrap_body=(value) ⇒ Object



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

def clickwrap_body=(value)
  @attributes[:clickwrap_body] = value
end

#codeObject

string - Registration cookie code



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

def code
  @attributes[:code]
end

#code=(value) ⇒ Object



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

def code=(value)
  @attributes[:code] = value
end

#companyObject

string - Registrant company name



31
32
33
# File 'lib/files.com/models/inbox_registration.rb', line 31

def company
  @attributes[:company]
end

#company=(value) ⇒ Object



35
36
37
# File 'lib/files.com/models/inbox_registration.rb', line 35

def company=(value)
  @attributes[:company] = value
end

#created_atObject

date-time - Registration creation date/time



112
113
114
# File 'lib/files.com/models/inbox_registration.rb', line 112

def created_at
  @attributes[:created_at]
end

#emailObject

string - Registrant email address



40
41
42
# File 'lib/files.com/models/inbox_registration.rb', line 40

def email
  @attributes[:email]
end

#email=(value) ⇒ Object



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

def email=(value)
  @attributes[:email] = value
end

#form_field_dataObject

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



76
77
78
# File 'lib/files.com/models/inbox_registration.rb', line 76

def form_field_data
  @attributes[:form_field_data]
end

#form_field_data=(value) ⇒ Object



80
81
82
# File 'lib/files.com/models/inbox_registration.rb', line 80

def form_field_data=(value)
  @attributes[:form_field_data] = value
end

#form_field_set_idObject

int64 - Id of associated form field set



67
68
69
# File 'lib/files.com/models/inbox_registration.rb', line 67

def form_field_set_id
  @attributes[:form_field_set_id]
end

#form_field_set_id=(value) ⇒ Object



71
72
73
# File 'lib/files.com/models/inbox_registration.rb', line 71

def form_field_set_id=(value)
  @attributes[:form_field_set_id] = value
end

#inbox_codeObject

string - Inbox URL code



117
118
119
# File 'lib/files.com/models/inbox_registration.rb', line 117

def inbox_code
  @attributes[:inbox_code]
end

#inbox_code=(value) ⇒ Object



121
122
123
# File 'lib/files.com/models/inbox_registration.rb', line 121

def inbox_code=(value)
  @attributes[:inbox_code] = value
end

#inbox_idObject

int64 - Id of associated inbox



85
86
87
# File 'lib/files.com/models/inbox_registration.rb', line 85

def inbox_id
  @attributes[:inbox_id]
end

#inbox_id=(value) ⇒ Object



89
90
91
# File 'lib/files.com/models/inbox_registration.rb', line 89

def inbox_id=(value)
  @attributes[:inbox_id] = value
end

#inbox_recipient_idObject

int64 - Id of associated inbox recipient



94
95
96
# File 'lib/files.com/models/inbox_registration.rb', line 94

def inbox_recipient_id
  @attributes[:inbox_recipient_id]
end

#inbox_recipient_id=(value) ⇒ Object



98
99
100
# File 'lib/files.com/models/inbox_registration.rb', line 98

def inbox_recipient_id=(value)
  @attributes[:inbox_recipient_id] = value
end

#inbox_recipient_registration_codeObject

string - Inbox recipient registration code



126
127
128
# File 'lib/files.com/models/inbox_registration.rb', line 126

def inbox_recipient_registration_code
  @attributes[:inbox_recipient_registration_code]
end

#inbox_recipient_registration_code=(value) ⇒ Object



130
131
132
# File 'lib/files.com/models/inbox_registration.rb', line 130

def inbox_recipient_registration_code=(value)
  @attributes[:inbox_recipient_registration_code] = value
end

#inbox_titleObject

string - Title of associated inbox



103
104
105
# File 'lib/files.com/models/inbox_registration.rb', line 103

def inbox_title
  @attributes[:inbox_title]
end

#inbox_title=(value) ⇒ Object



107
108
109
# File 'lib/files.com/models/inbox_registration.rb', line 107

def inbox_title=(value)
  @attributes[:inbox_title] = value
end

#ipObject

string - Registrant IP Address



49
50
51
# File 'lib/files.com/models/inbox_registration.rb', line 49

def ip
  @attributes[:ip]
end

#ip=(value) ⇒ Object



53
54
55
# File 'lib/files.com/models/inbox_registration.rb', line 53

def ip=(value)
  @attributes[:ip] = value
end

#nameObject

string - Registrant name



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

def name
  @attributes[:name]
end

#name=(value) ⇒ Object



26
27
28
# File 'lib/files.com/models/inbox_registration.rb', line 26

def name=(value)
  @attributes[:name] = value
end

#passwordObject

string - Inbox password



135
136
137
# File 'lib/files.com/models/inbox_registration.rb', line 135

def password
  @attributes[:password]
end

#password=(value) ⇒ Object



139
140
141
# File 'lib/files.com/models/inbox_registration.rb', line 139

def password=(value)
  @attributes[:password] = value
end

#saveObject



143
144
145
146
147
148
149
150
151
152
# File 'lib/files.com/models/inbox_registration.rb', line 143

def save
  if @attributes[:id]
    raise NotImplementedError.new("The InboxRegistration object doesn't support updates.")
  else
    new_obj = InboxRegistration.create(@attributes, @options)
  end

  @attributes = new_obj.attributes
  true
end