docusign_rooms 1.2.0.rc1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +5 -0
  3. data/docusign_rooms.gemspec +9 -7
  4. data/lib/docusign_rooms/api/accounts_api.rb +1 -1
  5. data/lib/docusign_rooms/api/activity_types_api.rb +3 -3
  6. data/lib/docusign_rooms/api/closing_statuses_api.rb +1 -1
  7. data/lib/docusign_rooms/api/contact_sides_api.rb +1 -1
  8. data/lib/docusign_rooms/api/countries_api.rb +1 -1
  9. data/lib/docusign_rooms/api/currencies_api.rb +1 -1
  10. data/lib/docusign_rooms/api/documents_api.rb +6 -6
  11. data/lib/docusign_rooms/api/e_sign_permission_profiles_api.rb +1 -1
  12. data/lib/docusign_rooms/api/external_form_fill_sessions_api.rb +6 -6
  13. data/lib/docusign_rooms/api/fields_api.rb +1 -1
  14. data/lib/docusign_rooms/api/financing_types_api.rb +1 -1
  15. data/lib/docusign_rooms/api/form_details_api.rb +1 -1
  16. data/lib/docusign_rooms/api/form_group_forms_api.rb +95 -0
  17. data/lib/docusign_rooms/api/form_groups_api.rb +18 -18
  18. data/lib/docusign_rooms/api/form_libraries_api.rb +2 -2
  19. data/lib/docusign_rooms/api/form_provider_associations_api.rb +95 -0
  20. data/lib/docusign_rooms/api/offices_api.rb +12 -12
  21. data/lib/docusign_rooms/api/origins_of_leads_api.rb +1 -1
  22. data/lib/docusign_rooms/api/property_types_api.rb +1 -1
  23. data/lib/docusign_rooms/api/regions_api.rb +8 -8
  24. data/lib/docusign_rooms/api/roles_api.rb +11 -14
  25. data/lib/docusign_rooms/api/room_contact_types_api.rb +1 -1
  26. data/lib/docusign_rooms/api/room_envelopes_api.rb +81 -0
  27. data/lib/docusign_rooms/api/room_folders_api.rb +1 -1
  28. data/lib/docusign_rooms/api/room_templates_api.rb +1 -1
  29. data/lib/docusign_rooms/api/rooms_api.rb +36 -42
  30. data/lib/docusign_rooms/api/seller_decision_types_api.rb +1 -1
  31. data/lib/docusign_rooms/api/special_circumstance_types_api.rb +1 -1
  32. data/lib/docusign_rooms/api/states_api.rb +1 -1
  33. data/lib/docusign_rooms/api/task_date_types_api.rb +1 -1
  34. data/lib/docusign_rooms/api/task_list_templates_api.rb +1 -1
  35. data/lib/docusign_rooms/api/task_lists_api.rb +5 -5
  36. data/lib/docusign_rooms/api/task_responsibility_types_api.rb +1 -1
  37. data/lib/docusign_rooms/api/task_statuses_api.rb +1 -1
  38. data/lib/docusign_rooms/api/time_zones_api.rb +1 -1
  39. data/lib/docusign_rooms/api/transaction_sides_api.rb +1 -1
  40. data/lib/docusign_rooms/api/users_api.rb +34 -202
  41. data/lib/docusign_rooms/client/api_client.rb +14 -10
  42. data/lib/docusign_rooms/client/api_error.rb +2 -2
  43. data/lib/docusign_rooms/client/auth/oauth.rb +1 -1
  44. data/lib/docusign_rooms/models/account_summary.rb +35 -1
  45. data/lib/docusign_rooms/models/api_error.rb +13 -4
  46. data/lib/docusign_rooms/models/envelope.rb +183 -0
  47. data/lib/docusign_rooms/models/envelope_for_create.rb +194 -0
  48. data/lib/docusign_rooms/models/external_form_fill_session_for_create.rb +12 -6
  49. data/lib/docusign_rooms/models/form_group_form.rb +210 -0
  50. data/lib/docusign_rooms/models/form_group_form_list.rb +239 -0
  51. data/lib/docusign_rooms/models/form_provider_association_summary.rb +219 -0
  52. data/lib/docusign_rooms/models/form_provider_associations_summary_list.rb +239 -0
  53. data/lib/docusign_rooms/models/form_summary.rb +13 -4
  54. data/lib/docusign_rooms/models/group_form.rb +13 -4
  55. data/lib/docusign_rooms/models/listing_type.rb +29 -0
  56. data/lib/docusign_rooms/models/permissions.rb +49 -4
  57. data/lib/docusign_rooms/models/room.rb +21 -1
  58. data/lib/docusign_rooms/models/room_for_create.rb +47 -4
  59. data/lib/docusign_rooms/models/user.rb +35 -1
  60. data/lib/docusign_rooms/models/user_summary.rb +35 -1
  61. data/lib/docusign_rooms/models/user_to_invite.rb +47 -2
  62. data/lib/docusign_rooms/version.rb +1 -1
  63. data/lib/docusign_rooms.rb +10 -3
  64. metadata +115 -89
