Class: Files::SupportRequest

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}, options = {}) ⇒ SupportRequest

Returns a new instance of SupportRequest.



7
8
9
10
# File 'lib/files.com/models/support_request.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/support_request.rb', line 5

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

Class Method Details

.all(params = {}, options = {}) ⇒ Object



155
156
157
# File 'lib/files.com/models/support_request.rb', line 155

def self.all(params = {}, options = {})
  list(params, options)
end

.create(params = {}, options = {}) ⇒ Object

Parameters:

customer_success_access - string - Enable Customer Support access to your user account?
access_reset - boolean - If set to `true`, will reset the customer success access window.
email (required) - string - Email address of the user requesting support.
subject (required) - string - Subject of the support request.
comment (required) - string - Main body of the support request.
priority - string - Priority. Can be `low` (e.g. general or billing/account questions), `normal` (e.g. the system is impaired), `high` (e.g. a production workflow or business process is impaired), `urgent` (e.g. a production workflow or business process is down), `critical` (e.g. a business-critical workflow or business process is down)
phone_number - string - Support Request phone number
name - string - Support Request name
attachments_files - array(file)


169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/files.com/models/support_request.rb', line 169

def self.create(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: customer_success_access must be an String") if params[:customer_success_access] and !params[:customer_success_access].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: subject must be an String") if params[:subject] and !params[:subject].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: comment must be an String") if params[:comment] and !params[:comment].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: priority must be an String") if params[:priority] and !params[:priority].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: phone_number must be an String") if params[:phone_number] and !params[:phone_number].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: attachments_files must be an Array") if params[:attachments_files] and !params[:attachments_files].is_a?(Array)
  raise MissingParameterError.new("Parameter missing: email") unless params[:email]
  raise MissingParameterError.new("Parameter missing: subject") unless params[:subject]
  raise MissingParameterError.new("Parameter missing: comment") unless params[:comment]

  response, options = Api.send_request("/support_requests", :post, params, options)
  SupportRequest.new(response.data, 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 .


188
189
190
191
192
193
# File 'lib/files.com/models/support_request.rb', line 188

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)

  response, options = Api.send_request("/support_requests/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 .


145
146
147
148
149
150
151
152
153
# File 'lib/files.com/models/support_request.rb', line 145

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)

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

.update(id, params = {}, options = {}) ⇒ Object

Parameters:

customer_success_access - string - Enable Customer Support access to your user account?
access_reset - boolean - If set to `true`, will reset the customer success access window.


198
199
200
201
202
203
204
205
206
207
# File 'lib/files.com/models/support_request.rb', line 198

def self.update(id, params = {}, options = {})
  params ||= {}
  params[:id] = id
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: customer_success_access must be an String") if params[:customer_success_access] and !params[:customer_success_access].is_a?(String)
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]

  response, options = Api.send_request("/support_requests/#{params[:id]}", :patch, params, options)
  SupportRequest.new(response.data, options)
end

Instance Method Details

#access_resetObject

boolean - If set to true, will reset the customer success access window.



90
91
92
# File 'lib/files.com/models/support_request.rb', line 90

def access_reset
  @attributes[:access_reset]
end

#access_reset=(value) ⇒ Object



94
95
96
# File 'lib/files.com/models/support_request.rb', line 94

def access_reset=(value)
  @attributes[:access_reset] = value
end

#access_untilObject

date - Customer Support can access your user account up through this date/time.



45
46
47
# File 'lib/files.com/models/support_request.rb', line 45

def access_until
  @attributes[:access_until]
end

#access_until=(value) ⇒ Object



49
50
51
# File 'lib/files.com/models/support_request.rb', line 49

def access_until=(value)
  @attributes[:access_until] = value
end

#attachments_filesObject

array(file)



108
109
110
# File 'lib/files.com/models/support_request.rb', line 108

def attachments_files
  @attributes[:attachments_files]
end

#attachments_files=(value) ⇒ Object



112
113
114
# File 'lib/files.com/models/support_request.rb', line 112

