docusign_esign 3.4.0 → 3.5.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +73 -0
  3. data/docusign_esign-2.6.0.rc1.gem +0 -0
  4. data/lib/docusign_esign.rb +24 -0
  5. data/lib/docusign_esign/.DS_Store +0 -0
  6. data/lib/docusign_esign/api/.DS_Store +0 -0
  7. data/lib/docusign_esign/api/accounts_api.rb +362 -0
  8. data/lib/docusign_esign/api/bulk_envelopes_api.rb +126 -4
  9. data/lib/docusign_esign/api/envelopes_api.rb +320 -0
  10. data/lib/docusign_esign/client/.DS_Store +0 -0
  11. data/lib/docusign_esign/models/account_settings_information.rb +11 -1
  12. data/lib/docusign_esign/models/bulk_send_batch_status.rb +287 -0
  13. data/lib/docusign_esign/models/bulk_send_batch_summaries.rb +277 -0
  14. data/lib/docusign_esign/models/bulk_send_batch_summary.rb +255 -0
  15. data/lib/docusign_esign/models/bulk_send_error_status.rb +207 -0
  16. data/lib/docusign_esign/models/conditional_recipient_rule.rb +216 -0
  17. data/lib/docusign_esign/models/conditional_recipient_rule_condition.rb +207 -0
  18. data/lib/docusign_esign/models/conditional_recipient_rule_filter.rb +235 -0
  19. data/lib/docusign_esign/models/e_note_configuration.rb +11 -1
  20. data/lib/docusign_esign/models/envelope.rb +13 -4
  21. data/lib/docusign_esign/models/envelope_definition.rb +13 -4
  22. data/lib/docusign_esign/models/envelope_template.rb +13 -4
  23. data/lib/docusign_esign/models/new_user.rb +11 -1
  24. data/lib/docusign_esign/models/proof_service_resource_token.rb +14 -4
  25. data/lib/docusign_esign/models/recipient_additional_notification.rb +14 -4
  26. data/lib/docusign_esign/models/recipient_group.rb +207 -0
  27. data/lib/docusign_esign/models/recipient_option.rb +225 -0
  28. data/lib/docusign_esign/models/recipient_routing.rb +184 -0
  29. data/lib/docusign_esign/models/recipient_rules.rb +187 -0
  30. data/lib/docusign_esign/models/report_in_product_csv_run_request.rb +437 -0
  31. data/lib/docusign_esign/models/report_in_product_field.rb +215 -0
  32. data/lib/docusign_esign/models/report_in_product_get.rb +466 -0
  33. data/lib/docusign_esign/models/report_in_product_list.rb +187 -0
  34. data/lib/docusign_esign/models/report_in_product_list_item.rb +315 -0
  35. data/lib/docusign_esign/models/report_in_product_run_request.rb +397 -0
  36. data/lib/docusign_esign/models/report_in_product_run_response.rb +247 -0
  37. data/lib/docusign_esign/models/report_in_product_run_response_row.rb +194 -0
  38. data/lib/docusign_esign/models/report_in_product_run_response_row_fields.rb +1395 -0
  39. data/lib/docusign_esign/models/report_in_product_save_response.rb +185 -0
  40. data/lib/docusign_esign/models/report_in_product_sent_by_details.rb +199 -0
  41. data/lib/docusign_esign/models/sender_email_notifications.rb +11 -1
  42. data/lib/docusign_esign/models/tab_metadata.rb +21 -1
  43. data/lib/docusign_esign/models/workflow.rb +207 -0
  44. data/lib/docusign_esign/models/workflow_step.rb +254 -0
  45. data/lib/docusign_esign/version.rb +1 -1
  46. data/tests/Gemfile.lock +3 -3
  47. metadata +33 -7
  48. data/docusign_esign-2.4.0.gem +0 -0
  49. data/docusign_esign-2.5.0.rc1.gem +0 -0
  50. data/docusign_esign-3.4.0.rc1.gem +0 -0
