Class: Files::Inbox
- Inherits:
-
Object
- Object
- Files::Inbox
- Defined in:
- lib/files.com/models/inbox.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_export(params = {}, options = {}) ⇒ Object
Parameters: sort_by - object - If set, sort records by the specified field in either
ascordescdirection. -
.list(params = {}, options = {}) ⇒ Object
Parameters: cursor - string - Used for pagination.
Instance Method Summary collapse
-
#allow_whitelisting ⇒ Object
boolean - allow/disallow whitelist.
-
#clickwrap_body ⇒ Object
string - Legal text that must be agreed to prior to accessing Inbox.
-
#description ⇒ Object
string - User description.
-
#disable_web_upload ⇒ Object
boolean - This will disable the upload URL and can only be done if uploads via email are enabled.
-
#dont_allow_folders_in_uploads ⇒ Object
boolean - Should folder uploads be prevented?.
-
#form_field_set ⇒ Object
FormFieldSet - Custom Form to use.
-
#has_password ⇒ Object
boolean - Is this inbox password protected?.
-
#help_text ⇒ Object
string - Text that will be shown to the users on the Inbox.
-
#inbound_email_address ⇒ Object
string - inbound email address to the inbox.
-
#initialize(attributes = {}, options = {}) ⇒ Inbox
constructor
A new instance of Inbox.
-
#key ⇒ Object
string - Unique key for inbox.
-
#notify_senders_on_successful_uploads_via_email ⇒ Object
boolean - Notify senders on successful uploads via email.
-
#notify_senders_on_successful_uploads_via_web ⇒ Object
boolean - Notify senders on successful uploads via web.
-
#require_registration ⇒ Object
boolean - Does this inbox require registration?.
-
#show_on_login_page ⇒ Object
boolean - Show this inbox on site login page?.
-
#title ⇒ Object
string - Inbox title.
-
#whitelist ⇒ Object
array(string) - A list of emails and domain names for whitelisting.
Constructor Details
#initialize(attributes = {}, options = {}) ⇒ Inbox
Returns a new instance of Inbox.
7 8 9 10 |
# File 'lib/files.com/models/inbox.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/inbox.rb', line 5 def attributes @attributes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/inbox.rb', line 5 def @options end |
Class Method Details
.all(params = {}, options = {}) ⇒ Object
108 109 110 |
# File 'lib/files.com/models/inbox.rb', line 108 def self.all(params = {}, = {}) list(params, ) end |
.create_export(params = {}, options = {}) ⇒ Object
Parameters:
sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are .
filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `allow_whitelisting`.
115 116 117 118 119 120 121 |
# File 'lib/files.com/models/inbox.rb', line 115 def self.create_export(params = {}, = {}) 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: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash) response, = Api.send_request("/inboxes/create_export", :post, params, ) Export.new(response.data, ) 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).
sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are .
filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `allow_whitelisting`.
97 98 99 100 101 102 103 104 105 106 |
# File 'lib/files.com/models/inbox.rb', line 97 def self.list(params = {}, = {}) 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: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash) List.new(Inbox, params) do Api.send_request("/inboxes", :get, params, ) end end |
Instance Method Details
#allow_whitelisting ⇒ Object
boolean - allow/disallow whitelist
73 74 75 |
# File 'lib/files.com/models/inbox.rb', line 73 def allow_whitelisting @attributes[:allow_whitelisting] end |
#clickwrap_body ⇒ Object
string - Legal text that must be agreed to prior to accessing Inbox.
53 54 55 |
# File 'lib/files.com/models/inbox.rb', line 53 def clickwrap_body @attributes[:clickwrap_body] end |
#description ⇒ Object
string - User description
18 19 20 |
# File 'lib/files.com/models/inbox.rb', line 18 def description @attributes[:description] end |
#disable_web_upload ⇒ Object
boolean - This will disable the upload URL and can only be done if uploads via email are enabled
83 84 85 |
# File 'lib/files.com/models/inbox.rb', line 83 def disable_web_upload @attributes[:disable_web_upload] end |
#dont_allow_folders_in_uploads ⇒ Object
boolean - Should folder uploads be prevented?
48 49 50 |
# File 'lib/files.com/models/inbox.rb', line 48 def dont_allow_folders_in_uploads @attributes[:dont_allow_folders_in_uploads] end |
#form_field_set ⇒ Object
FormFieldSet - Custom Form to use
58 59 60 |
# File 'lib/files.com/models/inbox.rb', line 58 def form_field_set @attributes[:form_field_set] end |
#has_password ⇒ Object
boolean - Is this inbox password protected?
38 39 40 |
# File 'lib/files.com/models/inbox.rb', line 38 def has_password @attributes[:has_password] end |
#help_text ⇒ Object
string - Text that will be shown to the users on the Inbox. Use this field to provide custom instructions.
23 24 25 |
# File 'lib/files.com/models/inbox.rb', line 23 def help_text @attributes[:help_text] end |
#inbound_email_address ⇒ Object
string - inbound email address to the inbox
88 89 90 |
# File 'lib/files.com/models/inbox.rb', line 88 def inbound_email_address @attributes[:inbound_email_address] end |
#key ⇒ Object
string - Unique key for inbox
28 29 30 |
# File 'lib/files.com/models/inbox.rb', line 28 def key @attributes[:key] end |
#notify_senders_on_successful_uploads_via_email ⇒ Object
boolean - Notify senders on successful uploads via email
63 64 65 |
# File 'lib/files.com/models/inbox.rb', line 63 def notify_senders_on_successful_uploads_via_email @attributes[:notify_senders_on_successful_uploads_via_email] end |
#notify_senders_on_successful_uploads_via_web ⇒ Object
boolean - Notify senders on successful uploads via web
68 69 70 |
# File 'lib/files.com/models/inbox.rb', line 68 def notify_senders_on_successful_uploads_via_web @attributes[:notify_senders_on_successful_uploads_via_web] end |
#require_registration ⇒ Object
boolean - Does this inbox require registration?
43 44 45 |
# File 'lib/files.com/models/inbox.rb', line 43 def require_registration @attributes[:require_registration] end |
#show_on_login_page ⇒ Object
boolean - Show this inbox on site login page?
33 34 35 |
# File 'lib/files.com/models/inbox.rb', line 33 def show_on_login_page @attributes[:show_on_login_page] end |
#title ⇒ Object
string - Inbox title
13 14 15 |
# File 'lib/files.com/models/inbox.rb', line 13 def title @attributes[:title] end |
#whitelist ⇒ Object
array(string) - A list of emails and domain names for whitelisting
78 79 80 |
# File 'lib/files.com/models/inbox.rb', line 78 def whitelist @attributes[:whitelist] end |