@@ -0,0 +1,183 @@
1
+ =begin
2
+ #DocuSign Rooms API - v2
3
+
4
+ #An API for an integrator to access the features of DocuSign Rooms
5
+
6
+ OpenAPI spec version: v2
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_Rooms
15
+ class Envelope
16
+ attr_accessor :e_sign_envelope_id
17
+
18
+ # Attribute mapping from ruby-style variable name to JSON key.
19
+ def self.attribute_map
20
+ {
21
+ :'e_sign_envelope_id' => :'eSignEnvelopeId'
22
+ }
23
+ end
24
+
25
+ # Attribute type mapping.
26
+ def self.swagger_types
27
+ {
28
+ :'e_sign_envelope_id' => :'String'
29
+ }
30
+ end
31
+
32
+ # Initializes the object
33
+ # @param [Hash] attributes Model attributes in the form of hash
34
+ def initialize(attributes = {})
35
+ return unless attributes.is_a?(Hash)
36
+
37
+ # convert string to symbol for hash key
38
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
39
+
40
+ if attributes.has_key?(:'eSignEnvelopeId')
41
+ self.e_sign_envelope_id = attributes[:'eSignEnvelopeId']
42
+ end
43
+ end
44
+
45
+ # Show invalid properties with the reasons. Usually used together with valid?
46
+ # @return Array for valid properties with the reasons
47
+ def list_invalid_properties
48
+ invalid_properties = Array.new
49
+ invalid_properties
50
+ end
51
+
52
+ # Check to see if the all the properties in the model are valid
53
+ # @return true if the model is valid
54
+ def valid?
55
+ true
56
+ end
57
+
58
+ # Checks equality by comparing each attribute.
59
+ # @param [Object] Object to be compared
60
+ def ==(o)
61
+ return true if self.equal?(o)
62
+ self.class == o.class &&
63
+ e_sign_envelope_id == o.e_sign_envelope_id
64
+ end
65
+
66
+ # @see the `==` method
67
+ # @param [Object] Object to be compared
68
+ def eql?(o)
69
+ self == o
70
+ end
71
+
72
+ # Calculates hash code according to all attributes.
73
+ # @return [Fixnum] Hash code
74
+ def hash
75
+ [e_sign_envelope_id].hash
76
+ end
77
+
78
+ # Builds the object from hash
79
+ # @param [Hash] attributes Model attributes in the form of hash
80
+ # @return [Object] Returns the model itself
81
+ def build_from_hash(attributes)
82
+ return nil unless attributes.is_a?(Hash)
83
+ self.class.swagger_types.each_pair do |key, type|
84
+ if type =~ /\AArray<(.*)>/i
85
+ # check to ensure the input is an array given that the attribute
86
+ # is documented as an array but the input is not
87
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
88
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
89
+ end
90
+ elsif !attributes[self.class.attribute_map[key]].nil?
91
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
92
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
93
+ end
94
+
95
+ self
96
+ end
97
+
98
+ # Deserializes the data based on type
99
+ # @param string type Data type
100
+ # @param string value Value to be deserialized
101
+ # @return [Object] Deserialized data
102
+ def _deserialize(type, value)
103
+ case type.to_sym
104
+ when :DateTime
105
+ DateTime.parse(value)
106
+ when :Date
107
+ Date.parse(value)
108
+ when :String
109
+ value.to_s
110
+ when :Integer
111
+ value.to_i
112
+ when :Float
113
+ value.to_f
114
+ when :BOOLEAN
115
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
116
+ true
117
+ else
118
+ false
119
+ end
120
+ when :Object
121
+ # generic object (usually a Hash), return directly
122
+ value
123
+ when /\AArray<(?<inner_type>.+)>\z/
124
+ inner_type = Regexp.last_match[:inner_type]
125
+ value.map { |v| _deserialize(inner_type, v) }
126
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
127
+ k_type = Regexp.last_match[:k_type]
128
+ v_type = Regexp.last_match[:v_type]
129
+ {}.tap do |hash|
130
+ value.each do |k, v|
131
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
132
+ end
133
+ end
134
+ else # model
135
+ temp_model = DocuSign_Rooms.const_get(type).new
136
+ temp_model.build_from_hash(value)
137
+ end
138
+ end
139
+
140
+ # Returns the string representation of the object
141
+ # @return [String] String presentation of the object
142
+ def to_s
143
+ to_hash.to_s
144
+ end
145
+
146
+ # to_body is an alias to to_hash (backward compatibility)
147
+ # @return [Hash] Returns the object in the form of hash
148
+ def to_body
149
+ to_hash
150
+ end
151
+
152
+ # Returns the object in the form of hash
153
+ # @return [Hash] Returns the object in the form of hash
154
+ def to_hash
155
+ hash = {}
156
+ self.class.attribute_map.each_pair do |attr, param|
157
+ value = self.send(attr)
158
+ next if value.nil?
159
+ hash[param] = _to_hash(value)
160
+ end
161
+ hash
162
+ end
163
+
164
+ # Outputs non-array value in the form of hash
165
+ # For object, use to_hash. Otherwise, just return the value
166
+ # @param [Object] value Any valid value
167
+ # @return [Hash] Returns the value in the form of hash
168
+ def _to_hash(value)
169
+ if value.is_a?(Array)
170
+ value.compact.map { |v| _to_hash(v) }
171
+ elsif value.is_a?(Hash)
172
+ {}.tap do |hash|
173
+ value.each { |k, v| hash[k] = _to_hash(v) }
174
+ end
175
+ elsif value.respond_to? :to_hash
176
+ value.to_hash
177
+ else
178
+ value
179
+ end
180
+ end
181
+
182
+ end
183
+ end
@@ -0,0 +1,194 @@
1
+ =begin
2
+ #DocuSign Rooms API - v2
3
+
4
+ #An API for an integrator to access the features of DocuSign Rooms
5
+
6
+ OpenAPI spec version: v2
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_Rooms
15
+ class EnvelopeForCreate
16
+ attr_accessor :envelope_name
17
+
18
+ attr_accessor :document_ids
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'envelope_name' => :'envelopeName',
24
+ :'document_ids' => :'documentIds'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.swagger_types
30
+ {
31
+ :'envelope_name' => :'String',
32
+ :'document_ids' => :'Array<Integer>'
33
+ }
34
+ end
35
+
36
+ # Initializes the object
37
+ # @param [Hash] attributes Model attributes in the form of hash
38
+ def initialize(attributes = {})
39
+ return unless attributes.is_a?(Hash)
40
+
41
+ # convert string to symbol for hash key
42
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
43
+
44
+ if attributes.has_key?(:'envelopeName')
45
+ self.envelope_name = attributes[:'envelopeName']
46
+ end
47
+
48
+ if attributes.has_key?(:'documentIds')
49
+ if (value = attributes[:'documentIds']).is_a?(Array)
50
+ self.document_ids = value
51
+ end
52
+ end
53
+ end
54
+
55
+ # Show invalid properties with the reasons. Usually used together with valid?
56
+ # @return Array for valid properties with the reasons
57
+ def list_invalid_properties
58
+ invalid_properties = Array.new
59
+ invalid_properties
60
+ end
61
+
62
+ # Check to see if the all the properties in the model are valid
63
+ # @return true if the model is valid
64
+ def valid?
65
+ true
66
+ end
67
+
68
+ # Checks equality by comparing each attribute.
69
+ # @param [Object] Object to be compared
70
+ def ==(o)
71
+ return true if self.equal?(o)
72
+ self.class == o.class &&
73
+ envelope_name == o.envelope_name &&
74
+ document_ids == o.document_ids
75
+ end
76
+
77
+ # @see the `==` method
78
+ # @param [Object] Object to be compared
79
+ def eql?(o)
80
+ self == o
81
+ end
82
+
83
+ # Calculates hash code according to all attributes.
84
+ # @return [Fixnum] Hash code
85
+ def hash
86
+ [envelope_name, document_ids].hash
87
+ end
88
+
89
+ # Builds the object from hash
90
+ # @param [Hash] attributes Model attributes in the form of hash
91
+ # @return [Object] Returns the model itself
92
+ def build_from_hash(attributes)
93
+ return nil unless attributes.is_a?(Hash)
94
+ self.class.swagger_types.each_pair do |key, type|
95
+ if type =~ /\AArray<(.*)>/i
96
+ # check to ensure the input is an array given that the attribute
97
+ # is documented as an array but the input is not
98
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
99
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
100
+ end
101
+ elsif !attributes[self.class.attribute_map[key]].nil?
102
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
103
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
104
+ end
105
+
106
+ self
107
+ end
108
+
109
+ # Deserializes the data based on type
110
+ # @param string type Data type
111
+ # @param string value Value to be deserialized
112
+ # @return [Object] Deserialized data
113
+ def _deserialize(type, value)
114
+ case type.to_sym
115
+ when :DateTime
116
+ DateTime.parse(value)
117
+ when :Date
118
+ Date.parse(value)
119
+ when :String
120
+ value.to_s
121
+ when :Integer
122
+ value.to_i
123
+ when :Float
124
+ value.to_f
125
+ when :BOOLEAN
126
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
127
+ true
128
+ else
129
+ false
130
+ end
131
+ when :Object
132
+ # generic object (usually a Hash), return directly
133
+ value
134
+ when /\AArray<(?<inner_type>.+)>\z/
135
+ inner_type = Regexp.last_match[:inner_type]
136
+ value.map { |v| _deserialize(inner_type, v) }
137
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
138
+ k_type = Regexp.last_match[:k_type]
139
+ v_type = Regexp.last_match[:v_type]
140
+ {}.tap do |hash|
141
+ value.each do |k, v|
142
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
143
+ end
144
+ end
145
+ else # model
146
+ temp_model = DocuSign_Rooms.const_get(type).new
147
+ temp_model.build_from_hash(value)
148
+ end
149
+ end
150
+
151
+ # Returns the string representation of the object
152
+ # @return [String] String presentation of the object
153
+ def to_s
154
+ to_hash.to_s
155
+ end
156
+
157
+ # to_body is an alias to to_hash (backward compatibility)
158
+ # @return [Hash] Returns the object in the form of hash
159
+ def to_body
160
+ to_hash
161
+ end
162
+
163
+ # Returns the object in the form of hash
164
+ # @return [Hash] Returns the object in the form of hash
165
+ def to_hash
166
+ hash = {}
167
+ self.class.attribute_map.each_pair do |attr, param|
168
+ value = self.send(attr)
169
+ next if value.nil?
170
+ hash[param] = _to_hash(value)
171
+ end
172
+ hash
173
+ end
174
+
175
+ # Outputs non-array value in the form of hash
176
+ # For object, use to_hash. Otherwise, just return the value
177
+ # @param [Object] value Any valid value
178
+ # @return [Hash] Returns the value in the form of hash
179
+ def _to_hash(value)
180
+ if value.is_a?(Array)
181
+ value.compact.map { |v| _to_hash(v) }
182
+ elsif value.is_a?(Hash)
183
+ {}.tap do |hash|
184
+ value.each { |k, v| hash[k] = _to_hash(v) }
185
+ end
186
+ elsif value.respond_to? :to_hash
187
+ value.to_hash
188
+ else
189
+ value
190
+ end
191
+ end
192
+
193
+ end
194
+ end
@@ -17,6 +17,8 @@ module DocuSign_Rooms
17
17
 
