Class: Files::Inbox

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @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 = {}, options = {})
  list(params, options)
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 = {}, options = {})
  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, options = Api.send_request("/inboxes/create_export", :post, params, options)
  Export.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).
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 = {}, 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)
  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, options)
  end
end

Instance Method Details

#allow_whitelistingObject

boolean - allow/disallow whitelist



73
74
75
# File 'lib/files.com/models/inbox.rb', line 73

def allow_whitelisting
  @attributes[:allow_whitelisting]
end

#clickwrap_bodyObject

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

#descriptionObject

string - User description



18
19
20
# File 'lib/files.com/models/inbox.rb', line 18

def description
  @attributes[:description]
end

#disable_web_uploadObject

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_uploadsObject

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_setObject

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_passwordObject

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_textObject

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_addressObject

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

#keyObject

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_emailObject

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_webObject

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_registrationObject

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_pageObject

boolean - Show this inbox on site login page?



33
34
35
# File 'lib/files.com/models/inbox.rb', line 33

def 
  @attributes[:show_on_login_page]
end

#titleObject

string - Inbox title



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

def title
  @attributes[:title]
end

#whitelistObject

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