Class: Files::BundleRegistration

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of BundleRegistration.



7
8
9
10
# File 'lib/files.com/models/bundle_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/bundle_registration.rb', line 5

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

Class Method Details

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



181
182
183
# File 'lib/files.com/models/bundle_registration.rb', line 181

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

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

Parameters:

bundle_recipient_registration_code - string - Bundle recipient registration code
password - string - Public bundle password.
company - string - Registrant company name
email - string - Registrant email address
name - string - Registrant name
bundle_code (required) - string - Bundle URL code


192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/files.com/models/bundle_registration.rb', line 192

def self.create(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: bundle_recipient_registration_code must be an String") if params[:bundle_recipient_registration_code] and !params[:bundle_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: 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 InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: bundle_code must be an String") if params[:bundle_code] and !params[:bundle_code].is_a?(String)
  raise MissingParameterError.new("Parameter missing: bundle_code") unless params[:bundle_code]

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

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

Parameters:

user_id - int64 - User ID.  Provide a value of `0` to operate the current session's user.
sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `workspace_id`, `bundle_id` or `created_at`.
bundle_id - int64 - ID of the associated Bundle


220
221
222
223
224
225
226
227
# File 'lib/files.com/models/bundle_registration.rb', line 220

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

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

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

Parameters:

bundle_registration_code (required) - string - Bundle registration cookie code
upload_in_progress - boolean - Flag that indicates if current upload is going during this registration session


208
209
210
211
212
213
214
# File 'lib/files.com/models/bundle_registration.rb', line 208

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

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

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

Parameters:

user_id - int64 - User ID.  Provide a value of `0` to operate the current session's user.
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).
sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `workspace_id`, `bundle_id` or `created_at`.
bundle_id - int64 - ID of the associated Bundle


169
170
171
172
173
174
175
176
177
178
179
# File 'lib/files.com/models/bundle_registration.rb', line 169

def self.list(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer)
  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: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
  raise InvalidParameterError.new("Bad parameter: bundle_id must be an Integer") if params[:bundle_id] and !params[:bundle_id].is_a?(Integer)

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

Instance Method Details

#bundle_codeObject

string - Bundle URL code



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

def bundle_code
  @attributes[:bundle_code]
end

#bundle_code=(value) ⇒ Object



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

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

#bundle_idObject

int64 - Id of associated bundle



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

def bundle_id
  @attributes[:bundle_id]
end

#bundle_id=(value) ⇒ Object



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

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

#bundle_recipient_idObject

int64 - Id of associated bundle recipient



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

def bundle_recipient_id
  @attributes[:bundle_recipient_id]
end

#bundle_recipient_id=(value) ⇒ Object



116
117
118
# File 'lib/files.com/models/bundle_registration.rb', line 116

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

#bundle_recipient_registration_codeObject

string - Bundle recipient registration code



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

def bundle_recipient_registration_code
  @attributes[:bundle_recipient_registration_code]
end

#bundle_recipient_registration_code=(value) ⇒ Object



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

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

#clickwrap_bodyObject

string - Clickwrap text that was shown to the registrant



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

def clickwrap_body
  @attributes[:clickwrap_body]
end

#clickwrap_body=(value) ⇒ Object



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

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

#codeObject

string - Registration cookie code



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

def code
  @attributes[:code]
end

#code=(value) ⇒ Object



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

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

#companyObject

string - Registrant company name



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

def company
  @attributes[:company]
end

#company=(value) ⇒ Object



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

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

#created_atObject

date-time - Registration creation date/time



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

def created_at
  @attributes[:created_at]
end

#emailObject

string - Registrant email address



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

def email
  @attributes[:email]
end

#email=(value) ⇒ Object



44
45
46
# File 'lib/files.com/models/bundle_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



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

def form_field_data
  @attributes[:form_field_data]
end

#form_field_data=(value) ⇒ Object



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

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

#form_field_set_idObject

int64 - Id of associated form field set



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

def form_field_set_id
  @attributes[:form_field_set_id]
end

#form_field_set_id=(value) ⇒ Object



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

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

#inbox_codeObject

string - InboxRegistration cookie code, if there is an associated InboxRegistration



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

def inbox_code
  @attributes[:inbox_code]
end

#inbox_code=(value) ⇒ Object



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

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

#ipObject

string - Registrant IP Address



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

def ip
  @attributes[:ip]
end

#ip=(value) ⇒ Object



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

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

#nameObject

string - Registrant name



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

def name
  @attributes[:name]
end

#name=(value) ⇒ Object



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

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

#passwordObject

string - Public bundle password.



144
145
146
# File 'lib/files.com/models/bundle_registration.rb', line 144

def password
  @attributes[:password]
end

#password=(value) ⇒ Object



148
149
150
# File 'lib/files.com/models/bundle_registration.rb', line 148

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

#saveObject



152
153
154
155
156
157
158
159
160
161
# File 'lib/files.com/models/bundle_registration.rb', line 152

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

  @attributes = new_obj.attributes
  true
end

#workspace_idObject

int64 - Workspace ID. 0 means the default workspace.



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

def workspace_id
  @attributes[:workspace_id]
end

#workspace_id=(value) ⇒ Object



125
126
127
# File 'lib/files.com/models/bundle_registration.rb', line 125

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