18
18
  attr_accessor :room_id
19
19
 
20
+ attr_accessor :form_ids
21
+
20
22
  attr_accessor :x_frame_allowed_url
21
23
 
22
24
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -24,6 +26,7 @@ module DocuSign_Rooms
24
26
  {
25
27
  :'form_id' => :'formId',
26
28
  :'room_id' => :'roomId',
29
+ :'form_ids' => :'formIds',
27
30
  :'x_frame_allowed_url' => :'xFrameAllowedUrl'
28
31
  }
29
32
  end
@@ -33,6 +36,7 @@ module DocuSign_Rooms
33
36
  {
34
37
  :'form_id' => :'String',
35
38
  :'room_id' => :'Integer',
39
+ :'form_ids' => :'Array<String>',
36
40
  :'x_frame_allowed_url' => :'String'
37
41
  }
38
42
  end
@@ -53,6 +57,12 @@ module DocuSign_Rooms
53
57
  self.room_id = attributes[:'roomId']
54
58
  end
55
59
 
60
+ if attributes.has_key?(:'formIds')
61
+ if (value = attributes[:'formIds']).is_a?(Array)
62
+ self.form_ids = value
63
+ end
64
+ end
65
+
56
66
  if attributes.has_key?(:'xFrameAllowedUrl')
