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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +8 -1
- data/lib/docspring/api/client.rb +494 -0
- data/lib/docspring/api_client.rb +1 -1
- data/lib/docspring/models/ask_support_help_request.rb +217 -0
- data/lib/docspring/models/error_code.rb +4 -1
- data/lib/docspring/models/error_info.rb +12 -2
- data/lib/docspring/models/open_support_ticket_request.rb +363 -0
- data/lib/docspring/models/reply_to_support_ticket_request.rb +217 -0
- data/lib/docspring/models/send_support_feedback_request.rb +363 -0
- data/lib/docspring/models/support_feedback.rb +239 -0
- data/lib/docspring/models/support_help.rb +316 -0
- data/lib/docspring/models/support_help_source.rb +212 -0
- data/lib/docspring/models/support_help_state.rb +42 -0
- data/lib/docspring/models/support_help_turn.rb +234 -0
- data/lib/docspring/models/support_help_turn_role.rb +41 -0
- data/lib/docspring/models/support_message.rb +301 -0
- data/lib/docspring/models/support_message_author.rb +42 -0
- data/lib/docspring/models/support_report_agent.rb +188 -0
- data/lib/docspring/models/support_report_category.rb +57 -0
- data/lib/docspring/models/support_report_impact.rb +42 -0
- data/lib/docspring/models/support_report_kind.rb +47 -0
- data/lib/docspring/models/support_report_source.rb +41 -0
- data/lib/docspring/models/support_ticket.rb +637 -0
- data/lib/docspring/models/support_ticket_list.rb +200 -0
- data/lib/docspring/models/support_ticket_list_status.rb +42 -0
- data/lib/docspring/models/support_ticket_notifications.rb +197 -0
- data/lib/docspring/models/support_ticket_reply.rb +210 -0
- data/lib/docspring/models/support_ticket_reply_outcome.rb +41 -0
- data/lib/docspring/models/support_ticket_resolution.rb +45 -0
- data/lib/docspring/models/support_ticket_status.rb +43 -0
- data/lib/docspring/models/support_ticket_watch.rb +239 -0
- data/lib/docspring/request_schemas.json +426 -0
- data/lib/docspring/version.rb +1 -1
- data/lib/docspring.rb +26 -0
- metadata +27 -1
|
@@ -0,0 +1,239 @@
|
|
|
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 piece of feedback that was sent to the DocSpring team. Feedback goes one way: nobody replies to it, and it can't be read back or checked later. Open a support ticket when you need an answer.
|
|
18
|
+
class SupportFeedback < ApiModelBase
|
|
19
|
+
# The feedback's ID.
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
# When DocSpring received it.
|
|
23
|
+
attr_accessor :received_at
|
|
24
|
+
|
|
25
|
+
# What happens next, in a sentence for an AI agent to act on. Nobody replies to feedback.
|
|
26
|
+
attr_accessor :follow_up
|
|
27
|
+
|
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
|
+
def self.attribute_map
|
|
30
|
+
{
|
|
31
|
+
:'id' => :'id',
|
|
32
|
+
:'received_at' => :'received_at',
|
|
33
|
+
:'follow_up' => :'follow_up'
|
|
34
|
+
}
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns attribute mapping this model knows about
|
|
38
|
+
def self.acceptable_attribute_map
|
|
39
|
+
attribute_map
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Returns all the JSON keys this model knows about
|
|
43
|
+
def self.acceptable_attributes
|
|
44
|
+
acceptable_attribute_map.values
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Attribute type mapping.
|
|
48
|
+
def self.openapi_types
|
|
49
|
+
{
|
|
50
|
+
:'id' => :'String',
|
|
51
|
+
:'received_at' => :'Time',
|
|
52
|
+
:'follow_up' => :'String'
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# List of attributes with nullable: true
|
|
57
|
+
def self.openapi_nullable
|
|
58
|
+
Set.new([
|
|
59
|
+
])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Returns attribute type mapping
|
|
63
|
+
def self.acceptable_openapi_types
|
|
64
|
+
openapi_types
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Returns the nullable attributes
|
|
68
|
+
def self.acceptable_openapi_nullable
|
|
69
|
+
openapi_nullable
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Initializes the object
|
|
73
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
74
|
+
def initialize(attributes = {})
|
|
75
|
+
if (!attributes.is_a?(Hash))
|
|
76
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::SupportFeedback` initialize method"
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
80
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
81
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
82
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
83
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::SupportFeedback`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
84
|
+
end
|
|
85
|
+
h[k.to_sym] = v
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'id')
|
|
89
|
+
self.id = attributes[:'id']
|
|
90
|
+
else
|
|
91
|
+
self.id = nil
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if attributes.key?(:'received_at')
|
|
95
|
+
self.received_at = attributes[:'received_at']
|
|
96
|
+
else
|
|
97
|
+
self.received_at = nil
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'follow_up')
|
|
101
|
+
self.follow_up = attributes[:'follow_up']
|
|
102
|
+
else
|
|
103
|
+
self.follow_up = nil
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
108
|
+
# @return Array for valid properties with the reasons
|
|
109
|
+
def list_invalid_properties
|
|
110
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
111
|
+
invalid_properties = Array.new
|
|
112
|
+
if @id.nil?
|
|
113
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if @received_at.nil?
|
|
117
|
+
invalid_properties.push('invalid value for "received_at", received_at cannot be nil.')
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if @follow_up.nil?
|
|
121
|
+
invalid_properties.push('invalid value for "follow_up", follow_up cannot be nil.')
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
invalid_properties
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Check to see if the all the properties in the model are valid
|
|
128
|
+
# @return true if the model is valid
|
|
129
|
+
def valid?
|
|
130
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
131
|
+
return false if @id.nil?
|
|
132
|
+
return false if @received_at.nil?
|
|
133
|
+
return false if @follow_up.nil?
|
|
134
|
+
true
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Custom attribute writer method with validation
|
|
138
|
+
# @param [Object] id Value to be assigned
|
|
139
|
+
def id=(id)
|
|
140
|
+
if id.nil?
|
|
141
|
+
fail ArgumentError, 'id cannot be nil'
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
@id = id
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Custom attribute writer method with validation
|
|
148
|
+
# @param [Object] received_at Value to be assigned
|
|
149
|
+
def received_at=(received_at)
|
|
150
|
+
if received_at.nil?
|
|
151
|
+
fail ArgumentError, 'received_at cannot be nil'
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
@received_at = received_at
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Custom attribute writer method with validation
|
|
158
|
+
# @param [Object] follow_up Value to be assigned
|
|
159
|
+
def follow_up=(follow_up)
|
|
160
|
+
if follow_up.nil?
|
|
161
|
+
fail ArgumentError, 'follow_up cannot be nil'
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
@follow_up = follow_up
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Checks equality by comparing each attribute.
|
|
168
|
+
# @param [Object] Object to be compared
|
|
169
|
+
def ==(o)
|
|
170
|
+
return true if self.equal?(o)
|
|
171
|
+
self.class == o.class &&
|
|
172
|
+
id == o.id &&
|
|
173
|
+
received_at == o.received_at &&
|
|
174
|
+
follow_up == o.follow_up
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# @see the `==` method
|
|
178
|
+
# @param [Object] Object to be compared
|
|
179
|
+
def eql?(o)
|
|
180
|
+
self == o
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Calculates hash code according to all attributes.
|
|
184
|
+
# @return [Integer] Hash code
|
|
185
|
+
def hash
|
|
186
|
+
[id, received_at, follow_up].hash
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Builds the object from hash
|
|
190
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
191
|
+
# @return [Object] Returns the model itself
|
|
192
|
+
def self.build_from_hash(attributes)
|
|
193
|
+
return nil unless attributes.is_a?(Hash)
|
|
194
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
195
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
196
|
+
map = acceptable_attribute_map
|
|
197
|
+
transformed_hash = {}
|
|
198
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
199
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
200
|
+
transformed_hash["#{key}"] = nil
|
|
201
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
202
|
+
# check to ensure the input is an array given that the attribute
|
|
203
|
+
# is documented as an array but the input is not
|
|
204
|
+
if attributes[map[key]].is_a?(Array)
|
|
205
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
206
|
+
end
|
|
207
|
+
elsif !attributes[map[key]].nil?
|
|
208
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
# Responses can include enum values added after this client was released, so the enum setters
|
|
212
|
+
# accept any value while the model is built from a response
|
|
213
|
+
allocate.tap do |model|
|
|
214
|
+
model.instance_variable_set(:@_skip_enum_validation, true)
|
|
215
|
+
model.send(:initialize, transformed_hash)
|
|
216
|
+
model.remove_instance_variable(:@_skip_enum_validation)
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Returns the object in the form of hash
|
|
221
|
+
# @return [Hash] Returns the object in the form of hash
|
|
222
|
+
def to_hash
|
|
223
|
+
hash = {}
|
|
224
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
225
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
226
|
+
value = self.send(attr)
|
|
227
|
+
if value.nil?
|
|
228
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
229
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
hash[param] = _to_hash(value)
|
|
233
|
+
end
|
|
234
|
+
hash
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
end
|
|
@@ -0,0 +1,316 @@
|
|
|
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 put to DocSpring's AI help, and its answer from DocSpring's documentation. It opens no ticket and reaches no person.
|
|
18
|
+
class SupportHelp < ApiModelBase
|
|
19
|
+
# The help request's ID.
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
# `pending` until there's an answer, then `completed`. `failed`: the question couldn't be answered just now.
|
|
23
|
+
attr_accessor :state
|
|
24
|
+
|
|
25
|
+
# Whether the documentation had an answer. Null while `state` is `pending`.
|
|
26
|
+
attr_accessor :answered
|
|
27
|
+
|
|
28
|
+
# The answer, as plain text. When `answered` is false, what the documentation doesn't cover. Null while `state` is `pending`.
|
|
29
|
+
attr_accessor :answer
|
|
30
|
+
|
|
31
|
+
# The documentation pages the answer came from.
|
|
32
|
+
attr_accessor :sources
|
|
33
|
+
|
|
34
|
+
# What to do when the answer doesn't solve the problem, in a sentence for an AI agent to act on.
|
|
35
|
+
attr_accessor :_next
|
|
36
|
+
|
|
37
|
+
class EnumAttributeValidator
|
|
38
|
+
attr_reader :datatype
|
|
39
|
+
attr_reader :allowable_values
|
|
40
|
+
|
|
41
|
+
def initialize(datatype, allowable_values)
|
|
42
|
+
@allowable_values = allowable_values.map do |value|
|
|
43
|
+
case datatype.to_s
|
|
44
|
+
when /Integer/i
|
|
45
|
+
value.to_i
|
|
46
|
+
when /Float/i
|
|
47
|
+
value.to_f
|
|
48
|
+
else
|
|
49
|
+
value
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def valid?(value)
|
|
55
|
+
!value || allowable_values.include?(value)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
60
|
+
def self.attribute_map
|
|
61
|
+
{
|
|
62
|
+
:'id' => :'id',
|
|
63
|
+
:'state' => :'state',
|
|
64
|
+
:'answered' => :'answered',
|
|
65
|
+
:'answer' => :'answer',
|
|
66
|
+
:'sources' => :'sources',
|
|
67
|
+
:'_next' => :'next'
|
|
68
|
+
}
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Returns attribute mapping this model knows about
|
|
72
|
+
def self.acceptable_attribute_map
|
|
73
|
+
attribute_map
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Returns all the JSON keys this model knows about
|
|
77
|
+
def self.acceptable_attributes
|
|
78
|
+
acceptable_attribute_map.values
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Attribute type mapping.
|
|
82
|
+
def self.openapi_types
|
|
83
|
+
{
|
|
84
|
+
:'id' => :'String',
|
|
85
|
+
:'state' => :'SupportHelpState',
|
|
86
|
+
:'answered' => :'Boolean',
|
|
87
|
+
:'answer' => :'String',
|
|
88
|
+
:'sources' => :'Array<SupportHelpSource>',
|
|
89
|
+
:'_next' => :'String'
|
|
90
|
+
}
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# List of attributes with nullable: true
|
|
94
|
+
def self.openapi_nullable
|
|
95
|
+
Set.new([
|
|
96
|
+
:'answered',
|
|
97
|
+
:'answer',
|
|
98
|
+
])
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Returns attribute type mapping
|
|
102
|
+
def self.acceptable_openapi_types
|
|
103
|
+
openapi_types
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Returns the nullable attributes
|
|
107
|
+
def self.acceptable_openapi_nullable
|
|
108
|
+
openapi_nullable
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Initializes the object
|
|
112
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
113
|
+
def initialize(attributes = {})
|
|
114
|
+
if (!attributes.is_a?(Hash))
|
|
115
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::SupportHelp` initialize method"
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
119
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
120
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
121
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
122
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::SupportHelp`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
123
|
+
end
|
|
124
|
+
h[k.to_sym] = v
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if attributes.key?(:'id')
|
|
128
|
+
self.id = attributes[:'id']
|
|
129
|
+
else
|
|
130
|
+
self.id = nil
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if attributes.key?(:'state')
|
|
134
|
+
self.state = attributes[:'state']
|
|
135
|
+
else
|
|
136
|
+
self.state = nil
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
if attributes.key?(:'answered')
|
|
140
|
+
self.answered = attributes[:'answered']
|
|
141
|
+
else
|
|
142
|
+
self.answered = nil
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
if attributes.key?(:'answer')
|
|
146
|
+
self.answer = attributes[:'answer']
|
|
147
|
+
else
|
|
148
|
+
self.answer = nil
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if attributes.key?(:'sources')
|
|
152
|
+
if (value = attributes[:'sources']).is_a?(Array)
|
|
153
|
+
self.sources = value
|
|
154
|
+
end
|
|
155
|
+
else
|
|
156
|
+
self.sources = nil
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
if attributes.key?(:'_next')
|
|
160
|
+
self._next = attributes[:'_next']
|
|
161
|
+
else
|
|
162
|
+
self._next = nil
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
167
|
+
# @return Array for valid properties with the reasons
|
|
168
|
+
def list_invalid_properties
|
|
169
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
170
|
+
invalid_properties = Array.new
|
|
171
|
+
if @id.nil?
|
|
172
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
if @state.nil?
|
|
176
|
+
invalid_properties.push('invalid value for "state", state cannot be nil.')
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
if @sources.nil?
|
|
180
|
+
invalid_properties.push('invalid value for "sources", sources cannot be nil.')
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
if @_next.nil?
|
|
184
|
+
invalid_properties.push('invalid value for "_next", _next cannot be nil.')
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
invalid_properties
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Check to see if the all the properties in the model are valid
|
|
191
|
+
# @return true if the model is valid
|
|
192
|
+
def valid?
|
|
193
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
194
|
+
return false if @id.nil?
|
|
195
|
+
return false if @state.nil?
|
|
196
|
+
return false if @sources.nil?
|
|
197
|
+
return false if @_next.nil?
|
|
198
|
+
true
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Custom attribute writer method with validation
|
|
202
|
+
# @param [Object] id Value to be assigned
|
|
203
|
+
def id=(id)
|
|
204
|
+
if id.nil?
|
|
205
|
+
fail ArgumentError, 'id cannot be nil'
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
@id = id
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Custom attribute writer method with validation
|
|
212
|
+
# @param [Object] state Value to be assigned
|
|
213
|
+
def state=(state)
|
|
214
|
+
if state.nil?
|
|
215
|
+
fail ArgumentError, 'state cannot be nil'
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
@state = state
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Custom attribute writer method with validation
|
|
222
|
+
# @param [Object] sources Value to be assigned
|
|
223
|
+
def sources=(sources)
|
|
224
|
+
if sources.nil?
|
|
225
|
+
fail ArgumentError, 'sources cannot be nil'
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
@sources = sources
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Custom attribute writer method with validation
|
|
232
|
+
# @param [Object] _next Value to be assigned
|
|
233
|
+
def _next=(_next)
|
|
234
|
+
if _next.nil?
|
|
235
|
+
fail ArgumentError, '_next cannot be nil'
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
@_next = _next
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# Checks equality by comparing each attribute.
|
|
242
|
+
# @param [Object] Object to be compared
|
|
243
|
+
def ==(o)
|
|
244
|
+
return true if self.equal?(o)
|
|
245
|
+
self.class == o.class &&
|
|
246
|
+
id == o.id &&
|
|
247
|
+
state == o.state &&
|
|
248
|
+
answered == o.answered &&
|
|
249
|
+
answer == o.answer &&
|
|
250
|
+
sources == o.sources &&
|
|
251
|
+
_next == o._next
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# @see the `==` method
|
|
255
|
+
# @param [Object] Object to be compared
|
|
256
|
+
def eql?(o)
|
|
257
|
+
self == o
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
# Calculates hash code according to all attributes.
|
|
261
|
+
# @return [Integer] Hash code
|
|
262
|
+
def hash
|
|
263
|
+
[id, state, answered, answer, sources, _next].hash
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
# Builds the object from hash
|
|
267
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
268
|
+
# @return [Object] Returns the model itself
|
|
269
|
+
def self.build_from_hash(attributes)
|
|
270
|
+
return nil unless attributes.is_a?(Hash)
|
|
271
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
272
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
273
|
+
map = acceptable_attribute_map
|
|
274
|
+
transformed_hash = {}
|
|
275
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
276
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
277
|
+
transformed_hash["#{key}"] = nil
|
|
278
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
279
|
+
# check to ensure the input is an array given that the attribute
|
|
280
|
+
# is documented as an array but the input is not
|
|
281
|
+
if attributes[map[key]].is_a?(Array)
|
|
282
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
283
|
+
end
|
|
284
|
+
elsif !attributes[map[key]].nil?
|
|
285
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
286
|
+
end
|
|
287
|
+
end
|
|
288
|
+
# Responses can include enum values added after this client was released, so the enum setters
|
|
289
|
+
# accept any value while the model is built from a response
|
|
290
|
+
allocate.tap do |model|
|
|
291
|
+
model.instance_variable_set(:@_skip_enum_validation, true)
|
|
292
|
+
model.send(:initialize, transformed_hash)
|
|
293
|
+
model.remove_instance_variable(:@_skip_enum_validation)
|
|
294
|
+
end
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
# Returns the object in the form of hash
|
|
298
|
+
# @return [Hash] Returns the object in the form of hash
|
|
299
|
+
def to_hash
|
|
300
|
+
hash = {}
|
|
301
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
302
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
303
|
+
value = self.send(attr)
|
|
304
|
+
if value.nil?
|
|
305
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
306
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
hash[param] = _to_hash(value)
|
|
310
|
+
end
|
|
311
|
+
hash
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
end
|