docspring 4.6.0 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/README.md +8 -1
  4. data/lib/docspring/api/client.rb +494 -0
  5. data/lib/docspring/api_client.rb +1 -1
  6. data/lib/docspring/models/ask_support_help_request.rb +217 -0
  7. data/lib/docspring/models/error_code.rb +4 -1
  8. data/lib/docspring/models/error_info.rb +12 -2
  9. data/lib/docspring/models/open_support_ticket_request.rb +363 -0
  10. data/lib/docspring/models/reply_to_support_ticket_request.rb +217 -0
  11. data/lib/docspring/models/send_support_feedback_request.rb +363 -0
  12. data/lib/docspring/models/support_feedback.rb +239 -0
  13. data/lib/docspring/models/support_help.rb +316 -0
  14. data/lib/docspring/models/support_help_source.rb +212 -0
  15. data/lib/docspring/models/support_help_state.rb +42 -0
  16. data/lib/docspring/models/support_help_turn.rb +234 -0
  17. data/lib/docspring/models/support_help_turn_role.rb +41 -0
  18. data/lib/docspring/models/support_message.rb +301 -0
  19. data/lib/docspring/models/support_message_author.rb +42 -0
  20. data/lib/docspring/models/support_report_agent.rb +188 -0
  21. data/lib/docspring/models/support_report_category.rb +57 -0
  22. data/lib/docspring/models/support_report_impact.rb +42 -0
  23. data/lib/docspring/models/support_report_kind.rb +47 -0
  24. data/lib/docspring/models/support_report_source.rb +41 -0
  25. data/lib/docspring/models/support_ticket.rb +637 -0
  26. data/lib/docspring/models/support_ticket_list.rb +200 -0
  27. data/lib/docspring/models/support_ticket_list_status.rb +42 -0
  28. data/lib/docspring/models/support_ticket_notifications.rb +197 -0
  29. data/lib/docspring/models/support_ticket_reply.rb +210 -0
  30. data/lib/docspring/models/support_ticket_reply_outcome.rb +41 -0
  31. data/lib/docspring/models/support_ticket_resolution.rb +45 -0
  32. data/lib/docspring/models/support_ticket_status.rb +43 -0
  33. data/lib/docspring/models/support_ticket_watch.rb +239 -0
  34. data/lib/docspring/request_schemas.json +426 -0
  35. data/lib/docspring/version.rb +1 -1
  36. data/lib/docspring.rb +26 -0
  37. metadata +27 -1