57
67
  self.x_frame_allowed_url = attributes[:'xFrameAllowedUrl']
58
68
  end
@@ -62,10 +72,6 @@ module DocuSign_Rooms
62
72
  # @return Array for valid properties with the reasons
63
73
  def list_invalid_properties
64
74
  invalid_properties = Array.new
65
- if @form_id.nil?
66
- invalid_properties.push('invalid value for "form_id", form_id cannot be nil.')
67
- end
68
-
69
75
  if @room_id.nil?
70
76
  invalid_properties.push('invalid value for "room_id", room_id cannot be nil.')
71
77
  end
@@ -76,7 +82,6 @@ module DocuSign_Rooms
76
82
  # Check to see if the all the properties in the model are valid
77
83
  # @return true if the model is valid
78
84
  def valid?
79
- return false if @form_id.nil?
80
85
  return false if @room_id.nil?
81
86
  true
82
87
  end
@@ -88,6 +93,7 @@ module DocuSign_Rooms
88
93
  self.class == o.class &&
89
94
  form_id == o.form_id &&
90
95
  room_id == o.room_id &&
96
+ form_ids == o.form_ids &&
91
97
  x_frame_allowed_url == o.x_frame_allowed_url
92
98
  end
93
99
 
@@ -100,7 +106,7 @@ module DocuSign_Rooms
100
106
  # Calculates hash code according to all attributes.
