docusign_esign 2.1.0 → 2.2.0.pre.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1 -1
  3. data/docusign_esign-3.1.0.pre.rc1.gem +0 -0
  4. data/lib/docusign_esign.rb +450 -383
  5. data/{tests → lib/docusign_esign/api}/.DS_Store +0 -0
  6. data/lib/docusign_esign/api/accounts_api.rb +69 -8
  7. data/lib/docusign_esign/api/connect_api.rb +400 -0
  8. data/lib/docusign_esign/api/envelopes_api.rb +18 -6
  9. data/lib/docusign_esign/api/organizations_api.rb +232 -0
  10. data/lib/docusign_esign/api/tsps_api.rb +256 -0
  11. data/lib/docusign_esign/models/access_code_format.rb +273 -0
  12. data/lib/docusign_esign/models/account_notification.rb +206 -0
  13. data/lib/docusign_esign/models/account_ui_settings.rb +330 -0
  14. data/lib/docusign_esign/models/bcc_email_archive.rb +276 -0
  15. data/lib/docusign_esign/models/bcc_email_archive_history.rb +237 -0
  16. data/lib/docusign_esign/models/bcc_email_archive_history_list.rb +250 -0
  17. data/lib/docusign_esign/models/bcc_email_archive_list.rb +250 -0
  18. data/lib/docusign_esign/models/bulk_send_request.rb +188 -0
  19. data/lib/docusign_esign/models/bulk_send_response.rb +222 -0
  20. data/lib/docusign_esign/models/bulk_send_test_response.rb +212 -0
  21. data/lib/docusign_esign/models/bulk_sending_copy.rb +222 -0
  22. data/lib/docusign_esign/models/bulk_sending_copy_custom_field.rb +198 -0
  23. data/lib/docusign_esign/models/bulk_sending_copy_recipient.rb +382 -0
  24. data/lib/docusign_esign/models/bulk_sending_copy_tab.rb +198 -0
  25. data/lib/docusign_esign/models/bulk_sending_list.rb +210 -0
  26. data/lib/docusign_esign/models/bulk_sending_list_summaries.rb +190 -0
  27. data/lib/docusign_esign/models/bulk_sending_list_summary.rb +218 -0
  28. data/lib/docusign_esign/models/carbon_copy.rb +19 -1
  29. data/lib/docusign_esign/models/certified_delivery.rb +19 -1
  30. data/lib/docusign_esign/models/comment.rb +392 -0
  31. data/lib/docusign_esign/models/comment_history_result.rb +220 -0
  32. data/lib/docusign_esign/models/comment_publish.rb +244 -0
  33. data/lib/docusign_esign/models/comment_thread.rb +961 -0
  34. data/lib/docusign_esign/models/comments_publish.rb +190 -0
  35. data/lib/docusign_esign/models/connect_salesforce_field.rb +258 -0
  36. data/lib/docusign_esign/models/connect_salesforce_object.rb +272 -0
  37. data/lib/docusign_esign/models/connect_user_object.rb +230 -0
  38. data/lib/docusign_esign/models/direct_debit_processor_information.rb +298 -0
  39. data/lib/docusign_esign/models/display_appliance_document.rb +258 -0
  40. data/lib/docusign_esign/models/display_appliance_document_page.rb +278 -0
  41. data/lib/docusign_esign/models/display_appliance_envelope.rb +328 -0
  42. data/lib/docusign_esign/models/display_appliance_info.rb +235 -0
  43. data/lib/docusign_esign/models/display_appliance_page.rb +278 -0
  44. data/lib/docusign_esign/models/display_appliance_pdf.rb +267 -0
  45. data/lib/docusign_esign/models/display_appliance_recipient.rb +388 -0
  46. data/lib/docusign_esign/models/display_appliance_signer_attachment.rb +248 -0
  47. data/lib/docusign_esign/models/document_fields_information.rb +1 -1
  48. data/lib/docusign_esign/models/document_html_display_settings.rb +11 -1
  49. data/lib/docusign_esign/models/envelope_document.rb +11 -1
  50. data/lib/docusign_esign/models/envelope_metadata.rb +208 -0
  51. data/lib/docusign_esign/models/envelope_purge_configuration.rb +218 -0
  52. data/lib/docusign_esign/models/envelope_transfer_rule.rb +273 -0
  53. data/lib/docusign_esign/models/envelope_transfer_rule_information.rb +250 -0
  54. data/lib/docusign_esign/models/envelope_transfer_rule_request.rb +279 -0
  55. data/lib/docusign_esign/models/external_claim.rb +218 -0
  56. data/lib/docusign_esign/models/external_document_sources.rb +273 -0
  57. data/lib/docusign_esign/models/favorite_templates_content_item.rb +207 -0
  58. data/lib/docusign_esign/models/favorite_templates_info.rb +209 -0
  59. data/lib/docusign_esign/models/feature_available_metadata.rb +198 -0
  60. data/lib/docusign_esign/models/folder_shared_item.rb +289 -0
  61. data/lib/docusign_esign/models/form_data_item.rb +227 -0
  62. data/lib/docusign_esign/models/graphics_context.rb +208 -0
  63. data/lib/docusign_esign/models/id_check_configuration.rb +210 -0
  64. data/lib/docusign_esign/models/id_check_security_step.rb +188 -0
  65. data/lib/docusign_esign/models/locale_policy.rb +595 -0
  66. data/lib/docusign_esign/models/locale_policy_tab.rb +298 -0
  67. data/lib/docusign_esign/models/new_account_definition.rb +11 -1
  68. data/lib/docusign_esign/models/notification_default_settings.rb +196 -0
  69. data/lib/docusign_esign/models/notification_defaults.rb +196 -0
  70. data/lib/docusign_esign/models/offline_attributes.rb +238 -0
  71. data/lib/docusign_esign/models/page_size.rb +198 -0
  72. data/lib/docusign_esign/models/path_extended_element.rb +208 -0
  73. data/lib/docusign_esign/models/pay_pal_legacy_settings.rb +228 -0
  74. data/lib/docusign_esign/models/payment_gateway_account_setting.rb +218 -0
  75. data/lib/docusign_esign/models/payment_method_with_options.rb +200 -0
  76. data/lib/docusign_esign/models/poly_line.rb +218 -0
  77. data/lib/docusign_esign/models/poly_line_overlay.rb +885 -0
  78. data/lib/docusign_esign/models/recipient_email_notification.rb +1 -1
  79. data/lib/docusign_esign/models/recipient_preview_request.rb +278 -0
  80. data/lib/docusign_esign/models/recipient_proof_file.rb +188 -0
  81. data/lib/docusign_esign/models/signature_properties.rb +198 -0
  82. data/lib/docusign_esign/models/signer.rb +11 -2
  83. data/lib/docusign_esign/models/smart_section_display_settings.rb +11 -1
  84. data/lib/docusign_esign/models/tab_group.rb +911 -0
  85. data/lib/docusign_esign/models/usage_history.rb +1 -1
  86. data/lib/docusign_esign/models/user_information.rb +1 -1
  87. data/lib/docusign_esign/models/witness.rb +10 -1
  88. data/lib/docusign_esign/models/workspace_settings.rb +188 -0
  89. data/lib/docusign_esign/version.rb +1 -1
  90. data/tests/Gemfile.lock +1 -1
  91. data/tests/spec/unit_tests_using_jwt_spec.rb +6 -3
  92. metadata +74 -7
  93. data/Gemfile.lock +0 -73
  94. data/lib/docusign_esign/api/trust_service_providers_api.rb +0 -73