@@ -0,0 +1,216 @@
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
+ Swagger Codegen version: 2.4.13-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module DocuSign_eSign
16
+ class ConditionalRecipientRule
17
+ #
18
+ attr_accessor :conditions
19
+
20
+ #
21
+ attr_accessor :order
22
+
23
+ attr_accessor :recipient_group
24
+
25
+ # Unique for the recipient. It is used by the tab element to indicate which recipient is to sign the Document.
26
+ attr_accessor :recipient_id
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'conditions' => :'conditions',
32
+ :'order' => :'order',
33
+ :'recipient_group' => :'recipientGroup',
34
+ :'recipient_id' => :'recipientId'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+ :'conditions' => :'Array<ConditionalRecipientRuleCondition>',
42
+ :'order' => :'String',
43
+ :'recipient_group' => :'RecipientGroup',
44
+ :'recipient_id' => :'String'
45
+ }
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ def initialize(attributes = {})
51
+ return unless attributes.is_a?(Hash)
52
+
53
+ # convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
55
+
56
+ if attributes.has_key?(:'conditions')
57
+ if (value = attributes[:'conditions']).is_a?(Array)
58
+ self.conditions = value
59
+ end
60
+ end
61
+
62
+ if attributes.has_key?(:'order')
63
+ self.order = attributes[:'order']
64
+ end
65
+
66
+ if attributes.has_key?(:'recipientGroup')
67
+ self.recipient_group = attributes[:'recipientGroup']
68
+ end
69
+
70
+ if attributes.has_key?(:'recipientId')
71
+ self.recipient_id = attributes[:'recipientId']
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ invalid_properties = Array.new
79
+ invalid_properties
80
+ end
81
+
82
+ # Check to see if the all the properties in the model are valid
83
+ # @return true if the model is valid
84
+ def valid?
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ conditions == o.conditions &&
94
+ order == o.order &&
95
+ recipient_group == o.recipient_group &&
96
+ recipient_id == o.recipient_id
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Fixnum] Hash code
107
+ def hash
108
+ [conditions, order, recipient_group, recipient_id].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def build_from_hash(attributes)
115
+ return nil unless attributes.is_a?(Hash)
116
+ self.class.swagger_types.each_pair do |key, type|
117
+ if type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
121
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
122
+ end
123
+ elsif !attributes[self.class.attribute_map[key]].nil?
124
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
125
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
126
+ end
127
+
128
+ self
129
+ end
130
+
131
+ # Deserializes the data based on type
132
+ # @param string type Data type
133
+ # @param string value Value to be deserialized
134
+ # @return [Object] Deserialized data
135
+ def _deserialize(type, value)
136
+ case type.to_sym
137
+ when :DateTime
138
+ DateTime.parse(value)
139
+ when :Date
140
+ Date.parse(value)
141
+ when :String
142
+ value.to_s
143
+ when :Integer
144
+ value.to_i
145
+ when :Float
146
+ value.to_f
147
+ when :BOOLEAN
148
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149
+ true
150
+ else
151
+ false
152
+ end
153
+ when :Object
154
+ # generic object (usually a Hash), return directly
155
+ value
156
+ when /\AArray<(?<inner_type>.+)>\z/
157
+ inner_type = Regexp.last_match[:inner_type]
158
+ value.map { |v| _deserialize(inner_type, v) }
159
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
160
+ k_type = Regexp.last_match[:k_type]
161
+ v_type = Regexp.last_match[:v_type]
162
+ {}.tap do |hash|
163
+ value.each do |k, v|
164
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165
+ end
166
+ end
167
+ else # model
168
+ temp_model = DocuSign_eSign.const_get(type).new
169
+ temp_model.build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ next if value.nil?
192
+ hash[param] = _to_hash(value)
193
+ end
194
+ hash
195
+ end
196
+
197
+ # Outputs non-array value in the form of hash
198
+ # For object, use to_hash. Otherwise, just return the value
199
+ # @param [Object] value Any valid value
200
+ # @return [Hash] Returns the value in the form of hash
201
+ def _to_hash(value)
202
+ if value.is_a?(Array)
203
+ value.compact.map { |v| _to_hash(v) }
204
+ elsif value.is_a?(Hash)
205
+ {}.tap do |hash|
206
+ value.each { |k, v| hash[k] = _to_hash(v) }
207
+ end
208
+ elsif value.respond_to? :to_hash
209
+ value.to_hash
210
+ else
211
+ value
212
+ end
213
+ end
214
+
215
+ end
216
+ end
@@ -0,0 +1,207 @@
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
+ Swagger Codegen version: 2.4.13-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module DocuSign_eSign
16
+ class ConditionalRecipientRuleCondition
17
+ #
18
+ attr_accessor :filters
19
+
20
+ #
21
+ attr_accessor :order
22
+
23
+ #
24
+ attr_accessor :recipient_label
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'filters' => :'filters',
30
+ :'order' => :'order',
31
+ :'recipient_label' => :'recipientLabel'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.swagger_types
37
+ {
38
+ :'filters' => :'Array<ConditionalRecipientRuleFilter>',
39
+ :'order' => :'String',
40
+ :'recipient_label' => :'String'
41
+ }
42
+ end
43
+
44
+ # Initializes the object
45
+ # @param [Hash] attributes Model attributes in the form of hash
46
+ def initialize(attributes = {})
47
+ return unless attributes.is_a?(Hash)
48
+
49
+ # convert string to symbol for hash key
50
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
51
+
52
+ if attributes.has_key?(:'filters')
53
+ if (value = attributes[:'filters']).is_a?(Array)
54
+ self.filters = value
55
+ end
56
+ end
57
+
58
+ if attributes.has_key?(:'order')
59
+ self.order = attributes[:'order']
60
+ end
61
+
62
+ if attributes.has_key?(:'recipientLabel')
63
+ self.recipient_label = attributes[:'recipientLabel']
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = Array.new
71
+ invalid_properties
72
+ end
73
+
74
+ # Check to see if the all the properties in the model are valid
75
+ # @return true if the model is valid
76
+ def valid?
77
+ true
78
+ end
79
+
80
+ # Checks equality by comparing each attribute.
81
+ # @param [Object] Object to be compared
82
+ def ==(o)
83
+ return true if self.equal?(o)
84
+ self.class == o.class &&
85
+ filters == o.filters &&
86
+ order == o.order &&
87
+ recipient_label == o.recipient_label
88
+ end
89
+
90
+ # @see the `==` method
91
+ # @param [Object] Object to be compared
92
+ def eql?(o)
93
+ self == o
94
+ end
95
+
96
+ # Calculates hash code according to all attributes.
97
+ # @return [Fixnum] Hash code
98
+ def hash
99
+ [filters, order, recipient_label].hash
100
+ end
101
+
102
+ # Builds the object from hash
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ # @return [Object] Returns the model itself
105
+ def build_from_hash(attributes)
106
+ return nil unless attributes.is_a?(Hash)
107
+ self.class.swagger_types.each_pair do |key, type|
108
+ if type =~ /\AArray<(.*)>/i
109
+ # check to ensure the input is an array given that the attribute
110
+ # is documented as an array but the input is not
111
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
112
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
113
+ end
114
+ elsif !attributes[self.class.attribute_map[key]].nil?
115
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
116
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
117
+ end
118
+
119
+ self
120
+ end
121
+
122
+ # Deserializes the data based on type
123
+ # @param string type Data type
124
+ # @param string value Value to be deserialized
125
+ # @return [Object] Deserialized data
126
+ def _deserialize(type, value)
127
+ case type.to_sym
128
+ when :DateTime
129
+ DateTime.parse(value)
130
+ when :Date
131
+ Date.parse(value)
132
+ when :String
133
+ value.to_s
134
+ when :Integer
135
+ value.to_i
136
+ when :Float
137
+ value.to_f
138
+ when :BOOLEAN
139
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
140
+ true
141
+ else
142
+ false
143
+ end
144
+ when :Object
145
+ # generic object (usually a Hash), return directly
146
+ value
147
+ when /\AArray<(?<inner_type>.+)>\z/
148
+ inner_type = Regexp.last_match[:inner_type]
149
+ value.map { |v| _deserialize(inner_type, v) }
150
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
151
+ k_type = Regexp.last_match[:k_type]
152
+ v_type = Regexp.last_match[:v_type]
153
+ {}.tap do |hash|
154
+ value.each do |k, v|
155
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
156
+ end
157
+ end
158
+ else # model
159
+ temp_model = DocuSign_eSign.const_get(type).new
160
+ temp_model.build_from_hash(value)
161
+ end
162
+ end
163
+
164
+ # Returns the string representation of the object
165
+ # @return [String] String presentation of the object
166
+ def to_s
167
+ to_hash.to_s
168
+ end
169
+
170
+ # to_body is an alias to to_hash (backward compatibility)
171
+ # @return [Hash] Returns the object in the form of hash
172
+ def to_body
173
+ to_hash
174
+ end
175
+
176
+ # Returns the object in the form of hash
177
+ # @return [Hash] Returns the object in the form of hash
178
+ def to_hash
179
+ hash = {}
180
+ self.class.attribute_map.each_pair do |attr, param|
181
+ value = self.send(attr)
182
+ next if value.nil?
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ # Outputs non-array value in the form of hash
189
+ # For object, use to_hash. Otherwise, just return the value
190
+ # @param [Object] value Any valid value
191
+ # @return [Hash] Returns the value in the form of hash
192
+ def _to_hash(value)
193
+ if value.is_a?(Array)
194
+ value.compact.map { |v| _to_hash(v) }
195
+ elsif value.is_a?(Hash)
196
+ {}.tap do |hash|
197
+ value.each { |k, v| hash[k] = _to_hash(v) }
198
+ end
199
+ elsif value.respond_to? :to_hash
200
+ value.to_hash
201
+ else
202
+ value
203
+ end
204
+ end
205
+
206
+ end
207
+ end
@@ -0,0 +1,235 @@
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
+ Swagger Codegen version: 2.4.13-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module DocuSign_eSign
16
+ class ConditionalRecipientRuleFilter
17
+ #
18
+ attr_accessor :operator
19
+
20
+ # Unique for the recipient. It is used by the tab element to indicate which recipient is to sign the Document.
21
+ attr_accessor :recipient_id
22
+
23
+ #
24
+ attr_accessor :scope
25
+
26
+ # The unique identifier for the tab. The tabid can be retrieved with the [ML:GET call].
27
+ attr_accessor :tab_id
28
+
29
+ # The label string associated with the tab.
30
+ attr_accessor :tab_label
31
+
32
+ # Specifies the value of the tab.
33
+ attr_accessor :value
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'operator' => :'operator',
39
+ :'recipient_id' => :'recipientId',
40
+ :'scope' => :'scope',
41
+ :'tab_id' => :'tabId',
42
+ :'tab_label' => :'tabLabel',
43
+ :'value' => :'value'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.swagger_types
49
+ {
50
+ :'operator' => :'String',
51
+ :'recipient_id' => :'String',
52
+ :'scope' => :'String',
53
+ :'tab_id' => :'String',
54
+ :'tab_label' => :'String',
55
+ :'value' => :'String'
56
+ }
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ return unless attributes.is_a?(Hash)
63
+
64
+ # convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
66
+
67
+ if attributes.has_key?(:'operator')
68
+ self.operator = attributes[:'operator']
69
+ end
70
+
71
+ if attributes.has_key?(:'recipientId')
72
+ self.recipient_id = attributes[:'recipientId']
73
+ end
74
+
75
+ if attributes.has_key?(:'scope')
76
+ self.scope = attributes[:'scope']
77
+ end
78
+
79
+ if attributes.has_key?(:'tabId')
80
+ self.tab_id = attributes[:'tabId']
81
+ end
82
+
83
+ if attributes.has_key?(:'tabLabel')
84
+ self.tab_label = attributes[:'tabLabel']
85
+ end
86
+
87
+ if attributes.has_key?(:'value')
88
+ self.value = attributes[:'value']
89
+ end
90
+ end
91
+
92
+ # Show invalid properties with the reasons. Usually used together with valid?
93
+ # @return Array for valid properties with the reasons
94
+ def list_invalid_properties
95
+ invalid_properties = Array.new
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ true
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] Object to be compared
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ operator == o.operator &&
111
+ recipient_id == o.recipient_id &&
112
+ scope == o.scope &&
113
+ tab_id == o.tab_id &&
114
+ tab_label == o.tab_label &&
115
+ value == o.value
116
+ end
117
+
118
+ # @see the `==` method
119
+ # @param [Object] Object to be compared
120
+ def eql?(o)
121
+ self == o
122
+ end
123
+
124
+ # Calculates hash code according to all attributes.
125
+ # @return [Fixnum] Hash code
126
+ def hash
127
+ [operator, recipient_id, scope, tab_id, tab_label, value].hash
128
+ end
129
+
130
+ # Builds the object from hash
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ # @return [Object] Returns the model itself
133
+ def build_from_hash(attributes)
134
+ return nil unless attributes.is_a?(Hash)
135
+ self.class.swagger_types.each_pair do |key, type|
136
+ if type =~ /\AArray<(.*)>/i
137
+ # check to ensure the input is an array given that the attribute
138
+ # is documented as an array but the input is not
139
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
140
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
141
+ end
142
+ elsif !attributes[self.class.attribute_map[key]].nil?
143
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
144
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
145
+ end
146
+
147
+ self
148
+ end
149
+
150
+ # Deserializes the data based on type
151
+ # @param string type Data type
152
+ # @param string value Value to be deserialized
153
+ # @return [Object] Deserialized data
154
+ def _deserialize(type, value)
155
+ case type.to_sym
156
+ when :DateTime
157
+ DateTime.parse(value)
158
+ when :Date
159
+ Date.parse(value)
160
+ when :String
161
+ value.to_s
162
+ when :Integer
163
+ value.to_i
164
+ when :Float
165
+ value.to_f
166
+ when :BOOLEAN
167
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
168
+ true
169
+ else
170
+ false
171
+ end
172
+ when :Object
173
+ # generic object (usually a Hash), return directly
174
+ value
175
+ when /\AArray<(?<inner_type>.+)>\z/
176
+ inner_type = Regexp.last_match[:inner_type]
177
+ value.map { |v| _deserialize(inner_type, v) }
178
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
179
+ k_type = Regexp.last_match[:k_type]
180
+ v_type = Regexp.last_match[:v_type]
181
+ {}.tap do |hash|
182
+ value.each do |k, v|
183
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
184
+ end
185
+ end
186
+ else # model
187
+ temp_model = DocuSign_eSign.const_get(type).new
188
+ temp_model.build_from_hash(value)
189
+ end
190
+ end
191
+
192
+ # Returns the string representation of the object
193
+ # @return [String] String presentation of the object
194
+ def to_s
195
+ to_hash.to_s
196
+ end
197
+
198
+ # to_body is an alias to to_hash (backward compatibility)
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_body
201
+ to_hash
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ next if value.nil?
211
+ hash[param] = _to_hash(value)
212
+ end
213
+ hash
214
+ end
215
+
216
+ # Outputs non-array value in the form of hash
217
+ # For object, use to_hash. Otherwise, just return the value
218
+ # @param [Object] value Any valid value
219
+ # @return [Hash] Returns the value in the form of hash
220
+ def _to_hash(value)
221
+ if value.is_a?(Array)
222
+ value.compact.map { |v| _to_hash(v) }
223
+ elsif value.is_a?(Hash)
224
+ {}.tap do |hash|
225
+ value.each { |k, v| hash[k] = _to_hash(v) }
226
+ end
227
+ elsif value.respond_to? :to_hash
228
+ value.to_hash
229
+ else
230
+ value
231
+ end
232
+ end
233
+
234
+ end
235
+ end