docusign_esign 3.27.0.rc1 → 4.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/lib/docusign_esign/api/envelopes_api.rb +29 -21
  4. data/lib/docusign_esign/api/templates_api.rb +6 -6
  5. data/lib/docusign_esign/client/api_client.rb +1 -1
  6. data/lib/docusign_esign/models/account_settings_information.rb +191 -61
  7. data/lib/docusign_esign/models/account_ui_settings.rb +21 -1
  8. data/lib/docusign_esign/models/envelope.rb +11 -1
  9. data/lib/docusign_esign/models/envelope_definition.rb +11 -1
  10. data/lib/docusign_esign/models/envelope_template.rb +11 -1
  11. data/lib/docusign_esign/models/envelope_view_document_settings.rb +214 -0
  12. data/lib/docusign_esign/models/envelope_view_envelope_custom_field_settings.rb +184 -0
  13. data/lib/docusign_esign/models/envelope_view_recipient_settings.rb +214 -0
  14. data/lib/docusign_esign/models/envelope_view_request.rb +204 -0
  15. data/lib/docusign_esign/models/envelope_view_settings.rb +304 -0
  16. data/lib/docusign_esign/models/envelope_view_tagger_settings.rb +204 -0
  17. data/lib/docusign_esign/models/envelope_view_template_settings.rb +184 -0
  18. data/lib/docusign_esign/models/group.rb +11 -1
  19. data/lib/docusign_esign/models/palette_item_settings.rb +184 -0
  20. data/lib/docusign_esign/models/palette_settings.rb +244 -0
  21. data/lib/docusign_esign/models/recipient_view_request.rb +11 -1
  22. data/lib/docusign_esign/models/template_view_request.rb +194 -0
  23. data/lib/docusign_esign/models/user_settings_information.rb +61 -1
  24. data/lib/docusign_esign/version.rb +1 -1
  25. data/lib/docusign_esign.rb +10 -1
  26. metadata +12 -2
