Class: Files::PublicInbox

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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 = {}, 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/public_inbox.rb', line 5

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @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 = {}, options = {})
  list(params, options)
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 = {}, options = {})
  response, options = Api.send_request("/public_inboxes/create_export", :post, params, options)
  Export.new(response.data, options)
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 = {}, options = {})
  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, options = Api.send_request("/public_inboxes/key/#{params[:key]}", :get, params, options)
  PublicInbox.new(response.data, options)
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 = {}, 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)

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

Instance Method Details

#clickwrap_bodyObject

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_leftObject

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

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_textObject

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_topObject

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_textObject

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

#descriptionObject

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_uploadsObject

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_setObject

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_passwordObject

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_textObject

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

#keyObject

string - Unique key for inbox



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

def key
  @attributes[:key]
end

#logoObject

Image - Custom logo for Inbox folder



93
94
95
# File 'lib/files.com/models/public_inbox.rb', line 93

def 
  @attributes[:logo]
end

#logo_click_hrefObject

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_logoutObject

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_registrationObject

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_pageObject

boolean - Show this inbox on site login page?



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

def 
  @attributes[:show_on_login_page]
end

#thumbnailObject

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

#titleObject

string - Inbox title



38
39
40
# File 'lib/files.com/models/public_inbox.rb', line 38

def title
  @attributes[:title]
end