101
107
  # @return [Fixnum] Hash code
102
108
  def hash
103
- [form_id, room_id, x_frame_allowed_url].hash
109
+ [form_id, room_id, form_ids, x_frame_allowed_url].hash
104
110
  end
105
111
 
106
112
  # Builds the object from hash
@@ -0,0 +1,210 @@
1
+ =begin
2
+ #DocuSign Rooms API - v2
3
+
4
+ #An API for an integrator to access the features of DocuSign Rooms
5
+
6
+ OpenAPI spec version: v2
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_Rooms
15
+ class FormGroupForm
16
+ attr_accessor :form_id
17
+
18
+ attr_accessor :name
19
+
20
+ attr_accessor :is_required
21
+
22
+ attr_accessor :last_updated_date
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'form_id' => :'formId',
28
+ :'name' => :'name',
29
+ :'is_required' => :'isRequired',
30
+ :'last_updated_date' => :'lastUpdatedDate'
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.swagger_types
36
+ {
37
+ :'form_id' => :'String',
38
+ :'name' => :'String',
39
+ :'is_required' => :'BOOLEAN',
40
+ :'last_updated_date' => :'DateTime'
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?(:'formId')
53
+ self.form_id = attributes[:'formId']
54
+ end
55
+
56
+ if attributes.has_key?(:'name')
57
+ self.name = attributes[:'name']
58
+ end
59
+
60
+ if attributes.has_key?(:'isRequired')
61
+ self.is_required = attributes[:'isRequired']
62
+ end
63
+
64
+ if attributes.has_key?(:'lastUpdatedDate')
65
+ self.last_updated_date = attributes[:'lastUpdatedDate']
66
+ end
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = Array.new
73
+ invalid_properties
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ true
80
+ end
81
+
82
+ # Checks equality by comparing each attribute.
83
+ # @param [Object] Object to be compared
84
+ def ==(o)
85
+ return true if self.equal?(o)
86
+ self.class == o.class &&
87
+ form_id == o.form_id &&
88
+ name == o.name &&
89
+ is_required == o.is_required &&
90
+ last_updated_date == o.last_updated_date
91
+ end
92
+
93
+ # @see the `==` method
94
+ # @param [Object] Object to be compared
95
+ def eql?(o)
96
+ self == o
97
+ end
98
+
99
+ # Calculates hash code according to all attributes.
100
+ # @return [Fixnum] Hash code
101
+ def hash
102
+ [form_id, name, is_required, last_updated_date].hash
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ self.class.swagger_types.each_pair do |key, type|
111
+ if type =~ /\AArray<(.*)>/i
112
+ # check to ensure the input is an array given that the attribute
113
+ # is documented as an array but the input is not
114
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
115
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
116
+ end
117
+ elsif !attributes[self.class.attribute_map[key]].nil?
118
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
119
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
120
+ end
121
+
122
+ self
123
+ end
124
+
125
+ # Deserializes the data based on type
126
+ # @param string type Data type
127
+ # @param string value Value to be deserialized
128
+ # @return [Object] Deserialized data
129
+ def _deserialize(type, value)
130
+ case type.to_sym
131
+ when :DateTime
132
+ DateTime.parse(value)
133
+ when :Date
134
+ Date.parse(value)
135
+ when :String
136
+ value.to_s
137
+ when :Integer
138
+ value.to_i
139
+ when :Float
140
+ value.to_f
141
+ when :BOOLEAN
142
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
143
+ true
144
+ else
145
+ false
146
+ end
147
+ when :Object
148
+ # generic object (usually a Hash), return directly
149
+ value
150
+ when /\AArray<(?<inner_type>.+)>\z/
151
+ inner_type = Regexp.last_match[:inner_type]
152
+ value.map { |v| _deserialize(inner_type, v) }
153
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
154
+ k_type = Regexp.last_match[:k_type]
155
+ v_type = Regexp.last_match[:v_type]
156
+ {}.tap do |hash|
157
+ value.each do |k, v|
158
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
159
+ end
160
+ end
161
+ else # model
162
+ temp_model = DocuSign_Rooms.const_get(type).new
163
+ temp_model.build_from_hash(value)
164
+ end
165
+ end
166
+
167
+ # Returns the string representation of the object
168
+ # @return [String] String presentation of the object
169
+ def to_s
170
+ to_hash.to_s
171
+ end
172
+
173
+ # to_body is an alias to to_hash (backward compatibility)
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_body
176
+ to_hash
177
+ end
178
+
179
+ # Returns the object in the form of hash
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_hash
182
+ hash = {}
183
+ self.class.attribute_map.each_pair do |attr, param|
184
+ value = self.send(attr)
185
+ next if value.nil?
186
+ hash[param] = _to_hash(value)
187
+ end
188
+ hash
189
+ end
190
+
191
+ # Outputs non-array value in the form of hash
192
+ # For object, use to_hash. Otherwise, just return the value
193
+ # @param [Object] value Any valid value
194
+ # @return [Hash] Returns the value in the form of hash
195
+ def _to_hash(value)
196
+ if value.is_a?(Array)
197
+ value.compact.map { |v| _to_hash(v) }
198
+ elsif value.is_a?(Hash)
199
+ {}.tap do |hash|
200
+ value.each { |k, v| hash[k] = _to_hash(v) }
201
+ end
202
+ elsif value.respond_to? :to_hash
203
+ value.to_hash
204
+ else
205
+ value
206
+ end
207
+ end
208
+
209
+ end
210
+ end