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,230 @@
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 ConnectUserObject
17
+ # If merge field's are being used, specifies the type of the merge field. The only supported value is **salesforce**.
18
+ attr_accessor :configurationtype
19
+
20
+ #
21
+ attr_accessor :connect_id
22
+
23
+ #
24
+ attr_accessor :enabled
25
+
26
+ #
27
+ attr_accessor :has_access
28
+
29
+ #
30
+ attr_accessor :sender_searchable_items
31
+
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'configurationtype' => :'configurationtype',
37
+ :'connect_id' => :'connectId',
38
+ :'enabled' => :'enabled',
39
+ :'has_access' => :'hasAccess',
40
+ :'sender_searchable_items' => :'senderSearchableItems'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.swagger_types
46
+ {
47
+ :'configurationtype' => :'String',
48
+ :'connect_id' => :'String',
49
+ :'enabled' => :'String',
50
+ :'has_access' => :'String',
51
+ :'sender_searchable_items' => :'Array<String>'
52
+ }
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ return unless attributes.is_a?(Hash)
59
+
60
+ # convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
62
+
63
+ if attributes.has_key?(:'configurationtype')
64
+ self.configurationtype = attributes[:'configurationtype']
65
+ end
66
+
67
+ if attributes.has_key?(:'connectId')
68
+ self.connect_id = attributes[:'connectId']
69
+ end
70
+
71
+ if attributes.has_key?(:'enabled')
72
+ self.enabled = attributes[:'enabled']
73
+ end
74
+
75
+ if attributes.has_key?(:'hasAccess')
76
+ self.has_access = attributes[:'hasAccess']
77
+ end
78
+
79
+ if attributes.has_key?(:'senderSearchableItems')
80
+ if (value = attributes[:'senderSearchableItems']).is_a?(Array)
81
+ self.sender_searchable_items = value
82
+ end
83
+ end
84
+
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properies with the reasons
89
+ def list_invalid_properties
90
+ invalid_properties = Array.new
91
+ return invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ return true
98
+ end
99
+
100
+ # Checks equality by comparing each attribute.
101
+ # @param [Object] Object to be compared
102
+ def ==(o)
103
+ return true if self.equal?(o)
104
+ self.class == o.class &&
105
+ configurationtype == o.configurationtype &&
106
+ connect_id == o.connect_id &&
107
+ enabled == o.enabled &&
108
+ has_access == o.has_access &&
109
+ sender_searchable_items == o.sender_searchable_items
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Fixnum] Hash code
120
+ def hash
121
+ [configurationtype, connect_id, enabled, has_access, sender_searchable_items].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ self.class.swagger_types.each_pair do |key, type|
130
+ if type =~ /\AArray<(.*)>/i
131
+ # check to ensure the input is an array given that the the attribute
132
+ # is documented as an array but the input is not
133
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
134
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
135
+ end
136
+ elsif !attributes[self.class.attribute_map[key]].nil?
137
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
138
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
139
+ end
140
+
141
+ self
142
+ end
143
+
144
+ # Deserializes the data based on type
145
+ # @param string type Data type
146
+ # @param string value Value to be deserialized
147
+ # @return [Object] Deserialized data
148
+ def _deserialize(type, value)
149
+ case type.to_sym
150
+ when :DateTime
151
+ DateTime.parse(value)
152
+ when :Date
153
+ Date.parse(value)
154
+ when :String
155
+ value.to_s
156
+ when :Integer
157
+ value.to_i
158
+ when :Float
159
+ value.to_f
160
+ when :BOOLEAN
161
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
162
+ true
163
+ else
164
+ false
165
+ end
166
+ when :Object
167
+ # generic object (usually a Hash), return directly
168
+ value
169
+ when /\AArray<(?<inner_type>.+)>\z/
170
+ inner_type = Regexp.last_match[:inner_type]
171
+ value.map { |v| _deserialize(inner_type, v) }
172
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
173
+ k_type = Regexp.last_match[:k_type]
174
+ v_type = Regexp.last_match[:v_type]
175
+ {}.tap do |hash|
176
+ value.each do |k, v|
177
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
178
+ end
179
+ end
180
+ else # model
181
+ temp_model = DocuSign_eSign.const_get(type).new
182
+ temp_model.build_from_hash(value)
183
+ end
184
+ end
185
+
186
+ # Returns the string representation of the object
187
+ # @return [String] String presentation of the object
188
+ def to_s
189
+ to_hash.to_s
190
+ end
191
+
192
+ # to_body is an alias to to_hash (backward compatibility)
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_body
195
+ to_hash
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = self.send(attr)
204
+ next if value.nil?
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ # Outputs non-array value in the form of hash
211
+ # For object, use to_hash. Otherwise, just return the value
212
+ # @param [Object] value Any valid value
213
+ # @return [Hash] Returns the value in the form of hash
214
+ def _to_hash(value)
215
+ if value.is_a?(Array)
216
+ value.compact.map{ |v| _to_hash(v) }
217
+ elsif value.is_a?(Hash)
218
+ {}.tap do |hash|
219
+ value.each { |k, v| hash[k] = _to_hash(v) }
220
+ end
221
+ elsif value.respond_to? :to_hash
222
+ value.to_hash
223
+ else
224
+ value
225
+ end
226
+ end
227
+
228
+ end
229
+
230
+ end
@@ -0,0 +1,298 @@
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 DirectDebitProcessorInformation
17
+ #
18
+ attr_accessor :bank_branch_code
19
+
20
+ #
21
+ attr_accessor :bank_check_digit
22
+
23
+ #
24
+ attr_accessor :bank_code
25
+
26
+ #
27
+ attr_accessor :bank_name
28
+
29
+ #
30
+ attr_accessor :bank_transfer_account_name
31
+
32
+ #
33
+ attr_accessor :bank_transfer_account_number
34
+
35
+ #
36
+ attr_accessor :bank_transfer_type
37
+
38
+ # Specifies the country associated with the address.
39
+ attr_accessor :country
40
+
41
+ #
42
+ attr_accessor :email
43
+
44
+ # The user's first name. Maximum Length: 50 characters.
45
+ attr_accessor :first_name
46
+
47
+ #
48
+ attr_accessor :i_ban
49
+
50
+ #
51
+ attr_accessor :last_name
52
+
53
+
54
+ # Attribute mapping from ruby-style variable name to JSON key.
55
+ def self.attribute_map
56
+ {
57
+ :'bank_branch_code' => :'bankBranchCode',
58
+ :'bank_check_digit' => :'bankCheckDigit',
59
+ :'bank_code' => :'bankCode',
60
+ :'bank_name' => :'bankName',
61
+ :'bank_transfer_account_name' => :'bankTransferAccountName',
62
+ :'bank_transfer_account_number' => :'bankTransferAccountNumber',
63
+ :'bank_transfer_type' => :'bankTransferType',
64
+ :'country' => :'country',
65
+ :'email' => :'email',
66
+ :'first_name' => :'firstName',
67
+ :'i_ban' => :'iBAN',
68
+ :'last_name' => :'lastName'
69
+ }
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.swagger_types
74
+ {
75
+ :'bank_branch_code' => :'String',
76
+ :'bank_check_digit' => :'String',
77
+ :'bank_code' => :'String',
78
+ :'bank_name' => :'String',
79
+ :'bank_transfer_account_name' => :'String',
80
+ :'bank_transfer_account_number' => :'String',
81
+ :'bank_transfer_type' => :'String',
82
+ :'country' => :'String',
83
+ :'email' => :'String',
84
+ :'first_name' => :'String',
85
+ :'i_ban' => :'String',
86
+ :'last_name' => :'String'
87
+ }
88
+ end
89
+
90
+ # Initializes the object
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ def initialize(attributes = {})
93
+ return unless attributes.is_a?(Hash)
94
+
95
+ # convert string to symbol for hash key
96
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
97
+
98
+ if attributes.has_key?(:'bankBranchCode')
99
+ self.bank_branch_code = attributes[:'bankBranchCode']
100
+ end
101
+
102
+ if attributes.has_key?(:'bankCheckDigit')
103
+ self.bank_check_digit = attributes[:'bankCheckDigit']
104
+ end
105
+
106
+ if attributes.has_key?(:'bankCode')
107
+ self.bank_code = attributes[:'bankCode']
108
+ end
109
+
110
+ if attributes.has_key?(:'bankName')
111
+ self.bank_name = attributes[:'bankName']
112
+ end
113
+
114
+ if attributes.has_key?(:'bankTransferAccountName')
115
+ self.bank_transfer_account_name = attributes[:'bankTransferAccountName']
116
+ end
117
+
118
+ if attributes.has_key?(:'bankTransferAccountNumber')
119
+ self.bank_transfer_account_number = attributes[:'bankTransferAccountNumber']
120
+ end
121
+
122
+ if attributes.has_key?(:'bankTransferType')
123
+ self.bank_transfer_type = attributes[:'bankTransferType']
124
+ end
125
+
126
+ if attributes.has_key?(:'country')
127
+ self.country = attributes[:'country']
128
+ end
129
+
130
+ if attributes.has_key?(:'email')
131
+ self.email = attributes[:'email']
132
+ end
133
+
134
+ if attributes.has_key?(:'firstName')
135
+ self.first_name = attributes[:'firstName']
136
+ end
137
+
138
+ if attributes.has_key?(:'iBAN')
139
+ self.i_ban = attributes[:'iBAN']
140
+ end
141
+
142
+ if attributes.has_key?(:'lastName')
143
+ self.last_name = attributes[:'lastName']
144
+ end
145
+
146
+ end
147
+
148
+ # Show invalid properties with the reasons. Usually used together with valid?
149
+ # @return Array for valid properies with the reasons
150
+ def list_invalid_properties
151
+ invalid_properties = Array.new
152
+ return invalid_properties
153
+ end
154
+
155
+ # Check to see if the all the properties in the model are valid
156
+ # @return true if the model is valid
157
+ def valid?
158
+ return true
159
+ end
160
+
161
+ # Checks equality by comparing each attribute.
162
+ # @param [Object] Object to be compared
163
+ def ==(o)
164
+ return true if self.equal?(o)
165
+ self.class == o.class &&
166
+ bank_branch_code == o.bank_branch_code &&
167
+ bank_check_digit == o.bank_check_digit &&
168
+ bank_code == o.bank_code &&
169
+ bank_name == o.bank_name &&
170
+ bank_transfer_account_name == o.bank_transfer_account_name &&
171
+ bank_transfer_account_number == o.bank_transfer_account_number &&
172
+ bank_transfer_type == o.bank_transfer_type &&
173
+ country == o.country &&
174
+ email == o.email &&
175
+ first_name == o.first_name &&
176
+ i_ban == o.i_ban &&
177
+ last_name == o.last_name
178
+ end
179
+
180
+ # @see the `==` method
181
+ # @param [Object] Object to be compared
182
+ def eql?(o)
183
+ self == o
184
+ end
185
+
186
+ # Calculates hash code according to all attributes.
187
+ # @return [Fixnum] Hash code
188
+ def hash
189
+ [bank_branch_code, bank_check_digit, bank_code, bank_name, bank_transfer_account_name, bank_transfer_account_number, bank_transfer_type, country, email, first_name, i_ban, last_name].hash
190
+ end
191
+
192
+ # Builds the object from hash
193
+ # @param [Hash] attributes Model attributes in the form of hash
194
+ # @return [Object] Returns the model itself
195
+ def build_from_hash(attributes)
196
+ return nil unless attributes.is_a?(Hash)
197
+ self.class.swagger_types.each_pair do |key, type|
198
+ if type =~ /\AArray<(.*)>/i
199
+ # check to ensure the input is an array given that the the attribute
200
+ # is documented as an array but the input is not
201
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
202
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
203
+ end
204
+ elsif !attributes[self.class.attribute_map[key]].nil?
205
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
206
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
207
+ end
208
+
209
+ self
210
+ end
211
+
212
+ # Deserializes the data based on type
213
+ # @param string type Data type
214
+ # @param string value Value to be deserialized
215
+ # @return [Object] Deserialized data
216
+ def _deserialize(type, value)
217
+ case type.to_sym
218
+ when :DateTime
219
+ DateTime.parse(value)
220
+ when :Date
221
+ Date.parse(value)
222
+ when :String
223
+ value.to_s
224
+ when :Integer
225
+ value.to_i
226
+ when :Float
227
+ value.to_f
228
+ when :BOOLEAN
229
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
230
+ true
231
+ else
232
+ false
233
+ end
234
+ when :Object
235
+ # generic object (usually a Hash), return directly
236
+ value
237
+ when /\AArray<(?<inner_type>.+)>\z/
238
+ inner_type = Regexp.last_match[:inner_type]
239
+ value.map { |v| _deserialize(inner_type, v) }
240
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
241
+ k_type = Regexp.last_match[:k_type]
242
+ v_type = Regexp.last_match[:v_type]
243
+ {}.tap do |hash|
244
+ value.each do |k, v|
245
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
246
+ end
247
+ end
248
+ else # model
249
+ temp_model = DocuSign_eSign.const_get(type).new
250
+ temp_model.build_from_hash(value)
251
+ end
252
+ end
253
+
254
+ # Returns the string representation of the object
255
+ # @return [String] String presentation of the object
256
+ def to_s
257
+ to_hash.to_s
258
+ end
259
+
260
+ # to_body is an alias to to_hash (backward compatibility)
261
+ # @return [Hash] Returns the object in the form of hash
262
+ def to_body
263
+ to_hash
264
+ end
265
+
266
+ # Returns the object in the form of hash
267
+ # @return [Hash] Returns the object in the form of hash
268
+ def to_hash
269
+ hash = {}
270
+ self.class.attribute_map.each_pair do |attr, param|
271
+ value = self.send(attr)
272
+ next if value.nil?
273
+ hash[param] = _to_hash(value)
274
+ end
275
+ hash
276
+ end
277
+
278
+ # Outputs non-array value in the form of hash
279
+ # For object, use to_hash. Otherwise, just return the value
280
+ # @param [Object] value Any valid value
281
+ # @return [Hash] Returns the value in the form of hash
282
+ def _to_hash(value)
283
+ if value.is_a?(Array)
284
+ value.compact.map{ |v| _to_hash(v) }
285
+ elsif value.is_a?(Hash)
286
+ {}.tap do |hash|
287
+ value.each { |k, v| hash[k] = _to_hash(v) }
288
+ end
289
+ elsif value.respond_to? :to_hash
290
+ value.to_hash
291
+ else
292
+ value
293
+ end
294
+ end
295
+
296
+ end
297
+
298
+ end