Class: Files::BundleRegistration
- Inherits:
-
Object
- Object
- Files::BundleRegistration
- Defined in:
- lib/files.com/models/bundle_registration.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
- .all(params = {}, options = {}) ⇒ Object
-
.create(params = {}, options = {}) ⇒ Object
Parameters: bundle_recipient_registration_code - string - Bundle recipient registration code password - string - Public bundle password.
-
.create_export(params = {}, options = {}) ⇒ Object
Parameters: user_id - int64 - User ID.
-
.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.
-
.list(params = {}, options = {}) ⇒ Object
Parameters: user_id - int64 - User ID.
Instance Method Summary collapse
-
#bundle_code ⇒ Object
string - Bundle URL code.
- #bundle_code=(value) ⇒ Object
-
#bundle_id ⇒ Object
int64 - Id of associated bundle.
- #bundle_id=(value) ⇒ Object
-
#bundle_recipient_id ⇒ Object
int64 - Id of associated bundle recipient.
- #bundle_recipient_id=(value) ⇒ Object
-
#bundle_recipient_registration_code ⇒ Object
string - Bundle recipient registration code.
- #bundle_recipient_registration_code=(value) ⇒ Object
-
#clickwrap_body ⇒ Object
string - Clickwrap text that was shown to the registrant.
- #clickwrap_body=(value) ⇒ Object
-
#code ⇒ Object
string - Registration cookie code.
- #code=(value) ⇒ Object
-
#company ⇒ Object
string - Registrant company name.
- #company=(value) ⇒ Object
-
#created_at ⇒ Object
date-time - Registration creation date/time.
-
#email ⇒ Object
string - Registrant email address.
- #email=(value) ⇒ Object
-
#form_field_data ⇒ Object
object - Data for form field set with form field ids as keys and user data as values.
- #form_field_data=(value) ⇒ Object
-
#form_field_set_id ⇒ Object
int64 - Id of associated form field set.
- #form_field_set_id=(value) ⇒ Object
-
#inbox_code ⇒ Object
string - InboxRegistration cookie code, if there is an associated InboxRegistration.
- #inbox_code=(value) ⇒ Object
-
#initialize(attributes = {}, options = {}) ⇒ BundleRegistration
constructor
A new instance of BundleRegistration.
-
#ip ⇒ Object
string - Registrant IP Address.
- #ip=(value) ⇒ Object
-
#name ⇒ Object
string - Registrant name.
- #name=(value) ⇒ Object
-
#password ⇒ Object
string - Public bundle password.
- #password=(value) ⇒ Object
- #save ⇒ Object
-
#workspace_id ⇒ Object
int64 - Workspace ID.
- #workspace_id=(value) ⇒ Object
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 = {}, = {}) @attributes = attributes || {} @options = || {} end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
5 6 7 |
# File 'lib/files.com/models/bundle_registration.rb', line 5 def attributes @attributes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/bundle_registration.rb', line 5 def @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 = {}, = {}) list(params, ) 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 = {}, = {}) 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, = Api.send_request("/bundle_registrations", :post, params, ) BundleRegistration.new(response.data, ) 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 = {}, = {}) 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, = Api.send_request("/bundle_registrations/create_export", :post, params, ) Export.new(response.data, ) 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 = {}, = {}) 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, ) 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 = {}, = {}) 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, ) end end |
Instance Method Details
#bundle_code ⇒ Object
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_id ⇒ Object
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_id ⇒ Object
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_code ⇒ Object
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_body ⇒ Object
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 |
#code ⇒ Object
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 |
#company ⇒ Object
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_at ⇒ Object
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 |
#email ⇒ Object
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_data ⇒ Object
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_id ⇒ Object
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_code ⇒ Object
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 |
#ip ⇒ Object
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 |
#name ⇒ Object
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 |
#password ⇒ Object
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 |
#save ⇒ Object
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_id ⇒ Object
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 |