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.
- checksums.yaml +4 -4
- data/Gemfile.lock +73 -0
- data/docusign_esign-2.6.0.rc1.gem +0 -0
- data/lib/docusign_esign.rb +24 -0
- data/lib/docusign_esign/.DS_Store +0 -0
- data/lib/docusign_esign/api/.DS_Store +0 -0
- data/lib/docusign_esign/api/accounts_api.rb +362 -0
- data/lib/docusign_esign/api/bulk_envelopes_api.rb +126 -4
- data/lib/docusign_esign/api/envelopes_api.rb +320 -0
- data/lib/docusign_esign/client/.DS_Store +0 -0
- data/lib/docusign_esign/models/account_settings_information.rb +11 -1
- data/lib/docusign_esign/models/bulk_send_batch_status.rb +287 -0
- data/lib/docusign_esign/models/bulk_send_batch_summaries.rb +277 -0
- data/lib/docusign_esign/models/bulk_send_batch_summary.rb +255 -0
- data/lib/docusign_esign/models/bulk_send_error_status.rb +207 -0
- data/lib/docusign_esign/models/conditional_recipient_rule.rb +216 -0
- data/lib/docusign_esign/models/conditional_recipient_rule_condition.rb +207 -0
- data/lib/docusign_esign/models/conditional_recipient_rule_filter.rb +235 -0
- data/lib/docusign_esign/models/e_note_configuration.rb +11 -1
- data/lib/docusign_esign/models/envelope.rb +13 -4
- data/lib/docusign_esign/models/envelope_definition.rb +13 -4
- data/lib/docusign_esign/models/envelope_template.rb +13 -4
- data/lib/docusign_esign/models/new_user.rb +11 -1
- data/lib/docusign_esign/models/proof_service_resource_token.rb +14 -4
- data/lib/docusign_esign/models/recipient_additional_notification.rb +14 -4
- data/lib/docusign_esign/models/recipient_group.rb +207 -0
- data/lib/docusign_esign/models/recipient_option.rb +225 -0
- data/lib/docusign_esign/models/recipient_routing.rb +184 -0
- data/lib/docusign_esign/models/recipient_rules.rb +187 -0
- data/lib/docusign_esign/models/report_in_product_csv_run_request.rb +437 -0
- data/lib/docusign_esign/models/report_in_product_field.rb +215 -0
- data/lib/docusign_esign/models/report_in_product_get.rb +466 -0
- data/lib/docusign_esign/models/report_in_product_list.rb +187 -0
- data/lib/docusign_esign/models/report_in_product_list_item.rb +315 -0
- data/lib/docusign_esign/models/report_in_product_run_request.rb +397 -0
- data/lib/docusign_esign/models/report_in_product_run_response.rb +247 -0
- data/lib/docusign_esign/models/report_in_product_run_response_row.rb +194 -0
- data/lib/docusign_esign/models/report_in_product_run_response_row_fields.rb +1395 -0
- data/lib/docusign_esign/models/report_in_product_save_response.rb +185 -0
- data/lib/docusign_esign/models/report_in_product_sent_by_details.rb +199 -0
- data/lib/docusign_esign/models/sender_email_notifications.rb +11 -1
- data/lib/docusign_esign/models/tab_metadata.rb +21 -1
- data/lib/docusign_esign/models/workflow.rb +207 -0
- data/lib/docusign_esign/models/workflow_step.rb +254 -0
- data/lib/docusign_esign/version.rb +1 -1
- data/tests/Gemfile.lock +3 -3
- metadata +33 -7
- data/docusign_esign-2.4.0.gem +0 -0
- data/docusign_esign-2.5.0.rc1.gem +0 -0
- data/docusign_esign-3.4.0.rc1.gem +0 -0
@@ -0,0 +1,187 @@
|
|
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 ReportInProductList
|
17
|
+
#
|
18
|
+
attr_accessor :reports
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'reports' => :'reports'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Attribute type mapping.
|
28
|
+
def self.swagger_types
|
29
|
+
{
|
30
|
+
:'reports' => :'Array<ReportInProductListItem>'
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# Initializes the object
|
35
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
36
|
+
def initialize(attributes = {})
|
37
|
+
return unless attributes.is_a?(Hash)
|
38
|
+
|
39
|
+
# convert string to symbol for hash key
|
40
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
41
|
+
|
42
|
+
if attributes.has_key?(:'reports')
|
43
|
+
if (value = attributes[:'reports']).is_a?(Array)
|
44
|
+
self.reports = value
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
50
|
+
# @return Array for valid properties with the reasons
|
51
|
+
def list_invalid_properties
|
52
|
+
invalid_properties = Array.new
|
53
|
+
invalid_properties
|
54
|
+
end
|
55
|
+
|
56
|
+
# Check to see if the all the properties in the model are valid
|
57
|
+
# @return true if the model is valid
|
58
|
+
def valid?
|
59
|
+
true
|
60
|
+
end
|
61
|
+
|
62
|
+
# Checks equality by comparing each attribute.
|
63
|
+
# @param [Object] Object to be compared
|
64
|
+
def ==(o)
|
65
|
+
return true if self.equal?(o)
|
66
|
+
self.class == o.class &&
|
67
|
+
reports == o.reports
|
68
|
+
end
|
69
|
+
|
70
|
+
# @see the `==` method
|
71
|
+
# @param [Object] Object to be compared
|
72
|
+
def eql?(o)
|
73
|
+
self == o
|
74
|
+
end
|
75
|
+
|
76
|
+
# Calculates hash code according to all attributes.
|
77
|
+
# @return [Fixnum] Hash code
|
78
|
+
def hash
|
79
|
+
[reports].hash
|
80
|
+
end
|
81
|
+
|
82
|
+
# Builds the object from hash
|
83
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
84
|
+
# @return [Object] Returns the model itself
|
85
|
+
def build_from_hash(attributes)
|
86
|
+
return nil unless attributes.is_a?(Hash)
|
87
|
+
self.class.swagger_types.each_pair do |key, type|
|
88
|
+
if type =~ /\AArray<(.*)>/i
|
89
|
+
# check to ensure the input is an array given that the attribute
|
90
|
+
# is documented as an array but the input is not
|
91
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
92
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
93
|
+
end
|
94
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
95
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
96
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
97
|
+
end
|
98
|
+
|
99
|
+
self
|
100
|
+
end
|
101
|
+
|
102
|
+
# Deserializes the data based on type
|
103
|
+
# @param string type Data type
|
104
|
+
# @param string value Value to be deserialized
|
105
|
+
# @return [Object] Deserialized data
|
106
|
+
def _deserialize(type, value)
|
107
|
+
case type.to_sym
|
108
|
+
when :DateTime
|
109
|
+
DateTime.parse(value)
|
110
|
+
when :Date
|
111
|
+
Date.parse(value)
|
112
|
+
when :String
|
113
|
+
value.to_s
|
114
|
+
when :Integer
|
115
|
+
value.to_i
|
116
|
+
when :Float
|
117
|
+
value.to_f
|
118
|
+
when :BOOLEAN
|
119
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
120
|
+
true
|
121
|
+
else
|
122
|
+
false
|
123
|
+
end
|
124
|
+
when :Object
|
125
|
+
# generic object (usually a Hash), return directly
|
126
|
+
value
|
127
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
128
|
+
inner_type = Regexp.last_match[:inner_type]
|
129
|
+
value.map { |v| _deserialize(inner_type, v) }
|
130
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
131
|
+
k_type = Regexp.last_match[:k_type]
|
132
|
+
v_type = Regexp.last_match[:v_type]
|
133
|
+
{}.tap do |hash|
|
134
|
+
value.each do |k, v|
|
135
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
136
|
+
end
|
137
|
+
end
|
138
|
+
else # model
|
139
|
+
temp_model = DocuSign_eSign.const_get(type).new
|
140
|
+
temp_model.build_from_hash(value)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
# Returns the string representation of the object
|
145
|
+
# @return [String] String presentation of the object
|
146
|
+
def to_s
|
147
|
+
to_hash.to_s
|
148
|
+
end
|
149
|
+
|
150
|
+
# to_body is an alias to to_hash (backward compatibility)
|
151
|
+
# @return [Hash] Returns the object in the form of hash
|
152
|
+
def to_body
|
153
|
+
to_hash
|
154
|
+
end
|
155
|
+
|
156
|
+
# Returns the object in the form of hash
|
157
|
+
# @return [Hash] Returns the object in the form of hash
|
158
|
+
def to_hash
|
159
|
+
hash = {}
|
160
|
+
self.class.attribute_map.each_pair do |attr, param|
|
161
|
+
value = self.send(attr)
|
162
|
+
next if value.nil?
|
163
|
+
hash[param] = _to_hash(value)
|
164
|
+
end
|
165
|
+
hash
|
166
|
+
end
|
167
|
+
|
168
|
+
# Outputs non-array value in the form of hash
|
169
|
+
# For object, use to_hash. Otherwise, just return the value
|
170
|
+
# @param [Object] value Any valid value
|
171
|
+
# @return [Hash] Returns the value in the form of hash
|
172
|
+
def _to_hash(value)
|
173
|
+
if value.is_a?(Array)
|
174
|
+
value.compact.map { |v| _to_hash(v) }
|
175
|
+
elsif value.is_a?(Hash)
|
176
|
+
{}.tap do |hash|
|
177
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
178
|
+
end
|
179
|
+
elsif value.respond_to? :to_hash
|
180
|
+
value.to_hash
|
181
|
+
else
|
182
|
+
value
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
end
|
187
|
+
end
|
@@ -0,0 +1,315 @@
|
|
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 ReportInProductListItem
|
17
|
+
#
|
18
|
+
attr_accessor :get_uri
|
19
|
+
|
20
|
+
#
|
21
|
+
attr_accessor :last_scheduled_execution_date
|
22
|
+
|
23
|
+
#
|
24
|
+
attr_accessor :last_scheduled_execution_success_date
|
25
|
+
|
26
|
+
#
|
27
|
+
attr_accessor :report_customized_id
|
28
|
+
|
29
|
+
#
|
30
|
+
attr_accessor :report_description
|
31
|
+
|
32
|
+
#
|
33
|
+
attr_accessor :report_id
|
34
|
+
|
35
|
+
#
|
36
|
+
attr_accessor :report_name
|
37
|
+
|
38
|
+
#
|
39
|
+
attr_accessor :report_type
|
40
|
+
|
41
|
+
#
|
42
|
+
attr_accessor :run_uri
|
43
|
+
|
44
|
+
#
|
45
|
+
attr_accessor :save_uri
|
46
|
+
|
47
|
+
#
|
48
|
+
attr_accessor :schedule_create_date
|
49
|
+
|
50
|
+
#
|
51
|
+
attr_accessor :schedule_end_date
|
52
|
+
|
53
|
+
#
|
54
|
+
attr_accessor :schedule_id
|
55
|
+
|
56
|
+
#
|
57
|
+
attr_accessor :schedule_renew_duration_days
|
58
|
+
|
59
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
60
|
+
def self.attribute_map
|
61
|
+
{
|
62
|
+
:'get_uri' => :'getUri',
|
63
|
+
:'last_scheduled_execution_date' => :'lastScheduledExecutionDate',
|
64
|
+
:'last_scheduled_execution_success_date' => :'lastScheduledExecutionSuccessDate',
|
65
|
+
:'report_customized_id' => :'reportCustomizedId',
|
66
|
+
:'report_description' => :'reportDescription',
|
67
|
+
:'report_id' => :'reportId',
|
68
|
+
:'report_name' => :'reportName',
|
69
|
+
:'report_type' => :'reportType',
|
70
|
+
:'run_uri' => :'runUri',
|
71
|
+
:'save_uri' => :'saveUri',
|
72
|
+
:'schedule_create_date' => :'scheduleCreateDate',
|
73
|
+
:'schedule_end_date' => :'scheduleEndDate',
|
74
|
+
:'schedule_id' => :'scheduleId',
|
75
|
+
:'schedule_renew_duration_days' => :'scheduleRenewDurationDays'
|
76
|
+
}
|
77
|
+
end
|
78
|
+
|
79
|
+
# Attribute type mapping.
|
80
|
+
def self.swagger_types
|
81
|
+
{
|
82
|
+
:'get_uri' => :'String',
|
83
|
+
:'last_scheduled_execution_date' => :'String',
|
84
|
+
:'last_scheduled_execution_success_date' => :'String',
|
85
|
+
:'report_customized_id' => :'String',
|
86
|
+
:'report_description' => :'String',
|
87
|
+
:'report_id' => :'String',
|
88
|
+
:'report_name' => :'String',
|
89
|
+
:'report_type' => :'String',
|
90
|
+
:'run_uri' => :'String',
|
91
|
+
:'save_uri' => :'String',
|
92
|
+
:'schedule_create_date' => :'String',
|
93
|
+
:'schedule_end_date' => :'String',
|
94
|
+
:'schedule_id' => :'String',
|
95
|
+
:'schedule_renew_duration_days' => :'String'
|
96
|
+
}
|
97
|
+
end
|
98
|
+
|
99
|
+
# Initializes the object
|
100
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
101
|
+
def initialize(attributes = {})
|
102
|
+
return unless attributes.is_a?(Hash)
|
103
|
+
|
104
|
+
# convert string to symbol for hash key
|
105
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
106
|
+
|
107
|
+
if attributes.has_key?(:'getUri')
|
108
|
+
self.get_uri = attributes[:'getUri']
|
109
|
+
end
|
110
|
+
|
111
|
+
if attributes.has_key?(:'lastScheduledExecutionDate')
|
112
|
+
self.last_scheduled_execution_date = attributes[:'lastScheduledExecutionDate']
|
113
|
+
end
|
114
|
+
|
115
|
+
if attributes.has_key?(:'lastScheduledExecutionSuccessDate')
|
116
|
+
self.last_scheduled_execution_success_date = attributes[:'lastScheduledExecutionSuccessDate']
|
117
|
+
end
|
118
|
+
|
119
|
+
if attributes.has_key?(:'reportCustomizedId')
|
120
|
+
self.report_customized_id = attributes[:'reportCustomizedId']
|
121
|
+
end
|
122
|
+
|
123
|
+
if attributes.has_key?(:'reportDescription')
|
124
|
+
self.report_description = attributes[:'reportDescription']
|
125
|
+
end
|
126
|
+
|
127
|
+
if attributes.has_key?(:'reportId')
|
128
|
+
self.report_id = attributes[:'reportId']
|
129
|
+
end
|
130
|
+
|
131
|
+
if attributes.has_key?(:'reportName')
|
132
|
+
self.report_name = attributes[:'reportName']
|
133
|
+
end
|
134
|
+
|
135
|
+
if attributes.has_key?(:'reportType')
|
136
|
+
self.report_type = attributes[:'reportType']
|
137
|
+
end
|
138
|
+
|
139
|
+
if attributes.has_key?(:'runUri')
|
140
|
+
self.run_uri = attributes[:'runUri']
|
141
|
+
end
|
142
|
+
|
143
|
+
if attributes.has_key?(:'saveUri')
|
144
|
+
self.save_uri = attributes[:'saveUri']
|
145
|
+
end
|
146
|
+
|
147
|
+
if attributes.has_key?(:'scheduleCreateDate')
|
148
|
+
self.schedule_create_date = attributes[:'scheduleCreateDate']
|
149
|
+
end
|
150
|
+
|
151
|
+
if attributes.has_key?(:'scheduleEndDate')
|
152
|
+
self.schedule_end_date = attributes[:'scheduleEndDate']
|
153
|
+
end
|
154
|
+
|
155
|
+
if attributes.has_key?(:'scheduleId')
|
156
|
+
self.schedule_id = attributes[:'scheduleId']
|
157
|
+
end
|
158
|
+
|
159
|
+
if attributes.has_key?(:'scheduleRenewDurationDays')
|
160
|
+
self.schedule_renew_duration_days = attributes[:'scheduleRenewDurationDays']
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
165
|
+
# @return Array for valid properties with the reasons
|
166
|
+
def list_invalid_properties
|
167
|
+
invalid_properties = Array.new
|
168
|
+
invalid_properties
|
169
|
+
end
|
170
|
+
|
171
|
+
# Check to see if the all the properties in the model are valid
|
172
|
+
# @return true if the model is valid
|
173
|
+
def valid?
|
174
|
+
true
|
175
|
+
end
|
176
|
+
|
177
|
+
# Checks equality by comparing each attribute.
|
178
|
+
# @param [Object] Object to be compared
|
179
|
+
def ==(o)
|
180
|
+
return true if self.equal?(o)
|
181
|
+
self.class == o.class &&
|
182
|
+
get_uri == o.get_uri &&
|
183
|
+
last_scheduled_execution_date == o.last_scheduled_execution_date &&
|
184
|
+
last_scheduled_execution_success_date == o.last_scheduled_execution_success_date &&
|
185
|
+
report_customized_id == o.report_customized_id &&
|
186
|
+
report_description == o.report_description &&
|
187
|
+
report_id == o.report_id &&
|
188
|
+
report_name == o.report_name &&
|
189
|
+
report_type == o.report_type &&
|
190
|
+
run_uri == o.run_uri &&
|
191
|
+
save_uri == o.save_uri &&
|
192
|
+
schedule_create_date == o.schedule_create_date &&
|
193
|
+
schedule_end_date == o.schedule_end_date &&
|
194
|
+
schedule_id == o.schedule_id &&
|
195
|
+
schedule_renew_duration_days == o.schedule_renew_duration_days
|
196
|
+
end
|
197
|
+
|
198
|
+
# @see the `==` method
|
199
|
+
# @param [Object] Object to be compared
|
200
|
+
def eql?(o)
|
201
|
+
self == o
|
202
|
+
end
|
203
|
+
|
204
|
+
# Calculates hash code according to all attributes.
|
205
|
+
# @return [Fixnum] Hash code
|
206
|
+
def hash
|
207
|
+
[get_uri, last_scheduled_execution_date, last_scheduled_execution_success_date, report_customized_id, report_description, report_id, report_name, report_type, run_uri, save_uri, schedule_create_date, schedule_end_date, schedule_id, schedule_renew_duration_days].hash
|
208
|
+
end
|
209
|
+
|
210
|
+
# Builds the object from hash
|
211
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
212
|
+
# @return [Object] Returns the model itself
|
213
|
+
def build_from_hash(attributes)
|
214
|
+
return nil unless attributes.is_a?(Hash)
|
215
|
+
self.class.swagger_types.each_pair do |key, type|
|
216
|
+
if type =~ /\AArray<(.*)>/i
|
217
|
+
# check to ensure the input is an array given that the attribute
|
218
|
+
# is documented as an array but the input is not
|
219
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
220
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
221
|
+
end
|
222
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
223
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
224
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
225
|
+
end
|
226
|
+
|
227
|
+
self
|
228
|
+
end
|
229
|
+
|
230
|
+
# Deserializes the data based on type
|
231
|
+
# @param string type Data type
|
232
|
+
# @param string value Value to be deserialized
|
233
|
+
# @return [Object] Deserialized data
|
234
|
+
def _deserialize(type, value)
|
235
|
+
case type.to_sym
|
236
|
+
when :DateTime
|
237
|
+
DateTime.parse(value)
|
238
|
+
when :Date
|
239
|
+
Date.parse(value)
|
240
|
+
when :String
|
241
|
+
value.to_s
|
242
|
+
when :Integer
|
243
|
+
value.to_i
|
244
|
+
when :Float
|
245
|
+
value.to_f
|
246
|
+
when :BOOLEAN
|
247
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
248
|
+
true
|
249
|
+
else
|
250
|
+
false
|
251
|
+
end
|
252
|
+
when :Object
|
253
|
+
# generic object (usually a Hash), return directly
|
254
|
+
value
|
255
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
256
|
+
inner_type = Regexp.last_match[:inner_type]
|
257
|
+
value.map { |v| _deserialize(inner_type, v) }
|
258
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
259
|
+
k_type = Regexp.last_match[:k_type]
|
260
|
+
v_type = Regexp.last_match[:v_type]
|
261
|
+
{}.tap do |hash|
|
262
|
+
value.each do |k, v|
|
263
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
264
|
+
end
|
265
|
+
end
|
266
|
+
else # model
|
267
|
+
temp_model = DocuSign_eSign.const_get(type).new
|
268
|
+
temp_model.build_from_hash(value)
|
269
|
+
end
|
270
|
+
end
|
271
|
+
|
272
|
+
# Returns the string representation of the object
|
273
|
+
# @return [String] String presentation of the object
|
274
|
+
def to_s
|
275
|
+
to_hash.to_s
|
276
|
+
end
|
277
|
+
|
278
|
+
# to_body is an alias to to_hash (backward compatibility)
|
279
|
+
# @return [Hash] Returns the object in the form of hash
|
280
|
+
def to_body
|
281
|
+
to_hash
|
282
|
+
end
|
283
|
+
|
284
|
+
# Returns the object in the form of hash
|
285
|
+
# @return [Hash] Returns the object in the form of hash
|
286
|
+
def to_hash
|
287
|
+
hash = {}
|
288
|
+
self.class.attribute_map.each_pair do |attr, param|
|
289
|
+
value = self.send(attr)
|
290
|
+
next if value.nil?
|
291
|
+
hash[param] = _to_hash(value)
|
292
|
+
end
|
293
|
+
hash
|
294
|
+
end
|
295
|
+
|
296
|
+
# Outputs non-array value in the form of hash
|
297
|
+
# For object, use to_hash. Otherwise, just return the value
|
298
|
+
# @param [Object] value Any valid value
|
299
|
+
# @return [Hash] Returns the value in the form of hash
|
300
|
+
def _to_hash(value)
|
301
|
+
if value.is_a?(Array)
|
302
|
+
value.compact.map { |v| _to_hash(v) }
|
303
|
+
elsif value.is_a?(Hash)
|
304
|
+
{}.tap do |hash|
|
305
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
306
|
+
end
|
307
|
+
elsif value.respond_to? :to_hash
|
308
|
+
value.to_hash
|
309
|
+
else
|
310
|
+
value
|
311
|
+
end
|
312
|
+
end
|
313
|
+
|
314
|
+
end
|
315
|
+
end
|