@@ -0,0 +1,217 @@
1
+ =begin
2
+ #DocSpring API
3
+
4
+ #Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
5
+
6
+ The version of the OpenAPI document: v2
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.26.0-DOCSPRING
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DocSpring
17
+ # A question about DocSpring. Never include secrets, credentials or your users' data.
18
+ class AskSupportHelpRequest < ApiModelBase
19
+ # What you want to know, in a sentence or two. For a follow-up question, include what was asked and answered before that matters to it: each request is answered by itself.
20
+ attr_accessor :question
21
+
22
+ # The API operation, MCP tool or CLI command involved, if any.
23
+ attr_accessor :tool
24
+
25
+ # The exact error text, if any.
26
+ attr_accessor :error
27
+
28
+ # For a chat: the questions and answers so far, oldest first, when `question` follows on from them. At most 40 turns: start a new conversation after that.
29
+ attr_accessor :conversation
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'question' => :'question',
35
+ :'tool' => :'tool',
36
+ :'error' => :'error',
37
+ :'conversation' => :'conversation'
38
+ }
39
+ end
40
+
41
+ # Returns attribute mapping this model knows about
42
+ def self.acceptable_attribute_map
43
+ attribute_map
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ acceptable_attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'question' => :'String',
55
+ :'tool' => :'String',
56
+ :'error' => :'String',
57
+ :'conversation' => :'Array<SupportHelpTurn>'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ ])
65
+ end
66
+
67
+ # Returns attribute type mapping
68
+ def self.acceptable_openapi_types
69
+ openapi_types
70
+ end
71
+
72
+ # Returns the nullable attributes
73
+ def self.acceptable_openapi_nullable
74
+ openapi_nullable
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::AskSupportHelpRequest` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ acceptable_attribute_map = self.class.acceptable_attribute_map
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!acceptable_attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::AskSupportHelpRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'question')
94
+ self.question = attributes[:'question']
95
+ else
96
+ self.question = nil
97
+ end
98
+
99
+ if attributes.key?(:'tool')
100
+ self.tool = attributes[:'tool']
101
+ end
102
+
103
+ if attributes.key?(:'error')
104
+ self.error = attributes[:'error']
105
+ end
106
+
107
+ if attributes.key?(:'conversation')
108
+ if (value = attributes[:'conversation']).is_a?(Array)
109
+ self.conversation = value
110
+ end
111
+ end
112
+ end
113
+
114
+ # Show invalid properties with the reasons. Usually used together with valid?
115
+ # @return Array for valid properties with the reasons
116
+ def list_invalid_properties
117
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
118
+ invalid_properties = Array.new
119
+ if @question.nil?
120
+ invalid_properties.push('invalid value for "question", question cannot be nil.')
121
+ end
122
+
123
+ invalid_properties
124
+ end
125
+
126
+ # Check to see if the all the properties in the model are valid
127
+ # @return true if the model is valid
128
+ def valid?
129
+ warn '[DEPRECATED] the `valid?` method is obsolete'
130
+ return false if @question.nil?
131
+ true
132
+ end
133
+
134
+ # Custom attribute writer method with validation
135
+ # @param [Object] question Value to be assigned
136
+ def question=(question)
137
+ if question.nil?
138
+ fail ArgumentError, 'question cannot be nil'
139
+ end
140
+
141
+ @question = question
142
+ end
143
+
144
+ # Checks equality by comparing each attribute.
145
+ # @param [Object] Object to be compared
146
+ def ==(o)
147
+ return true if self.equal?(o)
148
+ self.class == o.class &&
149
+ question == o.question &&
150
+ tool == o.tool &&
151
+ error == o.error &&
152
+ conversation == o.conversation
153
+ end
154
+
155
+ # @see the `==` method
156
+ # @param [Object] Object to be compared
157
+ def eql?(o)
158
+ self == o
159
+ end
160
+
161
+ # Calculates hash code according to all attributes.
162
+ # @return [Integer] Hash code
163
+ def hash
164
+ [question, tool, error, conversation].hash
165
+ end
166
+
167
+ # Builds the object from hash
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ # @return [Object] Returns the model itself
170
+ def self.build_from_hash(attributes)
171
+ return nil unless attributes.is_a?(Hash)
172
+ attributes = attributes.transform_keys(&:to_sym)
173
+ # include attributes inherited from allOf parents (the nearest declaration wins)
174
+ map = acceptable_attribute_map
175
+ transformed_hash = {}
176
+ acceptable_openapi_types.each_pair do |key, type|
177
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
178
+ transformed_hash["#{key}"] = nil
179
+ elsif type =~ /\AArray<(.*)>/i
180
+ # check to ensure the input is an array given that the attribute
181
+ # is documented as an array but the input is not
182
+ if attributes[map[key]].is_a?(Array)
183
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
184
+ end
185
+ elsif !attributes[map[key]].nil?
186
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
187
+ end
188
+ end
189
+ # Responses can include enum values added after this client was released, so the enum setters
190
+ # accept any value while the model is built from a response
191
+ allocate.tap do |model|
192
+ model.instance_variable_set(:@_skip_enum_validation, true)
193
+ model.send(:initialize, transformed_hash)
194
+ model.remove_instance_variable(:@_skip_enum_validation)
195
+ end
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ # include attributes inherited from allOf parents (the nearest declaration wins)
203
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
204
+ value = self.send(attr)
205
+ if value.nil?
206
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
207
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
208
+ end
209
+
210
+ hash[param] = _to_hash(value)
211
+ end
212
+ hash
213
+ end
214
+
215
+ end
216
+
217
+ end
@@ -33,6 +33,9 @@ module DocSpring
33
33
  INVALID_DATA = "invalid_data".freeze
34
34
  RATE_LIMITED = "rate_limited".freeze
35
35
  DAILY_EMAIL_LIMIT_REACHED = "daily_email_limit_reached".freeze
36
+ SUPPORT_FEEDBACK_LIMIT_REACHED = "support_feedback_limit_reached".freeze
37
+ SUPPORT_HELP_LIMIT_REACHED = "support_help_limit_reached".freeze
38
+ SUPPORT_TICKET_LIMIT_REACHED = "support_ticket_limit_reached".freeze
36
39
  INTERNAL_ERROR = "internal_error".freeze
37
40
  BAD_GATEWAY = "bad_gateway".freeze
38
41
  SERVICE_UNAVAILABLE = "service_unavailable".freeze
@@ -42,7 +45,7 @@ module DocSpring
42
45
  IDEMPOTENCY_KEY_REUSED = "idempotency_key_reused".freeze
43
46
 
44
47
  def self.all_vars
45
- @all_vars ||= [INVALID_REQUEST, UNAUTHORIZED, PAYMENT_REQUIRED, INSUFFICIENT_CREDITS, INSUFFICIENT_CREDITS_TO_SEND, FORBIDDEN, UPGRADE_REQUIRED, ACCOUNT_SUSPENDED, NOT_FOUND, METHOD_NOT_ALLOWED, CONFLICT, GONE, REQUEST_TOO_LARGE, UNSUPPORTED_MEDIA_TYPE, VALIDATION_FAILED, INVALID_DATA, RATE_LIMITED, DAILY_EMAIL_LIMIT_REACHED, INTERNAL_ERROR, BAD_GATEWAY, SERVICE_UNAVAILABLE, UPSTREAM_TIMEOUT, POLLING_TIMEOUT, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_KEY_REUSED].freeze
48
+ @all_vars ||= [INVALID_REQUEST, UNAUTHORIZED, PAYMENT_REQUIRED, INSUFFICIENT_CREDITS, INSUFFICIENT_CREDITS_TO_SEND, FORBIDDEN, UPGRADE_REQUIRED, ACCOUNT_SUSPENDED, NOT_FOUND, METHOD_NOT_ALLOWED, CONFLICT, GONE, REQUEST_TOO_LARGE, UNSUPPORTED_MEDIA_TYPE, VALIDATION_FAILED, INVALID_DATA, RATE_LIMITED, DAILY_EMAIL_LIMIT_REACHED, SUPPORT_FEEDBACK_LIMIT_REACHED, SUPPORT_HELP_LIMIT_REACHED, SUPPORT_TICKET_LIMIT_REACHED, INTERNAL_ERROR, BAD_GATEWAY, SERVICE_UNAVAILABLE, UPSTREAM_TIMEOUT, POLLING_TIMEOUT, IDEMPOTENCY_KEY_IN_USE, IDEMPOTENCY_KEY_REUSED].freeze
46
49
  end
47
50
 
48
51
  # Builds the enum from string
@@ -16,7 +16,7 @@ require 'time'
16
16
  module DocSpring
17
17
  # What went wrong.
18
18
  class ErrorInfo < ApiModelBase
19
- # A machine-readable error code. Clients should handle codes they don't know: new codes can be added. `invalid_data`: a submission's data doesn't match its template's fields. The submission is still recorded. `insufficient_credits` (402): your credit balance can't cover a live PDF. The record was saved and waits for credits in the `insufficient_credits` state: its ID is in `submission_id`, `submission_batch_id` or `combined_pdf_id`. `insufficient_credits_to_send` (402): your credit balance can't cover a live signature request that DocSpring would email, so nothing was saved. Add credits and send the request again. `upgrade_required` (403): your plan doesn't include this, such as more templates, another active integration (webhooks count), the embedded template editor, email actions, or live signature requests before your account's first payment. `account_suspended` (403): the account is suspended, so it can't create submissions, or it's scheduled for deletion, so every request is refused until one of its users signs in to cancel that. `polling_timeout`: on a sync.api host, the files weren't ready in time. The record was created and is still being processed: its ID is in `submission_id`, `submission_batch_id`, `combined_pdf_id` or `template_id`. Without one of these IDs, the request itself got no answer in time, and the record may or may not have been created. `idempotency_key_in_use` (409): the first request with the same Idempotency-Key is still being processed, and the response has a `Retry-After` header: send the request again then. Without the header, the first request was processed but its response is no longer kept, or it failed after creating or changing a record, and the message says which. When the first request created a record, or changed a template's fields or published a version of it, the message names it, and its ID is in `submission_id`, `submission_batch_id`, `combined_pdf_id`, `template_id`, `folder_id`, `custom_file_id`, `webhook_id`, `email_action_id` or `email_domain_id` (a signature request's events and tokens have no member). `idempotency_key_reused` (422): the Idempotency-Key was already used for a different request. `rate_limited` (429): too many API requests. Wait for the `Retry-After` header's seconds. `daily_email_limit_reached` (429): a submission that DocSpring would email would take your account over its daily email limit, so nothing was saved. Send it again after the `Retry-After` header's seconds (midnight UTC), or send the signing links yourself (`send_email: false`).
19
+ # A machine-readable error code. Clients should handle codes they don't know: new codes can be added. `invalid_data`: a submission's data doesn't match its template's fields. The submission is still recorded. `insufficient_credits` (402): your credit balance can't cover a live PDF. The record was saved and waits for credits in the `insufficient_credits` state: its ID is in `submission_id`, `submission_batch_id` or `combined_pdf_id`. `insufficient_credits_to_send` (402): your credit balance can't cover a live signature request that DocSpring would email, so nothing was saved. Add credits and send the request again. `upgrade_required` (403): your plan doesn't include this, such as more templates, another active integration (webhooks count), the embedded template editor, email actions, or live signature requests before your account's first payment. `account_suspended` (403): the account is suspended, so it can't create submissions, or it's scheduled for deletion, so every request is refused until one of its users signs in to cancel that. `polling_timeout`: on a sync.api host, the files weren't ready in time. The record was created and is still being processed: its ID is in `submission_id`, `submission_batch_id`, `combined_pdf_id` or `template_id` (`support_help_id` for a question to the AI help that wasn't answered in time). Without one of these IDs, the request itself got no answer in time, and the record may or may not have been created. `idempotency_key_in_use` (409): the first request with the same Idempotency-Key is still being processed, and the response has a `Retry-After` header: send the request again then. Without the header, the first request was processed but its response is no longer kept, or it failed after creating or changing a record, and the message says which. When the first request created a record, or changed a template's fields or published a version of it, the message names it, and its ID is in `submission_id`, `submission_batch_id`, `combined_pdf_id`, `template_id`, `folder_id`, `custom_file_id`, `webhook_id`, `email_action_id` or `email_domain_id` (a signature request's events and tokens have no member). `idempotency_key_reused` (422): the Idempotency-Key was already used for a different request. `rate_limited` (429): too many API requests. Wait for the `Retry-After` header's seconds. `daily_email_limit_reached` (429): a submission that DocSpring would email would take your account over its daily email limit, so nothing was saved. Send it again after the `Retry-After` header's seconds (midnight UTC), or send the signing links yourself (`send_email: false`). `support_feedback_limit_reached` and `support_ticket_limit_reached` (429): the account has sent its 50 pieces of feedback or opened its 20 support tickets in 24 hours. Send it again after the `Retry-After` header's seconds. `support_help_limit_reached` (429): the caller has asked DocSpring's AI help its questions for 24 hours. The message says how to ask more.
20
20
  attr_accessor :code
21
21
 
22
22
  # A human-readable explanation, safe to show to developers.
@@ -37,6 +37,9 @@ module DocSpring
37
37
  # With `insufficient_credits`, the combined PDF that waits for credits. With `polling_timeout`, the combined PDF that's still being processed. With `idempotency_key_in_use`, the combined PDF the first request with the key created.
38
38
  attr_accessor :combined_pdf_id
39
39
 
40
+ # With `polling_timeout`, the help request that's still waiting for its answer.
41
+ attr_accessor :support_help_id
42
+
40
43
  # With `polling_timeout`, the template whose PDF is still being processed. With `idempotency_key_in_use`, the template the first request with the key created, or whose fields it changed or whose version it published.
41
44
  attr_accessor :template_id
42
45
 
@@ -87,6 +90,7 @@ module DocSpring
87
90
  :'submission_id' => :'submission_id',
88
91
  :'submission_batch_id' => :'submission_batch_id',
89
92
  :'combined_pdf_id' => :'combined_pdf_id',
93
+ :'support_help_id' => :'support_help_id',
90
94
  :'template_id' => :'template_id',
91
95
  :'folder_id' => :'folder_id',
92
96
  :'custom_file_id' => :'custom_file_id',
@@ -116,6 +120,7 @@ module DocSpring
116
120
  :'submission_id' => :'String',
117
121
  :'submission_batch_id' => :'String',
118
122
  :'combined_pdf_id' => :'String',
123
+ :'support_help_id' => :'String',
119
124
  :'template_id' => :'String',
120
125
  :'folder_id' => :'String',
121
126
  :'custom_file_id' => :'String',
@@ -196,6 +201,10 @@ module DocSpring
196
201
  self.combined_pdf_id = attributes[:'combined_pdf_id']
197
202
  end
198
203
 
204
+ if attributes.key?(:'support_help_id')
205
+ self.support_help_id = attributes[:'support_help_id']
206
+ end
207
+
199
208
  if attributes.key?(:'template_id')
200
209
  self.template_id = attributes[:'template_id']
201
210
  end
@@ -293,6 +302,7 @@ module DocSpring
293
302
  submission_id == o.submission_id &&
294
303
  submission_batch_id == o.submission_batch_id &&
295
304
  combined_pdf_id == o.combined_pdf_id &&
305
+ support_help_id == o.support_help_id &&
296
306
  template_id == o.template_id &&
297
307
  folder_id == o.folder_id &&
298
308
  custom_file_id == o.custom_file_id &&
@@ -310,7 +320,7 @@ module DocSpring
310
320
  # Calculates hash code according to all attributes.
311
321
  # @return [Integer] Hash code
312
322
  def hash
313
- [code, message, details, request_id, submission_id, submission_batch_id, combined_pdf_id, template_id, folder_id, custom_file_id, webhook_id, email_action_id, email_domain_id].hash
323
+ [code, message, details, request_id, submission_id, submission_batch_id, combined_pdf_id, support_help_id, template_id, folder_id, custom_file_id, webhook_id, email_action_id, email_domain_id].hash
314
324
  end
315
325
 
316
326
  # Builds the object from hash
@@ -0,0 +1,363 @@
1
+ =begin
2
+ #DocSpring API
3
+
4
+ #Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
5
+
6
+ The version of the OpenAPI document: v2
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.26.0-DOCSPRING
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DocSpring
17
+ # A problem that blocks the user, a wrong result or a question for the DocSpring team. Never include secrets, credentials or your users' data.
18
+ class OpenSupportTicketRequest < ApiModelBase
19
+ # One line, written like an issue title.
20
+ attr_accessor :title
21
+
22
+ # What kind of problem this is.
23
+ attr_accessor :kind
24
+
25
+ # The part of DocSpring this is about.
26
+ attr_accessor :category
27
+
28
+ # What was tried, what was expected and what happened.
29
+ attr_accessor :description
30
+
31
+ # `blocked`: the task could not be done. `worked_around`: it was done another way. `friction`: it was only slower.
32
+ attr_accessor :impact
33
+
34
+ # What the user asked for, in a short phrase.
35
+ attr_accessor :task
36
+
37
+ # The request IDs of the requests that went wrong: `error.request_id` in an error response, or any response's `X-Request-Id` header.
38
+ attr_accessor :request_ids
39
+
40
+ # The API operation, MCP tool or CLI command involved.
41
+ attr_accessor :tool
42
+
43
+ # The exact error text.
44
+ attr_accessor :error
45
+
46
+ # What would have helped.
47
+ attr_accessor :suggestion
48
+
49
+ # `user`: the user asked for this to be sent. `agent` (the default): an AI agent noticed the problem itself.
50
+ attr_accessor :source
51
+
52
+ # A label the sender chooses for its work, such as a session ID, a branch or a task name. When an account runs several agents at once, each can list only the tickets opened with its own label.
53
+ attr_accessor :session
54
+
55
+ # The AI agent sending this, as it describes itself. Stored as unverified.
56
+ attr_accessor :agent
57
+
58
+ class EnumAttributeValidator
59
+ attr_reader :datatype
60
+ attr_reader :allowable_values
61
+
62
+ def initialize(datatype, allowable_values)
63
+ @allowable_values = allowable_values.map do |value|
64
+ case datatype.to_s
65
+ when /Integer/i
66
+ value.to_i
67
+ when /Float/i
68
+ value.to_f
69
+ else
70
+ value
71
+ end
72
+ end
73
+ end
74
+
75
+ def valid?(value)
76
+ !value || allowable_values.include?(value)
77
+ end
78
+ end
79
+
80
+ # Attribute mapping from ruby-style variable name to JSON key.
81
+ def self.attribute_map
82
+ {
83
+ :'title' => :'title',
84
+ :'kind' => :'kind',
85
+ :'category' => :'category',
86
+ :'description' => :'description',
87
+ :'impact' => :'impact',
88
+ :'task' => :'task',
89
+ :'request_ids' => :'request_ids',
90
+ :'tool' => :'tool',
91
+ :'error' => :'error',
92
+ :'suggestion' => :'suggestion',
93
+ :'source' => :'source',
94
+ :'session' => :'session',
95
+ :'agent' => :'agent'
96
+ }
97
+ end
98
+
99
+ # Returns attribute mapping this model knows about
100
+ def self.acceptable_attribute_map
101
+ attribute_map
102
+ end
103
+
104
+ # Returns all the JSON keys this model knows about
105
+ def self.acceptable_attributes
106
+ acceptable_attribute_map.values
107
+ end
108
+
109
+ # Attribute type mapping.
110
+ def self.openapi_types
111
+ {
112
+ :'title' => :'String',
113
+ :'kind' => :'SupportReportKind',
114
+ :'category' => :'SupportReportCategory',
115
+ :'description' => :'String',
116
+ :'impact' => :'SupportReportImpact',
117
+ :'task' => :'String',
118
+ :'request_ids' => :'Array<String>',
119
+ :'tool' => :'String',
120
+ :'error' => :'String',
121
+ :'suggestion' => :'String',
122
+ :'source' => :'SupportReportSource',
123
+ :'session' => :'String',
124
+ :'agent' => :'SupportReportAgent'
125
+ }
126
+ end
127
+
128
+ # List of attributes with nullable: true
129
+ def self.openapi_nullable
130
+ Set.new([
131
+ ])
132
+ end
133
+
134
+ # Returns attribute type mapping
135
+ def self.acceptable_openapi_types
136
+ openapi_types
137
+ end
138
+
139
+ # Returns the nullable attributes
140
+ def self.acceptable_openapi_nullable
141
+ openapi_nullable
142
+ end
143
+
144
+ # Initializes the object
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ def initialize(attributes = {})
147
+ if (!attributes.is_a?(Hash))
148
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::OpenSupportTicketRequest` initialize method"
149
+ end
150
+
151
+ # check to see if the attribute exists and convert string to symbol for hash key
152
+ acceptable_attribute_map = self.class.acceptable_attribute_map
153
+ attributes = attributes.each_with_object({}) { |(k, v), h|
154
+ if (!acceptable_attribute_map.key?(k.to_sym))
155
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::OpenSupportTicketRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
156
+ end
157
+ h[k.to_sym] = v
158
+ }
159
+
160
+ if attributes.key?(:'title')
161
+ self.title = attributes[:'title']
162
+ else
163
+ self.title = nil
164
+ end
165
+
166
+ if attributes.key?(:'kind')
167
+ self.kind = attributes[:'kind']
168
+ else
169
+ self.kind = nil
170
+ end
171
+
172
+ if attributes.key?(:'category')
173
+ self.category = attributes[:'category']
174
+ end
175
+
176
+ if attributes.key?(:'description')
177
+ self.description = attributes[:'description']
178
+ else
179
+ self.description = nil
180
+ end
181
+
182
+ if attributes.key?(:'impact')
183
+ self.impact = attributes[:'impact']
184
+ end
185
+
186
+ if attributes.key?(:'task')
187
+ self.task = attributes[:'task']
188
+ end
189
+
190
+ if attributes.key?(:'request_ids')
191
+ if (value = attributes[:'request_ids']).is_a?(Array)
192
+ self.request_ids = value
193
+ end
194
+ end
195
+
196
+ if attributes.key?(:'tool')
197
+ self.tool = attributes[:'tool']
198
+ end
199
+
200
+ if attributes.key?(:'error')
201
+ self.error = attributes[:'error']
202
+ end
203
+
204
+ if attributes.key?(:'suggestion')
205
+ self.suggestion = attributes[:'suggestion']
206
+ end
207
+
208
+ if attributes.key?(:'source')
209
+ self.source = attributes[:'source']
210
+ end
211
+
212
+ if attributes.key?(:'session')
213
+ self.session = attributes[:'session']
214
+ end
215
+
216
+ if attributes.key?(:'agent')
217
+ self.agent = attributes[:'agent']
218
+ end
219
+ end
220
+
221
+ # Show invalid properties with the reasons. Usually used together with valid?
222
+ # @return Array for valid properties with the reasons
223
+ def list_invalid_properties
224
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
225
+ invalid_properties = Array.new
226
+ if @title.nil?
227
+ invalid_properties.push('invalid value for "title", title cannot be nil.')
228
+ end
229
+
230
+ if @kind.nil?
231
+ invalid_properties.push('invalid value for "kind", kind cannot be nil.')
232
+ end
233
+
234
+ if @description.nil?
235
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
236
+ end
237
+
238
+ invalid_properties
239
+ end
240
+
241
+ # Check to see if the all the properties in the model are valid
242
+ # @return true if the model is valid
243
+ def valid?
244
+ warn '[DEPRECATED] the `valid?` method is obsolete'
245
+ return false if @title.nil?
246
+ return false if @kind.nil?
247
+ return false if @description.nil?
248
+ true
249
+ end
250
+
251
+ # Custom attribute writer method with validation
252
+ # @param [Object] title Value to be assigned
253
+ def title=(title)
254
+ if title.nil?
255
+ fail ArgumentError, 'title cannot be nil'
256
+ end
257
+
258
+ @title = title
259
+ end
260
+
261
+ # Custom attribute writer method with validation
262
+ # @param [Object] kind Value to be assigned
263
+ def kind=(kind)
264
+ if kind.nil?
265
+ fail ArgumentError, 'kind cannot be nil'
266
+ end
267
+
268
+ @kind = kind
269
+ end
270
+
271
+ # Custom attribute writer method with validation
272
+ # @param [Object] description Value to be assigned
273
+ def description=(description)
274
+ if description.nil?
275
+ fail ArgumentError, 'description cannot be nil'
276
+ end
277
+
278
+ @description = description
279
+ end
280
+
281
+ # Checks equality by comparing each attribute.
282
+ # @param [Object] Object to be compared
283
+ def ==(o)
284
+ return true if self.equal?(o)
285
+ self.class == o.class &&
286
+ title == o.title &&
287
+ kind == o.kind &&
288
+ category == o.category &&
289
+ description == o.description &&
290
+ impact == o.impact &&
291
+ task == o.task &&
292
+ request_ids == o.request_ids &&
293
+ tool == o.tool &&
294
+ error == o.error &&
295
+ suggestion == o.suggestion &&
296
+ source == o.source &&
297
+ session == o.session &&
298
+ agent == o.agent
299
+ end
300
+
301
+ # @see the `==` method
302
+ # @param [Object] Object to be compared
303
+ def eql?(o)
304
+ self == o
305
+ end
306
+
307
+ # Calculates hash code according to all attributes.
308
+ # @return [Integer] Hash code
309
+ def hash
310
+ [title, kind, category, description, impact, task, request_ids, tool, error, suggestion, source, session, agent].hash
311
+ end
312
+
313
+ # Builds the object from hash
314
+ # @param [Hash] attributes Model attributes in the form of hash
315
+ # @return [Object] Returns the model itself
316
+ def self.build_from_hash(attributes)
317
+ return nil unless attributes.is_a?(Hash)
318
+ attributes = attributes.transform_keys(&:to_sym)
319
+ # include attributes inherited from allOf parents (the nearest declaration wins)
320
+ map = acceptable_attribute_map
321
+ transformed_hash = {}
322
+ acceptable_openapi_types.each_pair do |key, type|
323
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
324
+ transformed_hash["#{key}"] = nil
325
+ elsif type =~ /\AArray<(.*)>/i
326
+ # check to ensure the input is an array given that the attribute
327
+ # is documented as an array but the input is not
328
+ if attributes[map[key]].is_a?(Array)
329
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
330
+ end
331
+ elsif !attributes[map[key]].nil?
332
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
333
+ end
334
+ end
335
+ # Responses can include enum values added after this client was released, so the enum setters
336
+ # accept any value while the model is built from a response
337
+ allocate.tap do |model|
338
+ model.instance_variable_set(:@_skip_enum_validation, true)
339
+ model.send(:initialize, transformed_hash)
340
+ model.remove_instance_variable(:@_skip_enum_validation)
341
+ end
342
+ end
343
+
344
+ # Returns the object in the form of hash
345
+ # @return [Hash] Returns the object in the form of hash
346
+ def to_hash
347
+ hash = {}
348
+ # include attributes inherited from allOf parents (the nearest declaration wins)
349
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
350
+ value = self.send(attr)
351
+ if value.nil?
352
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
353
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
354
+ end
355
+
356
+ hash[param] = _to_hash(value)
357
+ end
358
+ hash
359
+ end
360
+
361
+ end
362
+
363
+ end