@@ -0,0 +1,212 @@
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
+
16
+ class BulkSendTestResponse
17
+ #
18
+ attr_accessor :can_be_sent
19
+
20
+ #
21
+ attr_accessor :validation_error_details
22
+
23
+ #
24
+ attr_accessor :validation_errors
25
+
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'can_be_sent' => :'canBeSent',
31
+ :'validation_error_details' => :'validationErrorDetails',
32
+ :'validation_errors' => :'validationErrors'
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.swagger_types
38
+ {
39
+ :'can_be_sent' => :'BOOLEAN',
40
+ :'validation_error_details' => :'Array<String>',
41
+ :'validation_errors' => :'Array<String>'
42
+ }
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ return unless attributes.is_a?(Hash)
49
+
50
+ # convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
52
+
53
+ if attributes.has_key?(:'canBeSent')
54
+ self.can_be_sent = attributes[:'canBeSent']
55
+ end
56
+
57
+ if attributes.has_key?(:'validationErrorDetails')
58
+ if (value = attributes[:'validationErrorDetails']).is_a?(Array)
59
+ self.validation_error_details = value
60
+ end
61
+ end
62
+
63
+ if attributes.has_key?(:'validationErrors')
64
+ if (value = attributes[:'validationErrors']).is_a?(Array)
65
+ self.validation_errors = value
66
+ end
67
+ end
68
+
69
+ end
70
+
71
+ # Show invalid properties with the reasons. Usually used together with valid?
72
+ # @return Array for valid properies with the reasons
73
+ def list_invalid_properties
74
+ invalid_properties = Array.new
75
+ return invalid_properties
76
+ end
77
+
78
+ # Check to see if the all the properties in the model are valid
79
+ # @return true if the model is valid
80
+ def valid?
81
+ return true
82
+ end
83
+
84
+ # Checks equality by comparing each attribute.
85
+ # @param [Object] Object to be compared
86
+ def ==(o)
87
+ return true if self.equal?(o)
88
+ self.class == o.class &&
89
+ can_be_sent == o.can_be_sent &&
90
+ validation_error_details == o.validation_error_details &&
91
+ validation_errors == o.validation_errors
92
+ end
93
+
94
+ # @see the `==` method
95
+ # @param [Object] Object to be compared
96
+ def eql?(o)
97
+ self == o
98
+ end
99
+
100
+ # Calculates hash code according to all attributes.
101
+ # @return [Fixnum] Hash code
102
+ def hash
103
+ [can_be_sent, validation_error_details, validation_errors].hash
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ self.class.swagger_types.each_pair do |key, type|
112
+ if type =~ /\AArray<(.*)>/i
113
+ # check to ensure the input is an array given that the the attribute
114
+ # is documented as an array but the input is not
115
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
116
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
117
+ end
118
+ elsif !attributes[self.class.attribute_map[key]].nil?
119
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
120
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
121
+ end
122
+
123
+ self
124
+ end
125
+
126
+ # Deserializes the data based on type
127
+ # @param string type Data type
128
+ # @param string value Value to be deserialized
129
+ # @return [Object] Deserialized data
130
+ def _deserialize(type, value)
131
+ case type.to_sym
132
+ when :DateTime
133
+ DateTime.parse(value)
134
+ when :Date
135
+ Date.parse(value)
136
+ when :String
137
+ value.to_s
138
+ when :Integer
139
+ value.to_i
140
+ when :Float
141
+ value.to_f
142
+ when :BOOLEAN
143
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
144
+ true
145
+ else
146
+ false
147
+ end
148
+ when :Object
149
+ # generic object (usually a Hash), return directly
150
+ value
151
+ when /\AArray<(?<inner_type>.+)>\z/
152
+ inner_type = Regexp.last_match[:inner_type]
153
+ value.map { |v| _deserialize(inner_type, v) }
154
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
155
+ k_type = Regexp.last_match[:k_type]
156
+ v_type = Regexp.last_match[:v_type]
157
+ {}.tap do |hash|
158
+ value.each do |k, v|
159
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
160
+ end
161
+ end
162
+ else # model
163
+ temp_model = DocuSign_eSign.const_get(type).new
164
+ temp_model.build_from_hash(value)
165
+ end
166
+ end
167
+
168
+ # Returns the string representation of the object
169
+ # @return [String] String presentation of the object
170
+ def to_s
171
+ to_hash.to_s
172
+ end
173
+
174
+ # to_body is an alias to to_hash (backward compatibility)
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_body
177
+ to_hash
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ next if value.nil?
187
+ hash[param] = _to_hash(value)
188
+ end
189
+ hash
190
+ end
191
+
192
+ # Outputs non-array value in the form of hash
193
+ # For object, use to_hash. Otherwise, just return the value
194
+ # @param [Object] value Any valid value
195
+ # @return [Hash] Returns the value in the form of hash
196
+ def _to_hash(value)
197
+ if value.is_a?(Array)
198
+ value.compact.map{ |v| _to_hash(v) }
199
+ elsif value.is_a?(Hash)
200
+ {}.tap do |hash|
201
+ value.each { |k, v| hash[k] = _to_hash(v) }
202
+ end
203
+ elsif value.respond_to? :to_hash
204
+ value.to_hash
205
+ else
206
+ value
207
+ end
208
+ end
209
+
210
+ end
211
+
212
+ end
@@ -0,0 +1,222 @@
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
+
16
+ class BulkSendingCopy
17
+ # An optional array of strings that allows the sender to provide custom data about the recipient. This information is returned in the envelope status but otherwise not used by DocuSign. Each customField string can be a maximum of 100 characters.
18
+ attr_accessor :custom_fields
19
+
20
+ #
21
+ attr_accessor :email_blurb
22
+
23
+ # Specifies the subject of the email that is sent to all recipients. See [ML:Template Email Subject Merge Fields] for information about adding merge field information to the email subject.
24
+ attr_accessor :email_subject
25
+
26
+ # An array of powerform recipients.
27
+ attr_accessor :recipients
28
+
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'custom_fields' => :'customFields',
34
+ :'email_blurb' => :'emailBlurb',
35
+ :'email_subject' => :'emailSubject',
36
+ :'recipients' => :'recipients'
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.swagger_types
42
+ {
43
+ :'custom_fields' => :'Array<BulkSendingCopyCustomField>',
44
+ :'email_blurb' => :'String',
45
+ :'email_subject' => :'String',
46
+ :'recipients' => :'Array<BulkSendingCopyRecipient>'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
57
+
58
+ if attributes.has_key?(:'customFields')
59
+ if (value = attributes[:'customFields']).is_a?(Array)
60
+ self.custom_fields = value
61
+ end
62
+ end
63
+
64
+ if attributes.has_key?(:'emailBlurb')
65
+ self.email_blurb = attributes[:'emailBlurb']
66
+ end
67
+
68
+ if attributes.has_key?(:'emailSubject')
69
+ self.email_subject = attributes[:'emailSubject']
70
+ end
71
+
72
+ if attributes.has_key?(:'recipients')
73
+ if (value = attributes[:'recipients']).is_a?(Array)
74
+ self.recipients = value
75
+ end
76
+ end
77
+
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properies with the reasons
82
+ def list_invalid_properties
83
+ invalid_properties = Array.new
84
+ return invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ return true
91
+ end
92
+
93
+ # Checks equality by comparing each attribute.
94
+ # @param [Object] Object to be compared
95
+ def ==(o)
96
+ return true if self.equal?(o)
97
+ self.class == o.class &&
98
+ custom_fields == o.custom_fields &&
99
+ email_blurb == o.email_blurb &&
100
+ email_subject == o.email_subject &&
101
+ recipients == o.recipients
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Fixnum] Hash code
112
+ def hash
113
+ [custom_fields, email_blurb, email_subject, recipients].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ self.class.swagger_types.each_pair do |key, type|
122
+ if type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the the attribute
124
+ # is documented as an array but the input is not
125
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
126
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
127
+ end
128
+ elsif !attributes[self.class.attribute_map[key]].nil?
129
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
130
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
131
+ end
132
+
133
+ self
134
+ end
135
+
136
+ # Deserializes the data based on type
137
+ # @param string type Data type
138
+ # @param string value Value to be deserialized
139
+ # @return [Object] Deserialized data
140
+ def _deserialize(type, value)
141
+ case type.to_sym
142
+ when :DateTime
143
+ DateTime.parse(value)
144
+ when :Date
145
+ Date.parse(value)
146
+ when :String
147
+ value.to_s
148
+ when :Integer
149
+ value.to_i
150
+ when :Float
151
+ value.to_f
152
+ when :BOOLEAN
153
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
154
+ true
155
+ else
156
+ false
157
+ end
158
+ when :Object
159
+ # generic object (usually a Hash), return directly
160
+ value
161
+ when /\AArray<(?<inner_type>.+)>\z/
162
+ inner_type = Regexp.last_match[:inner_type]
163
+ value.map { |v| _deserialize(inner_type, v) }
164
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
165
+ k_type = Regexp.last_match[:k_type]
166
+ v_type = Regexp.last_match[:v_type]
167
+ {}.tap do |hash|
168
+ value.each do |k, v|
169
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
170
+ end
171
+ end
172
+ else # model
173
+ temp_model = DocuSign_eSign.const_get(type).new
174
+ temp_model.build_from_hash(value)
175
+ end
176
+ end
177
+
178
+ # Returns the string representation of the object
179
+ # @return [String] String presentation of the object
180
+ def to_s
181
+ to_hash.to_s
182
+ end
183
+
184
+ # to_body is an alias to to_hash (backward compatibility)
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_body
187
+ to_hash
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = self.send(attr)
196
+ next if value.nil?
197
+ hash[param] = _to_hash(value)
198
+ end
199
+ hash
200
+ end
201
+
202
+ # Outputs non-array value in the form of hash
203
+ # For object, use to_hash. Otherwise, just return the value
204
+ # @param [Object] value Any valid value
205
+ # @return [Hash] Returns the value in the form of hash
206
+ def _to_hash(value)
207
+ if value.is_a?(Array)
208
+ value.compact.map{ |v| _to_hash(v) }
209
+ elsif value.is_a?(Hash)
210
+ {}.tap do |hash|
211
+ value.each { |k, v| hash[k] = _to_hash(v) }
212
+ end
213
+ elsif value.respond_to? :to_hash
214
+ value.to_hash
215
+ else
216
+ value
217
+ end
218
+ end
219
+
220
+ end
221
+
222
+ end
@@ -0,0 +1,198 @@
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
+
16
+ class BulkSendingCopyCustomField
17
+ #
18
+ attr_accessor :name
19
+
20
+ # Specifies the value of the tab.
21
+ attr_accessor :value
22
+
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'name' => :'name',
28
+ :'value' => :'value'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+ :'name' => :'String',
36
+ :'value' => :'String'
37
+ }
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ return unless attributes.is_a?(Hash)
44
+
45
+ # convert string to symbol for hash key
46
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
47
+
48
+ if attributes.has_key?(:'name')
49
+ self.name = attributes[:'name']
50
+ end
51
+
52
+ if attributes.has_key?(:'value')
53
+ self.value = attributes[:'value']
54
+ end
55
+
56
+ end
57
+
58
+ # Show invalid properties with the reasons. Usually used together with valid?
59
+ # @return Array for valid properies with the reasons
60
+ def list_invalid_properties
61
+ invalid_properties = Array.new
62
+ return invalid_properties
63
+ end
64
+
65
+ # Check to see if the all the properties in the model are valid
66
+ # @return true if the model is valid
67
+ def valid?
68
+ return true
69
+ end
70
+
71
+ # Checks equality by comparing each attribute.
72
+ # @param [Object] Object to be compared
73
+ def ==(o)
74
+ return true if self.equal?(o)
75
+ self.class == o.class &&
76
+ name == o.name &&
77
+ value == o.value
78
+ end
79
+
80
+ # @see the `==` method
81
+ # @param [Object] Object to be compared
82
+ def eql?(o)
83
+ self == o
84
+ end
85
+
86
+ # Calculates hash code according to all attributes.
87
+ # @return [Fixnum] Hash code
88
+ def hash
89
+ [name, value].hash
90
+ end
91
+
92
+ # Builds the object from hash
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ # @return [Object] Returns the model itself
95
+ def build_from_hash(attributes)
96
+ return nil unless attributes.is_a?(Hash)
97
+ self.class.swagger_types.each_pair do |key, type|
98
+ if type =~ /\AArray<(.*)>/i
99
+ # check to ensure the input is an array given that the the attribute
100
+ # is documented as an array but the input is not
101
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
102
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
103
+ end
104
+ elsif !attributes[self.class.attribute_map[key]].nil?
105
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
106
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
107
+ end
108
+
109
+ self
110
+ end
111
+
112
+ # Deserializes the data based on type
113
+ # @param string type Data type
114
+ # @param string value Value to be deserialized
115
+ # @return [Object] Deserialized data
116
+ def _deserialize(type, value)
117
+ case type.to_sym
118
+ when :DateTime
119
+ DateTime.parse(value)
120
+ when :Date
121
+ Date.parse(value)
122
+ when :String
123
+ value.to_s
124
+ when :Integer
125
+ value.to_i
126
+ when :Float
127
+ value.to_f
128
+ when :BOOLEAN
129
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
130
+ true
131
+ else
132
+ false
133
+ end
134
+ when :Object
135
+ # generic object (usually a Hash), return directly
136
+ value
137
+ when /\AArray<(?<inner_type>.+)>\z/
138
+ inner_type = Regexp.last_match[:inner_type]
139
+ value.map { |v| _deserialize(inner_type, v) }
140
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
141
+ k_type = Regexp.last_match[:k_type]
142
+ v_type = Regexp.last_match[:v_type]
143
+ {}.tap do |hash|
144
+ value.each do |k, v|
145
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
146
+ end
147
+ end
148
+ else # model
149
+ temp_model = DocuSign_eSign.const_get(type).new
150
+ temp_model.build_from_hash(value)
151
+ end
152
+ end
153
+
154
+ # Returns the string representation of the object
155
+ # @return [String] String presentation of the object
156
+ def to_s
157
+ to_hash.to_s
158
+ end
159
+
160
+ # to_body is an alias to to_hash (backward compatibility)
161
+ # @return [Hash] Returns the object in the form of hash
162
+ def to_body
163
+ to_hash
164
+ end
165
+
166
+ # Returns the object in the form of hash
167
+ # @return [Hash] Returns the object in the form of hash
168
+ def to_hash
169
+ hash = {}
170
+ self.class.attribute_map.each_pair do |attr, param|
171
+ value = self.send(attr)
172
+ next if value.nil?
173
+ hash[param] = _to_hash(value)
174
+ end
175
+ hash
176
+ end
177
+
178
+ # Outputs non-array value in the form of hash
179
+ # For object, use to_hash. Otherwise, just return the value
180
+ # @param [Object] value Any valid value
181
+ # @return [Hash] Returns the value in the form of hash
182
+ def _to_hash(value)
183
+ if value.is_a?(Array)
184
+ value.compact.map{ |v| _to_hash(v) }
185
+ elsif value.is_a?(Hash)
186
+ {}.tap do |hash|
187
+ value.each { |k, v| hash[k] = _to_hash(v) }
188
+ end
189
+ elsif value.respond_to? :to_hash
190
+ value.to_hash
191
+ else
192
+ value
193
+ end
194
+ end
195
+
196
+ end
197
+
198
+ end