Class: Files::SupportRequest
- Inherits:
-
Object
- Object
- Files::SupportRequest
- Defined in:
- lib/files.com/models/support_request.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
-
.create(params = {}, options = {}) ⇒ Object
Parameters: email (required) - string - Email address of the user requesting support.
Instance Method Summary collapse
-
#attachments_files ⇒ Object
array(file) - Files to send to Customer Success along with this support request.
- #attachments_files=(value) ⇒ Object
-
#comment ⇒ Object
string - Main body of the support request.
- #comment=(value) ⇒ Object
-
#customer_success_access ⇒ Object
string - Enable Customer Success access to your user account?.
- #customer_success_access=(value) ⇒ Object
-
#email ⇒ Object
string - Email address of the user requesting support.
- #email=(value) ⇒ Object
-
#id ⇒ Object
int64 - ID.
- #id=(value) ⇒ Object
-
#initialize(attributes = {}, options = {}) ⇒ SupportRequest
constructor
A new instance of SupportRequest.
-
#priority ⇒ Object
string - Priority.
- #priority=(value) ⇒ Object
- #save ⇒ Object
-
#subject ⇒ Object
string - Subject of the support request.
- #subject=(value) ⇒ Object
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 = {}, = {}) @attributes = attributes || {} @options = || {} end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
5 6 7 |
# File 'lib/files.com/models/support_request.rb', line 5 def attributes @attributes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/support_request.rb', line 5 def @options end |
Class Method Details
.create(params = {}, options = {}) ⇒ Object
Parameters:
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.
customer_success_access - string - Enable Customer Success access to your user account?
priority - string - Priority. Can be `low` (e.g. general or billing/acount 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)
attachments_files - array - Files to send to Customer Success along with this support request
91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/files.com/models/support_request.rb', line 91 def self.create(params = {}, = {}) raise InvalidParameterError.new("Bad parameter: email must be an String") if params.dig(:email) and !params.dig(:email).is_a?(String) raise InvalidParameterError.new("Bad parameter: subject must be an String") if params.dig(:subject) and !params.dig(:subject).is_a?(String) raise InvalidParameterError.new("Bad parameter: comment must be an String") if params.dig(:comment) and !params.dig(:comment).is_a?(String) raise InvalidParameterError.new("Bad parameter: customer_success_access must be an String") if params.dig(:customer_success_access) and !params.dig(:customer_success_access).is_a?(String) raise InvalidParameterError.new("Bad parameter: priority must be an String") if params.dig(:priority) and !params.dig(:priority).is_a?(String) raise InvalidParameterError.new("Bad parameter: attachments_files must be an Array") if params.dig(:attachments_files) and !params.dig(:attachments_files).is_a?(Array) raise MissingParameterError.new("Parameter missing: email") unless params.dig(:email) raise MissingParameterError.new("Parameter missing: subject") unless params.dig(:subject) raise MissingParameterError.new("Parameter missing: comment") unless params.dig(:comment) response, = Api.send_request("/support_requests", :post, params, ) SupportRequest.new(response.data, ) end |
Instance Method Details
#attachments_files ⇒ Object
array(file) - Files to send to Customer Success along with this support request
67 68 69 |
# File 'lib/files.com/models/support_request.rb', line 67 def @attributes[:attachments_files] end |
#attachments_files=(value) ⇒ Object
71 72 73 |
# File 'lib/files.com/models/support_request.rb', line 71 def (value) @attributes[:attachments_files] = value end |
#comment ⇒ Object
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 |
#customer_success_access ⇒ Object
string - Enable Customer Success access to your user account?
40 41 42 |
# File 'lib/files.com/models/support_request.rb', line 40 def customer_success_access @attributes[:customer_success_access] end |
#customer_success_access=(value) ⇒ Object
44 45 46 |
# File 'lib/files.com/models/support_request.rb', line 44 def customer_success_access=(value) @attributes[:customer_success_access] = value end |
#email ⇒ Object
string - Email address of the user requesting support.
58 59 60 |
# File 'lib/files.com/models/support_request.rb', line 58 def email @attributes[:email] end |
#email=(value) ⇒ Object
62 63 64 |
# File 'lib/files.com/models/support_request.rb', line 62 def email=(value) @attributes[:email] = value end |
#id ⇒ Object
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 |
#priority ⇒ Object
string - Priority. Can be ‘low` (e.g. general or billing/acount 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)
49 50 51 |
# File 'lib/files.com/models/support_request.rb', line 49 def priority @attributes[:priority] end |
#priority=(value) ⇒ Object
53 54 55 |
# File 'lib/files.com/models/support_request.rb', line 53 def priority=(value) @attributes[:priority] = value end |
#save ⇒ Object
75 76 77 78 79 80 81 82 |
# File 'lib/files.com/models/support_request.rb', line 75 def save if @attributes[:id] raise NotImplementedError.new("The SupportRequest object doesn't support updates.") else new_obj = SupportRequest.create(@attributes, @options) @attributes = new_obj.attributes end end |
#subject ⇒ Object
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 |