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 message to add to the ticket. Never include secrets, credentials or your users' data.
18
+ class ReplyToSupportTicketRequest < ApiModelBase
19
+ # The message: an answer to the team's question, more detail, or whether their fix worked. Plain text.
20
+ attr_accessor :body
21
+
22
+ # `resolved`: the problem is fixed, so close the ticket. `still_broken`: it isn't, so reopen the ticket. Without it, the reply answers a ticket that was waiting for one and otherwise leaves the status as it is.
23
+ attr_accessor :outcome
24
+
25
+ class EnumAttributeValidator
26
+ attr_reader :datatype
27
+ attr_reader :allowable_values
28
+
29
+ def initialize(datatype, allowable_values)
30
+ @allowable_values = allowable_values.map do |value|
31
+ case datatype.to_s
32
+ when /Integer/i
33
+ value.to_i
34
+ when /Float/i
35
+ value.to_f
36
+ else
37
+ value
38
+ end
39
+ end
40
+ end
41
+
42
+ def valid?(value)
43
+ !value || allowable_values.include?(value)
44
+ end
45
+ end
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'body' => :'body',
51
+ :'outcome' => :'outcome'
52
+ }
53
+ end
54
+
55
+ # Returns attribute mapping this model knows about
56
+ def self.acceptable_attribute_map
57
+ attribute_map
58
+ end
59
+
60
+ # Returns all the JSON keys this model knows about
61
+ def self.acceptable_attributes
62
+ acceptable_attribute_map.values
63
+ end
64
+
65
+ # Attribute type mapping.
66
+ def self.openapi_types
67
+ {
68
+ :'body' => :'String',
69
+ :'outcome' => :'SupportTicketReplyOutcome'
70
+ }
71
+ end
72
+
73
+ # List of attributes with nullable: true
74
+ def self.openapi_nullable
75
+ Set.new([
76
+ ])
77
+ end
78
+
79
+ # Returns attribute type mapping
80
+ def self.acceptable_openapi_types
81
+ openapi_types
82
+ end
83
+
84
+ # Returns the nullable attributes
85
+ def self.acceptable_openapi_nullable
86
+ openapi_nullable
87
+ end
88
+
89
+ # Initializes the object
90
+ # @param [Hash] attributes Model attributes in the form of hash
91
+ def initialize(attributes = {})
92
+ if (!attributes.is_a?(Hash))
93
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::ReplyToSupportTicketRequest` initialize method"
94
+ end
95
+
96
+ # check to see if the attribute exists and convert string to symbol for hash key
97
+ acceptable_attribute_map = self.class.acceptable_attribute_map
98
+ attributes = attributes.each_with_object({}) { |(k, v), h|
99
+ if (!acceptable_attribute_map.key?(k.to_sym))
100
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::ReplyToSupportTicketRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
101
+ end
102
+ h[k.to_sym] = v
103
+ }
104
+
105
+ if attributes.key?(:'body')
106
+ self.body = attributes[:'body']
107
+ else
108
+ self.body = nil
109
+ end
110
+
111
+ if attributes.key?(:'outcome')
112
+ self.outcome = attributes[:'outcome']
113
+ end
114
+ end
115
+
116
+ # Show invalid properties with the reasons. Usually used together with valid?
117
+ # @return Array for valid properties with the reasons
118
+ def list_invalid_properties
119
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
120
+ invalid_properties = Array.new
121
+ if @body.nil?
122
+ invalid_properties.push('invalid value for "body", body cannot be nil.')
123
+ end
124
+
125
+ invalid_properties
126
+ end
127
+
128
+ # Check to see if the all the properties in the model are valid
129
+ # @return true if the model is valid
130
+ def valid?
131
+ warn '[DEPRECATED] the `valid?` method is obsolete'
132
+ return false if @body.nil?
133
+ true
134
+ end
135
+
136
+ # Custom attribute writer method with validation
137
+ # @param [Object] body Value to be assigned
138
+ def body=(body)
139
+ if body.nil?
140
+ fail ArgumentError, 'body cannot be nil'
141
+ end
142
+
143
+ @body = body
144
+ end
145
+
146
+ # Checks equality by comparing each attribute.
147
+ # @param [Object] Object to be compared
148
+ def ==(o)
149
+ return true if self.equal?(o)
150
+ self.class == o.class &&
151
+ body == o.body &&
152
+ outcome == o.outcome
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
+ [body, outcome].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
@@ -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
+ # Something about DocSpring that got in the way while the work still got done. Never include secrets, credentials or your users' data.
18
+ class SendSupportFeedbackRequest < 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::SendSupportFeedbackRequest` 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::SendSupportFeedbackRequest`. 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