@@ -0,0 +1,304 @@
1
+ =begin
2
+ #DocuSign REST API
3
+
4
+ #The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
5
+
6
+ OpenAPI spec version: v2.1
7
+ Contact: devcenter@docusign.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module DocuSign_eSign
15
+ class EnvelopeViewSettings
16
+ #
17
+ attr_accessor :back_button_action
18
+
19
+ #
20
+ attr_accessor :document_settings
21
+
22
+ #
23
+ attr_accessor :envelope_custom_field_settings
24
+
25
+ #
26
+ attr_accessor :lock_token
27
+
28
+ #
29
+ attr_accessor :recipient_settings
30
+
31
+ #
32
+ attr_accessor :send_button_action
33
+
34
+ #
35
+ attr_accessor :show_advanced_options
36
+
37
+ #
38
+ attr_accessor :show_back_button
39
+
40
+ #
41
+ attr_accessor :show_discard_action
42
+
43
+ #
44
+ attr_accessor :show_header_actions
45
+
46
+ #
47
+ attr_accessor :starting_screen
48
+
49
+ #
50
+ attr_accessor :tagger_settings
51
+
52
+ #
53
+ attr_accessor :template_settings
54
+
55
+ # Attribute mapping from ruby-style variable name to JSON key.
56
+ def self.attribute_map
57
+ {
58
+ :'back_button_action' => :'backButtonAction',
59
+ :'document_settings' => :'documentSettings',
60
+ :'envelope_custom_field_settings' => :'envelopeCustomFieldSettings',
61
+ :'lock_token' => :'lockToken',
62
+ :'recipient_settings' => :'recipientSettings',
63
+ :'send_button_action' => :'sendButtonAction',
64
+ :'show_advanced_options' => :'showAdvancedOptions',
65
+ :'show_back_button' => :'showBackButton',
66
+ :'show_discard_action' => :'showDiscardAction',
67
+ :'show_header_actions' => :'showHeaderActions',
68
+ :'starting_screen' => :'startingScreen',
69
+ :'tagger_settings' => :'taggerSettings',
70
+ :'template_settings' => :'templateSettings'
71
+ }
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.swagger_types
76
+ {
77
+ :'back_button_action' => :'String',
78
+ :'document_settings' => :'EnvelopeViewDocumentSettings',
79
+ :'envelope_custom_field_settings' => :'EnvelopeViewEnvelopeCustomFieldSettings',
80
+ :'lock_token' => :'String',
81
+ :'recipient_settings' => :'EnvelopeViewRecipientSettings',
82
+ :'send_button_action' => :'String',
83
+ :'show_advanced_options' => :'String',
84
+ :'show_back_button' => :'String',
85
+ :'show_discard_action' => :'String',
86
+ :'show_header_actions' => :'String',
87
+ :'starting_screen' => :'String',
88
+ :'tagger_settings' => :'EnvelopeViewTaggerSettings',
89
+ :'template_settings' => :'EnvelopeViewTemplateSettings'
90
+ }
91
+ end
92
+
93
+ # Initializes the object
94
+ # @param [Hash] attributes Model attributes in the form of hash
95
+ def initialize(attributes = {})
96
+ return unless attributes.is_a?(Hash)
97
+
98
+ # convert string to symbol for hash key
99
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
100
+
101
+ if attributes.has_key?(:'backButtonAction')
102
+ self.back_button_action = attributes[:'backButtonAction']
103
+ end
104
+
105
+ if attributes.has_key?(:'documentSettings')
106
+ self.document_settings = attributes[:'documentSettings']
107
+ end
108
+
109
+ if attributes.has_key?(:'envelopeCustomFieldSettings')
110
+ self.envelope_custom_field_settings = attributes[:'envelopeCustomFieldSettings']
111
+ end
112
+
113
+ if attributes.has_key?(:'lockToken')
114
+ self.lock_token = attributes[:'lockToken']
115
+ end
116
+
117
+ if attributes.has_key?(:'recipientSettings')
118
+ self.recipient_settings = attributes[:'recipientSettings']
119
+ end
120
+
121
+ if attributes.has_key?(:'sendButtonAction')
122
+ self.send_button_action = attributes[:'sendButtonAction']
123
+ end
124
+
125
+ if attributes.has_key?(:'showAdvancedOptions')
126
+ self.show_advanced_options = attributes[:'showAdvancedOptions']
127
+ end
128
+
129
+ if attributes.has_key?(:'showBackButton')
130
+ self.show_back_button = attributes[:'showBackButton']
131
+ end
132
+
133
+ if attributes.has_key?(:'showDiscardAction')
134
+ self.show_discard_action = attributes[:'showDiscardAction']
135
+ end
136
+
137
+ if attributes.has_key?(:'showHeaderActions')
138
+ self.show_header_actions = attributes[:'showHeaderActions']
139
+ end
140
+
141
+ if attributes.has_key?(:'startingScreen')
142
+ self.starting_screen = attributes[:'startingScreen']
143
+ end
144
+
145
+ if attributes.has_key?(:'taggerSettings')
146
+ self.tagger_settings = attributes[:'taggerSettings']
147
+ end
148
+
149
+ if attributes.has_key?(:'templateSettings')
150
+ self.template_settings = attributes[:'templateSettings']
151
+ end
152
+ end
153
+
154
+ # Show invalid properties with the reasons. Usually used together with valid?
155
+ # @return Array for valid properties with the reasons
156
+ def list_invalid_properties
157
+ invalid_properties = Array.new
158
+ invalid_properties
159
+ end
160
+
161
+ # Check to see if the all the properties in the model are valid
162
+ # @return true if the model is valid
163
+ def valid?
164
+ true
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
+ back_button_action == o.back_button_action &&
173
+ document_settings == o.document_settings &&
174
+ envelope_custom_field_settings == o.envelope_custom_field_settings &&
175
+ lock_token == o.lock_token &&
176
+ recipient_settings == o.recipient_settings &&
177
+ send_button_action == o.send_button_action &&
178
+ show_advanced_options == o.show_advanced_options &&
179
+ show_back_button == o.show_back_button &&
180
+ show_discard_action == o.show_discard_action &&
181
+ show_header_actions == o.show_header_actions &&
182
+ starting_screen == o.starting_screen &&
183
+ tagger_settings == o.tagger_settings &&
184
+ template_settings == o.template_settings
185
+ end
186
+
187
+ # @see the `==` method
188
+ # @param [Object] Object to be compared
189
+ def eql?(o)
190
+ self == o
191
+ end
192
+
193
+ # Calculates hash code according to all attributes.
194
+ # @return [Fixnum] Hash code
195
+ def hash
196
+ [back_button_action, document_settings, envelope_custom_field_settings, lock_token, recipient_settings, send_button_action, show_advanced_options, show_back_button, show_discard_action, show_header_actions, starting_screen, tagger_settings, template_settings].hash
197
+ end
198
+
199
+ # Builds the object from hash
200
+ # @param [Hash] attributes Model attributes in the form of hash
201
+ # @return [Object] Returns the model itself
202
+ def build_from_hash(attributes)
203
+ return nil unless attributes.is_a?(Hash)
204
+ self.class.swagger_types.each_pair do |key, type|
205
+ if type =~ /\AArray<(.*)>/i
206
+ # check to ensure the input is an array given that the attribute
207
+ # is documented as an array but the input is not
208
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
209
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
210
+ end
211
+ elsif !attributes[self.class.attribute_map[key]].nil?
212
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
213
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
214
+ end
215
+
216
+ self
217
+ end
218
+
219
+ # Deserializes the data based on type
220
+ # @param string type Data type
221
+ # @param string value Value to be deserialized
222
+ # @return [Object] Deserialized data
223
+ def _deserialize(type, value)
224
+ case type.to_sym
225
+ when :DateTime
226
+ DateTime.parse(value)
227
+ when :Date
228
+ Date.parse(value)
229
+ when :String
230
+ value.to_s
231
+ when :Integer
232
+ value.to_i
233
+ when :Float
234
+ value.to_f
235
+ when :BOOLEAN
236
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
237
+ true
238
+ else
239
+ false
240
+ end
241
+ when :Object
242
+ # generic object (usually a Hash), return directly
243
+ value
244
+ when /\AArray<(?<inner_type>.+)>\z/
245
+ inner_type = Regexp.last_match[:inner_type]
246
+ value.map { |v| _deserialize(inner_type, v) }
247
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
248
+ k_type = Regexp.last_match[:k_type]
249
+ v_type = Regexp.last_match[:v_type]
250
+ {}.tap do |hash|
251
+ value.each do |k, v|
252
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
253
+ end
254
+ end
255
+ else # model
256
+ temp_model = DocuSign_eSign.const_get(type).new
257
+ temp_model.build_from_hash(value)
258
+ end
259
+ end
260
+
261
+ # Returns the string representation of the object
262
+ # @return [String] String presentation of the object
263
+ def to_s
264
+ to_hash.to_s
265
+ end
266
+
267
+ # to_body is an alias to to_hash (backward compatibility)
268
+ # @return [Hash] Returns the object in the form of hash
269
+ def to_body
270
+ to_hash
271
+ end
272
+
273
+ # Returns the object in the form of hash
274
+ # @return [Hash] Returns the object in the form of hash
275
+ def to_hash
276
+ hash = {}
277
+ self.class.attribute_map.each_pair do |attr, param|
278
+ value = self.send(attr)
279
+ next if value.nil?
280
+ hash[param] = _to_hash(value)
281
+ end
282
+ hash
283
+ end
284
+
285
+ # Outputs non-array value in the form of hash
286
+ # For object, use to_hash. Otherwise, just return the value
287
+ # @param [Object] value Any valid value
288
+ # @return [Hash] Returns the value in the form of hash
289
+ def _to_hash(value)
290
+ if value.is_a?(Array)
291
+ value.compact.map { |v| _to_hash(v) }
292
+ elsif value.is_a?(Hash)
293
+ {}.tap do |hash|
294
+ value.each { |k, v| hash[k] = _to_hash(v) }
295
+ end
296
+ elsif value.respond_to? :to_hash
297
+ value.to_hash
298
+ else
299
+ value
300
+ end
301
+ end
302
+
303
+ end
304
+ end
@@ -0,0 +1,204 @@
1
+ =begin
2
+ #DocuSign REST API
3
+
4
+ #The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
5
+
6
+ OpenAPI spec version: v2.1
7
+ Contact: devcenter@docusign.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module DocuSign_eSign
15
+ class EnvelopeViewTaggerSettings
16
+ #
17
+ attr_accessor :palette_default
18
+
19
+ #
20
+ attr_accessor :palette_sections
21
+
22
+ #
23
+ attr_accessor :palette_settings
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'palette_default' => :'paletteDefault',
29
+ :'palette_sections' => :'paletteSections',
30
+ :'palette_settings' => :'paletteSettings'
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.swagger_types
36
+ {
37
+ :'palette_default' => :'String',
38
+ :'palette_sections' => :'String',
39
+ :'palette_settings' => :'PaletteSettings'
40
+ }
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ return unless attributes.is_a?(Hash)
47
+
48
+ # convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
50
+
51
+ if attributes.has_key?(:'paletteDefault')
52
+ self.palette_default = attributes[:'paletteDefault']
53
+ end
54
+
55
+ if attributes.has_key?(:'paletteSections')
56
+ self.palette_sections = attributes[:'paletteSections']
57
+ end
58
+
59
+ if attributes.has_key?(:'paletteSettings')
60
+ self.palette_settings = attributes[:'paletteSettings']
61
+ end
62
+ end
63
+
64
+ # Show invalid properties with the reasons. Usually used together with valid?
65
+ # @return Array for valid properties with the reasons
66
+ def list_invalid_properties
67
+ invalid_properties = Array.new
68
+ invalid_properties
69
+ end
70
+
71
+ # Check to see if the all the properties in the model are valid
72
+ # @return true if the model is valid
73
+ def valid?
74
+ true
75
+ end
76
+
77
+ # Checks equality by comparing each attribute.
78
+ # @param [Object] Object to be compared
79
+ def ==(o)
80
+ return true if self.equal?(o)
81
+ self.class == o.class &&
82
+ palette_default == o.palette_default &&
83
+ palette_sections == o.palette_sections &&
84
+ palette_settings == o.palette_settings
85
+ end
86
+
87
+ # @see the `==` method
88
+ # @param [Object] Object to be compared
89
+ def eql?(o)
90
+ self == o
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Fixnum] Hash code
95
+ def hash
96
+ [palette_default, palette_sections, palette_settings].hash
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def build_from_hash(attributes)
103
+ return nil unless attributes.is_a?(Hash)
104
+ self.class.swagger_types.each_pair do |key, type|
105
+ if type =~ /\AArray<(.*)>/i
106
+ # check to ensure the input is an array given that the attribute
107
+ # is documented as an array but the input is not
108
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
109
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
110
+ end
111
+ elsif !attributes[self.class.attribute_map[key]].nil?
112
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
113
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
114
+ end
115
+
116
+ self
117
+ end
118
+
119
+ # Deserializes the data based on type
120
+ # @param string type Data type
121
+ # @param string value Value to be deserialized
122
+ # @return [Object] Deserialized data
123
+ def _deserialize(type, value)
124
+ case type.to_sym
125
+ when :DateTime
126
+ DateTime.parse(value)
127
+ when :Date
128
+ Date.parse(value)
129
+ when :String
130
+ value.to_s
131
+ when :Integer
132
+ value.to_i
133
+ when :Float
134
+ value.to_f
135
+ when :BOOLEAN
136
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
137
+ true
138
+ else
139
+ false
140
+ end
141
+ when :Object
142
+ # generic object (usually a Hash), return directly
143
+ value
144
+ when /\AArray<(?<inner_type>.+)>\z/
145
+ inner_type = Regexp.last_match[:inner_type]
146
+ value.map { |v| _deserialize(inner_type, v) }
147
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
148
+ k_type = Regexp.last_match[:k_type]
149
+ v_type = Regexp.last_match[:v_type]
150
+ {}.tap do |hash|
151
+ value.each do |k, v|
152
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
153
+ end
154
+ end
155
+ else # model
156
+ temp_model = DocuSign_eSign.const_get(type).new
157
+ temp_model.build_from_hash(value)
158
+ end
159
+ end
160
+
161
+ # Returns the string representation of the object
162
+ # @return [String] String presentation of the object
163
+ def to_s
164
+ to_hash.to_s
165
+ end
166
+
167
+ # to_body is an alias to to_hash (backward compatibility)
168
+ # @return [Hash] Returns the object in the form of hash
169
+ def to_body
170
+ to_hash
171
+ end
172
+
173
+ # Returns the object in the form of hash
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_hash
176
+ hash = {}
177
+ self.class.attribute_map.each_pair do |attr, param|
178
+ value = self.send(attr)
179
+ next if value.nil?
180
+ hash[param] = _to_hash(value)
181
+ end
182
+ hash
183
+ end
184
+
185
+ # Outputs non-array value in the form of hash
186
+ # For object, use to_hash. Otherwise, just return the value
187
+ # @param [Object] value Any valid value
188
+ # @return [Hash] Returns the value in the form of hash
189
+ def _to_hash(value)
190
+ if value.is_a?(Array)
191
+ value.compact.map { |v| _to_hash(v) }
192
+ elsif value.is_a?(Hash)
193
+ {}.tap do |hash|
194
+ value.each { |k, v| hash[k] = _to_hash(v) }
195
+ end
196
+ elsif value.respond_to? :to_hash
197
+ value.to_hash
198
+ else
199
+ value
200
+ end
201
+ end
202
+
203
+ end
204
+ end
@@ -0,0 +1,184 @@
1
+ =begin
2
+ #DocuSign REST API
3
+
4
+ #The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
5
+
6
+ OpenAPI spec version: v2.1
7
+ Contact: devcenter@docusign.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module DocuSign_eSign
15
+ class EnvelopeViewTemplateSettings
16
+ #
17
+ attr_accessor :show_matching_templates_prompt
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'show_matching_templates_prompt' => :'showMatchingTemplatesPrompt'
23
+ }
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.swagger_types
28
+ {
29
+ :'show_matching_templates_prompt' => :'String'
30
+ }
31
+ end
32
+
33
+ # Initializes the object
34
+ # @param [Hash] attributes Model attributes in the form of hash
35
+ def initialize(attributes = {})
36
+ return unless attributes.is_a?(Hash)
37
+
38
+ # convert string to symbol for hash key
39
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
40
+
41
+ if attributes.has_key?(:'showMatchingTemplatesPrompt')
42
+ self.show_matching_templates_prompt = attributes[:'showMatchingTemplatesPrompt']
43
+ end
44
+ end
45
+
46
+ # Show invalid properties with the reasons. Usually used together with valid?
47
+ # @return Array for valid properties with the reasons
48
+ def list_invalid_properties
49
+ invalid_properties = Array.new
50
+ invalid_properties
51
+ end
52
+
53
+ # Check to see if the all the properties in the model are valid
54
+ # @return true if the model is valid
55
+ def valid?
56
+ true
57
+ end
58
+
59
+ # Checks equality by comparing each attribute.
60
+ # @param [Object] Object to be compared
61
+ def ==(o)
62
+ return true if self.equal?(o)
63
+ self.class == o.class &&
64
+ show_matching_templates_prompt == o.show_matching_templates_prompt
65
+ end
66
+
67
+ # @see the `==` method
68
+ # @param [Object] Object to be compared
69
+ def eql?(o)
70
+ self == o
71
+ end
72
+
73
+ # Calculates hash code according to all attributes.
74
+ # @return [Fixnum] Hash code
75
+ def hash
76
+ [show_matching_templates_prompt].hash
77
+ end
78
+
79
+ # Builds the object from hash
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ # @return [Object] Returns the model itself
82
+ def build_from_hash(attributes)
83
+ return nil unless attributes.is_a?(Hash)
84
+ self.class.swagger_types.each_pair do |key, type|
85
+ if type =~ /\AArray<(.*)>/i
86
+ # check to ensure the input is an array given that the attribute
87
+ # is documented as an array but the input is not
88
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
89
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
90
+ end
91
+ elsif !attributes[self.class.attribute_map[key]].nil?
92
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
93
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
94
+ end
95
+
96
+ self
97
+ end
98
+
99
+ # Deserializes the data based on type
100
+ # @param string type Data type
101
+ # @param string value Value to be deserialized
102
+ # @return [Object] Deserialized data
103
+ def _deserialize(type, value)
104
+ case type.to_sym
105
+ when :DateTime
106
+ DateTime.parse(value)
107
+ when :Date
108
+ Date.parse(value)
109
+ when :String
110
+ value.to_s
111
+ when :Integer
112
+ value.to_i
113
+ when :Float
114
+ value.to_f
115
+ when :BOOLEAN
116
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
117
+ true
118
+ else
119
+ false
120
+ end
121
+ when :Object
122
+ # generic object (usually a Hash), return directly
123
+ value
124
+ when /\AArray<(?<inner_type>.+)>\z/
125
+ inner_type = Regexp.last_match[:inner_type]
126
+ value.map { |v| _deserialize(inner_type, v) }
127
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
128
+ k_type = Regexp.last_match[:k_type]
129
+ v_type = Regexp.last_match[:v_type]
130
+ {}.tap do |hash|
131
+ value.each do |k, v|
132
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
133
+ end
134
+ end
135
+ else # model
136
+ temp_model = DocuSign_eSign.const_get(type).new
137
+ temp_model.build_from_hash(value)
138
+ end
139
+ end
140
+
141
+ # Returns the string representation of the object
142
+ # @return [String] String presentation of the object
143
+ def to_s
144
+ to_hash.to_s
145
+ end
146
+
147
+ # to_body is an alias to to_hash (backward compatibility)
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_body
150
+ to_hash
151
+ end
152
+
153
+ # Returns the object in the form of hash
154
+ # @return [Hash] Returns the object in the form of hash
155
+ def to_hash
156
+ hash = {}
157
+ self.class.attribute_map.each_pair do |attr, param|
158
+ value = self.send(attr)
159
+ next if value.nil?
160
+ hash[param] = _to_hash(value)
161
+ end
162
+ hash
163
+ end
164
+
165
+ # Outputs non-array value in the form of hash
166
+ # For object, use to_hash. Otherwise, just return the value
167
+ # @param [Object] value Any valid value
168
+ # @return [Hash] Returns the value in the form of hash
169
+ def _to_hash(value)
170
+ if value.is_a?(Array)
171
+ value.compact.map { |v| _to_hash(v) }
172
+ elsif value.is_a?(Hash)
173
+ {}.tap do |hash|
174
+ value.each { |k, v| hash[k] = _to_hash(v) }
175
+ end
176
+ elsif value.respond_to? :to_hash
177
+ value.to_hash
178
+ else
179
+ value
180
+ end
181
+ end
182
+
183
+ end
184
+ end