def attachments_files=(value)
  @attributes[:attachments_files] = value
end

#commentObject

string - Main body of the support request.



31
32
33
# File 'lib/files.com/models/support_request.rb', line 31

def comment
  @attributes[:comment]
end

#comment=(value) ⇒ Object



35
36
37
# File 'lib/files.com/models/support_request.rb', line 35

def comment=(value)
  @attributes[:comment] = value
end

#created_atObject

date - When this support request was made.



40
41
42
# File 'lib/files.com/models/support_request.rb', line 40

def created_at
  @attributes[:created_at]
end

#customer_success_accessObject

string - Enable Customer Support access to your user account?



54
55
56
# File 'lib/files.com/models/support_request.rb', line 54

def customer_success_access
  @attributes[:customer_success_access]
end

#customer_success_access=(value) ⇒ Object



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

def customer_success_access=(value)
  @attributes[:customer_success_access] = value
end

#emailObject

string - Email address of the user requesting support.



99
100
101
# File 'lib/files.com/models/support_request.rb', line 99

def email
  @attributes[:email]
end

#email=(value) ⇒ Object



103
104
105
# File 'lib/files.com/models/support_request.rb', line 103

def email=(value)
  @attributes[:email] = value
end

#idObject

int64 - ID



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

def id
  @attributes[:id]
end

#id=(value) ⇒ Object



17
18
19
# File 'lib/files.com/models/support_request.rb', line 17

def id=(value)
  @attributes[:id] = value
end

#nameObject

string - Support Request name



72
73
74
# File 'lib/files.com/models/support_request.rb', line 72

def name
  @attributes[:name]
end

#name=(value) ⇒ Object



76
77
78
# File 'lib/files.com/models/support_request.rb', line 76

def name=(value)
  @attributes[:name] = value
end

#phone_numberObject

string - Support Request phone number



81
82
83
# File 'lib/files.com/models/support_request.rb', line 81

def phone_number
  @attributes[:phone_number]
end

#phone_number=(value) ⇒ Object



85
86
87
# File 'lib/files.com/models/support_request.rb', line 85

def phone_number=(value)
  @attributes[:phone_number] = value
end

#priorityObject

string - Priority. Can be low (e.g. general or billing/account questions), normal (e.g. the system is impaired), high (e.g. a production workflow or business process is impaired), urgent (e.g. a production workflow or business process is down), critical (e.g. a business-critical workflow or business process is down)



63
64
65
# File 'lib/files.com/models/support_request.rb', line 63

def priority
  @attributes[:priority]
end

#priority=(value) ⇒ Object



67
68
69
# File 'lib/files.com/models/support_request.rb', line 67

def priority=(value)
  @attributes[:priority] = value
end

#saveObject



130
131
132
133
134
135
136
137
138
139
# File 'lib/files.com/models/support_request.rb', line 130

def save
  if @attributes[:id]
    new_obj = update(@attributes)
  else
    new_obj = SupportRequest.create(@attributes, @options)
  end

  @attributes = new_obj.attributes
  true
end

#subjectObject

string - Subject of the support request.



22
23
24
# File 'lib/files.com/models/support_request.rb', line 22

def subject
  @attributes[:subject]
end

#subject=(value) ⇒ Object



26
27
28
# File 'lib/files.com/models/support_request.rb', line 26

def subject=(value)
  @attributes[:subject] = value
end

#update(params = {}) ⇒ Object

Parameters:

customer_success_access - string - Enable Customer Support access to your user account?
access_reset - boolean - If set to `true`, will reset the customer success access window.


119
120
121
122
123
124
125
126
127
128
# File 'lib/files.com/models/support_request.rb', line 119

def update(params = {})
  params ||= {}
  params[:id] = @attributes[:id]
  raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: customer_success_access must be an String") if params[:customer_success_access] and !params[:customer_success_access].is_a?(String)
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]

  Api.send_request("/support_requests/#{@attributes[:id]}", :patch, params, @options)
end