Class: Files::PublicInbox
- Inherits:
-
Object
- Object
- Files::PublicInbox
- Defined in:
- lib/files.com/models/public_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
-
.get_key(key, params = {}, options = {}) ⇒ Object
Parameters: key (required) - string - Unique key for inbox recipient_code - string - Inbox recipient code.
-
.list(params = {}, options = {}) ⇒ Object
Parameters: cursor - string - Used for pagination.
Instance Method Summary collapse
-
#clickwrap_body ⇒ Object
string - Legal text that must be agreed to prior to accessing Inbox.
-
#color_left ⇒ Object
string - Page link and button color.
-
#color_link ⇒ Object
string - Top bar link color.
-
#color_text ⇒ Object
string - Page link and button color.
-
#color_top ⇒ Object
string - Top bar background color.
-
#color_top_text ⇒ Object
string - Top bar text color.
-
#description ⇒ Object
string - User description.
-
#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.
-
#initialize(attributes = {}, options = {}) ⇒ PublicInbox
constructor
A new instance of PublicInbox.
-
#key ⇒ Object
string - Unique key for inbox.
-
#logo ⇒ Object
Image - Custom logo for Inbox folder.
-
#logo_click_href ⇒ Object
string - URL to open when a public visitor clicks the custom logo.
-
#require_logout ⇒ Object
boolean - If true, we will hide the 'Remember Me' box on the Inbox registration page, requiring that the user logout and log back in every time they visit the page.
-
#require_registration ⇒ Object
boolean - Does this inbox require registration?.
-
#show_on_login_page ⇒ Object
boolean - Show this inbox on site login page?.
-
#thumbnail ⇒ Object
Image - Custom logo thumbnail for Inbox folder.
-
#title ⇒ Object
string - Inbox title.
Constructor Details
#initialize(attributes = {}, options = {}) ⇒ PublicInbox
Returns a new instance of PublicInbox.
7 8 9 10 |
# File 'lib/files.com/models/public_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/public_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/public_inbox.rb', line 5 def @options end |
Class Method Details
.all(params = {}, options = {}) ⇒ Object
119 120 121 |
# File 'lib/files.com/models/public_inbox.rb', line 119 def self.all(params = {}, = {}) list(params, ) end |
.create_export(params = {}, options = {}) ⇒ Object
137 138 139 140 |
# File 'lib/files.com/models/public_inbox.rb', line 137 def self.create_export(params = {}, = {}) response, = Api.send_request("/public_inboxes/create_export", :post, params, ) Export.new(response.data, ) end |
.get_key(key, params = {}, options = {}) ⇒ Object
Parameters:
key (required) - string - Unique key for inbox
recipient_code - string - Inbox recipient code
126 127 128 129 130 131 132 133 134 135 |
# File 'lib/files.com/models/public_inbox.rb', line 126 def self.get_key(key, params = {}, = {}) params ||= {} params[:key] = key raise InvalidParameterError.new("Bad parameter: key must be an String") if params[:key] and !params[:key].is_a?(String) raise InvalidParameterError.new("Bad parameter: recipient_code must be an String") if params[:recipient_code] and !params[:recipient_code].is_a?(String) raise MissingParameterError.new("Parameter missing: key") unless params[:key] response, = Api.send_request("/public_inboxes/key/#{params[:key]}", :get, params, ) PublicInbox.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).
110 111 112 113 114 115 116 117 |
# File 'lib/files.com/models/public_inbox.rb', line 110 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) List.new(PublicInbox, params) do Api.send_request("/public_inboxes", :get, params, ) end end |
Instance Method Details
#clickwrap_body ⇒ Object
string - Legal text that must be agreed to prior to accessing Inbox.
78 79 80 |
# File 'lib/files.com/models/public_inbox.rb', line 78 def clickwrap_body @attributes[:clickwrap_body] end |
#color_left ⇒ Object
string - Page link and button color
13 14 15 |
# File 'lib/files.com/models/public_inbox.rb', line 13 def color_left @attributes[:color_left] end |
#color_link ⇒ Object
string - Top bar link color
18 19 20 |
# File 'lib/files.com/models/public_inbox.rb', line 18 def color_link @attributes[:color_link] end |
#color_text ⇒ Object
string - Page link and button color
23 24 25 |
# File 'lib/files.com/models/public_inbox.rb', line 23 def color_text @attributes[:color_text] end |
#color_top ⇒ Object
string - Top bar background color
28 29 30 |
# File 'lib/files.com/models/public_inbox.rb', line 28 def color_top @attributes[:color_top] end |
#color_top_text ⇒ Object
string - Top bar text color
33 34 35 |
# File 'lib/files.com/models/public_inbox.rb', line 33 def color_top_text @attributes[:color_top_text] end |
#description ⇒ Object
string - User description
43 44 45 |
# File 'lib/files.com/models/public_inbox.rb', line 43 def description @attributes[:description] end |
#dont_allow_folders_in_uploads ⇒ Object
boolean - Should folder uploads be prevented?
73 74 75 |
# File 'lib/files.com/models/public_inbox.rb', line 73 def dont_allow_folders_in_uploads @attributes[:dont_allow_folders_in_uploads] end |
#form_field_set ⇒ Object
FormFieldSet - Custom Form to use
83 84 85 |
# File 'lib/files.com/models/public_inbox.rb', line 83 def form_field_set @attributes[:form_field_set] end |
#has_password ⇒ Object
boolean - Is this inbox password protected?
63 64 65 |
# File 'lib/files.com/models/public_inbox.rb', line 63 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.
48 49 50 |
# File 'lib/files.com/models/public_inbox.rb', line 48 def help_text @attributes[:help_text] end |
#key ⇒ Object
string - Unique key for inbox
53 54 55 |
# File 'lib/files.com/models/public_inbox.rb', line 53 def key @attributes[:key] end |
#logo ⇒ Object
Image - Custom logo for Inbox folder
93 94 95 |
# File 'lib/files.com/models/public_inbox.rb', line 93 def logo @attributes[:logo] end |
#logo_click_href ⇒ Object
string - URL to open when a public visitor clicks the custom logo
98 99 100 |
# File 'lib/files.com/models/public_inbox.rb', line 98 def logo_click_href @attributes[:logo_click_href] end |
#require_logout ⇒ Object
boolean - If true, we will hide the 'Remember Me' box on the Inbox registration page, requiring that the user logout and log back in every time they visit the page.
88 89 90 |
# File 'lib/files.com/models/public_inbox.rb', line 88 def require_logout @attributes[:require_logout] end |
#require_registration ⇒ Object
boolean - Does this inbox require registration?
68 69 70 |
# File 'lib/files.com/models/public_inbox.rb', line 68 def require_registration @attributes[:require_registration] end |
#show_on_login_page ⇒ Object
boolean - Show this inbox on site login page?
58 59 60 |
# File 'lib/files.com/models/public_inbox.rb', line 58 def show_on_login_page @attributes[:show_on_login_page] end |
#thumbnail ⇒ Object
Image - Custom logo thumbnail for Inbox folder
103 104 105 |
# File 'lib/files.com/models/public_inbox.rb', line 103 def thumbnail @attributes[:thumbnail] end |
#title ⇒ Object
string - Inbox title
38 39 40 |
# File 'lib/files.com/models/public_inbox.rb', line 38 def title @attributes[:title] end |