docusign_rooms 1.1.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -0
  3. data/docusign_rooms.gemspec +9 -6
  4. data/lib/docusign_rooms/api/accounts_api.rb +7 -5
  5. data/lib/docusign_rooms/api/activity_types_api.rb +5 -3
  6. data/lib/docusign_rooms/api/closing_statuses_api.rb +5 -3
  7. data/lib/docusign_rooms/api/contact_sides_api.rb +5 -3
  8. data/lib/docusign_rooms/api/countries_api.rb +5 -3
  9. data/lib/docusign_rooms/api/currencies_api.rb +5 -3
  10. data/lib/docusign_rooms/api/documents_api.rb +29 -25
  11. data/lib/docusign_rooms/api/e_sign_permission_profiles_api.rb +7 -5
  12. data/lib/docusign_rooms/api/external_form_fill_sessions_api.rb +8 -8
  13. data/lib/docusign_rooms/api/fields_api.rb +10 -8
  14. data/lib/docusign_rooms/api/financing_types_api.rb +5 -3
  15. data/lib/docusign_rooms/api/form_details_api.rb +7 -5
  16. data/lib/docusign_rooms/api/form_group_forms_api.rb +95 -0
  17. data/lib/docusign_rooms/api/form_groups_api.rb +86 -74
  18. data/lib/docusign_rooms/api/form_libraries_api.rb +14 -10
  19. data/lib/docusign_rooms/api/form_provider_associations_api.rb +95 -0
  20. data/lib/docusign_rooms/api/offices_api.rb +44 -36
  21. data/lib/docusign_rooms/api/origins_of_leads_api.rb +5 -3
  22. data/lib/docusign_rooms/api/property_types_api.rb +5 -3
  23. data/lib/docusign_rooms/api/regions_api.rb +38 -30
  24. data/lib/docusign_rooms/api/roles_api.rb +52 -42
  25. data/lib/docusign_rooms/api/room_contact_types_api.rb +5 -3
  26. data/lib/docusign_rooms/api/room_envelopes_api.rb +81 -0
  27. data/lib/docusign_rooms/api/room_folders_api.rb +7 -5
  28. data/lib/docusign_rooms/api/room_templates_api.rb +8 -6
  29. data/lib/docusign_rooms/api/rooms_api.rb +183 -155
  30. data/lib/docusign_rooms/api/seller_decision_types_api.rb +5 -3
  31. data/lib/docusign_rooms/api/special_circumstance_types_api.rb +5 -3
  32. data/lib/docusign_rooms/api/states_api.rb +5 -3
  33. data/lib/docusign_rooms/api/task_date_types_api.rb +5 -3
  34. data/lib/docusign_rooms/api/task_list_templates_api.rb +9 -7
  35. data/lib/docusign_rooms/api/task_lists_api.rb +25 -21
  36. data/lib/docusign_rooms/api/task_responsibility_types_api.rb +5 -3
  37. data/lib/docusign_rooms/api/task_statuses_api.rb +5 -3
  38. data/lib/docusign_rooms/api/time_zones_api.rb +5 -3
  39. data/lib/docusign_rooms/api/transaction_sides_api.rb +5 -3
  40. data/lib/docusign_rooms/api/users_api.rb +103 -261
  41. data/lib/docusign_rooms/client/api_client.rb +17 -12
  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/configuration.rb +2 -1
  45. data/lib/docusign_rooms/models/account_summary.rb +35 -1
  46. data/lib/docusign_rooms/models/api_error.rb +13 -4
  47. data/lib/docusign_rooms/models/document.rb +13 -4
  48. data/lib/docusign_rooms/models/envelope.rb +183 -0
  49. data/lib/docusign_rooms/models/envelope_for_create.rb +194 -0
  50. data/lib/docusign_rooms/models/external_form_fill_session_for_create.rb +12 -6
  51. data/lib/docusign_rooms/models/form_group_form.rb +210 -0
  52. data/lib/docusign_rooms/models/form_group_form_list.rb +239 -0
  53. data/lib/docusign_rooms/models/form_provider_association_summary.rb +219 -0
  54. data/lib/docusign_rooms/models/form_provider_associations_summary_list.rb +239 -0
  55. data/lib/docusign_rooms/models/form_summary.rb +13 -4
  56. data/lib/docusign_rooms/models/group_form.rb +13 -4
  57. data/lib/docusign_rooms/models/listing_type.rb +29 -0
  58. data/lib/docusign_rooms/models/permissions.rb +58 -13
  59. data/lib/docusign_rooms/models/roles_filter_context_types.rb +30 -0
  60. data/lib/docusign_rooms/models/room.rb +21 -1
  61. data/lib/docusign_rooms/models/room_document.rb +10 -1
  62. data/lib/docusign_rooms/models/room_for_create.rb +47 -4
  63. data/lib/docusign_rooms/models/user.rb +35 -1
  64. data/lib/docusign_rooms/models/user_summary.rb +35 -1
  65. data/lib/docusign_rooms/models/user_to_invite.rb +47 -2
  66. data/lib/docusign_rooms/version.rb +1 -1
  67. data/lib/docusign_rooms.rb +11 -3
  68. data/runLinter.sh +1 -0
  69. metadata +90 -23
  70. data/Gemfile.lock +0 -71
  71. data/lib/.DS_Store +0 -0
  72. data/lib/docusign_rooms/.DS_Store +0 -0
  73. data/lib/docusign_rooms/client/.DS_Store +0 -0
  74. data/tests/Gemfile.lock +0 -42
  75. data/tests/docs/private.pem +0 -27
@@ -1,5 +1,5 @@
1
1
  =begin
2
- #DocuSign Rooms API
2
+ #DocuSign Rooms API - v2
3
3
 
4
4
  #An API for an integrator to access the features of DocuSign Rooms
5
5
 
@@ -16,6 +16,7 @@ require 'tempfile'
16
16
  require 'typhoeus'
17
17
  require 'uri'
18
18
  require 'jwt'
19
+ require 'addressable/uri'
19
20
 
20
21
  module DocuSign_Rooms
21
22
  class ApiClient
@@ -34,7 +35,7 @@ module DocuSign_Rooms
34
35
  # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
35
36
  def initialize(config = Configuration.default)
36
37
  @config = config
37
- @user_agent = "Swagger-Codegen/#{VERSION}/ruby"
38
+ @user_agent = "Swagger-Codegen/1.3.0/ruby"
38
39
  @default_headers = {
39
40
  'Content-Type' => "application/json",
40
41
  'User-Agent' => @user_agent
@@ -259,8 +260,8 @@ module DocuSign_Rooms
259
260
  def build_request_url(path, opts)
260
261
  # Add leading and trailing slashes to path
261
262
  path = "/#{path}".gsub(/\/+/, '/')
262
- return URI.encode("https://" + self.get_oauth_base_path + path) if opts[:oauth]
263
- URI.encode(@config.base_url + path)
263
+ return Addressable::URI.encode("https://" + self.get_oauth_base_path + path) if opts[:oauth]
264
+ Addressable::URI.encode(@config.base_url + path)
264
265
  end
265
266
 
266
267
  # Builds the HTTP request body
@@ -391,8 +392,11 @@ module DocuSign_Rooms
391
392
  # Helper method to set oauth base path
392
393
  # @param [String] oauth_base_path if passed nil it will determined from base_path
393
394
  def set_oauth_base_path(oauth_base_path=nil)
394
- self.oauth_base_path = oauth_base_path if oauth_base_path
395
- return if self.oauth_base_path
395
+ if oauth_base_path
396
+ raise ArgumentError.new('OAuth base path should only include domain name (without https://)') if oauth_base_path.include? "//"
397
+ self.oauth_base_path = oauth_base_path
398
+ return
399
+ end
396
400
 
397
401
  # did we need this check as we can determine it from base path
398
402
  #raise ArgumentError.new('oAuthBasePath cannot be empty') unless oauth_base_path
@@ -571,13 +575,14 @@ module DocuSign_Rooms
571
575
  :return_type => 'OAuth::OAuthToken',
572
576
  :oauth => true
573
577
  }
574
- data, status_code, headers = self.call_api("POST", '/oauth/token', params)
575
- abort(data.inspect)
578
+
579
+ token, status_code, headers = self.call_api("POST", '/oauth/token', params)
576
580
 
577
- end
581
+ if status_code == 200
582
+ self.default_headers.store('Authorization', "#{token.token_type} #{token.access_token}")
578
583
 
579
- def set_access_token(token_obj)
580
- self.default_headers['Authorization'] = token_obj.access_token
584
+ token
585
+ end
581
586
  end
582
587
 
583
588
  # Helper method to add default header params
@@ -587,4 +592,4 @@ module DocuSign_Rooms
587
592
  @default_headers[header_name] = header_value
588
593
  end
589
594
  end
590
- end
595
+ end
@@ -1,7 +1,7 @@
1
1
  =begin
2
- #DocuSign REST API
2
+ #DocuSign Rooms API - v2
3
3
 
4
- #The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
4
+ #An API for an integrator to access the features of DocuSign Rooms
5
5
 
6
6
  OpenAPI spec version: v2
7
7
  Contact: devcenter@docusign.com
@@ -1058,4 +1058,4 @@ module DocuSign_Rooms
1058
1058
 
1059
1059
  end
1060
1060
  end
1061
- end
1061
+ end
@@ -10,6 +10,7 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git
10
10
  =end
11
11
 
12
12
  require 'uri'
13
+ require 'addressable/uri'
13
14
 
14
15
  module DocuSign_Rooms
15
16
  class Configuration
@@ -168,7 +169,7 @@ module DocuSign_Rooms
168
169
 
169
170
  def base_url
170
171
  url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
171
- URI.encode(url)
172
+ Addressable::URI.encode(url)
172
173
  end
173
174
 
174
175
  # Gets API key (with prefix if set).
@@ -25,6 +25,28 @@ module DocuSign_Rooms
25
25
 
26
26
  attr_accessor :require_office_library_assignments
27
27
 
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.include?(value)
47
+ end
48
+ end
49
+
28
50
  # Attribute mapping from ruby-style variable name to JSON key.
29
51
  def self.attribute_map
30
52
  {
@@ -42,7 +64,7 @@ module DocuSign_Rooms
42
64
  {
43
65
  :'company_id' => :'Integer',
44
66
  :'name' => :'String',
45
- :'company_version' => :'ProductVersion',
67
+ :'company_version' => :'String',
46
68
  :'docu_sign_account_guid' => :'String',
47
69
  :'default_field_set_id' => :'String',
48
70
  :'require_office_library_assignments' => :'BOOLEAN'
@@ -92,9 +114,21 @@ module DocuSign_Rooms
92
114
  # Check to see if the all the properties in the model are valid
93
115
  # @return true if the model is valid
94
116
  def valid?
117
+ company_version_validator = EnumAttributeValidator.new('String', ['v5', 'v6'])
118
+ return false unless company_version_validator.valid?(@company_version)
95
119
  true
96
120
  end
97
121
 
122
+ # Custom attribute writer method checking allowed values (enum).
123
+ # @param [Object] company_version Object to be assigned
124
+ def company_version=(company_version)
125
+ validator = EnumAttributeValidator.new('String', ['v5', 'v6'])
126
+ unless validator.valid?(company_version)
127
+ fail ArgumentError, 'invalid value for "company_version", must be one of #{validator.allowable_values}.'
128
+ end
129
+ @company_version = company_version
130
+ end
131
+
98
132
  # Checks equality by comparing each attribute.
99
133
  # @param [Object] Object to be compared
100
134
  def ==(o)
@@ -17,11 +17,14 @@ module DocuSign_Rooms
17
17
 
18
18
  attr_accessor :message
19
19
 
20
+ attr_accessor :reference_id
21
+
20
22
  # Attribute mapping from ruby-style variable name to JSON key.
21
23
  def self.attribute_map
22
24
  {
23
25
  :'error_code' => :'errorCode',
24
- :'message' => :'message'
26
+ :'message' => :'message',
27
+ :'reference_id' => :'referenceId'
25
28
  }
26
29
  end
27
30
 
@@ -29,7 +32,8 @@ module DocuSign_Rooms
29
32
  def self.swagger_types
30
33
  {
31
34
  :'error_code' => :'String',
32
- :'message' => :'String'
35
+ :'message' => :'String',
36
+ :'reference_id' => :'String'
33
37
  }
34
38
  end
35
39
 
@@ -48,6 +52,10 @@ module DocuSign_Rooms
48
52
  if attributes.has_key?(:'message')
49
53
  self.message = attributes[:'message']
50
54
  end
55
+
56
+ if attributes.has_key?(:'referenceId')
57
+ self.reference_id = attributes[:'referenceId']
58
+ end
51
59
  end
52
60
 
53
61
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -69,7 +77,8 @@ module DocuSign_Rooms
69
77
  return true if self.equal?(o)
70
78
  self.class == o.class &&
71
79
  error_code == o.error_code &&
72
- message == o.message
80
+ message == o.message &&
81
+ reference_id == o.reference_id
73
82
  end
74
83
 
75
84
  # @see the `==` method
@@ -81,7 +90,7 @@ module DocuSign_Rooms
81
90
  # Calculates hash code according to all attributes.
82
91
  # @return [Fixnum] Hash code
83
92
  def hash
84
- [error_code, message].hash
93
+ [error_code, message, reference_id].hash
85
94
  end
86
95
 
87
96
  # Builds the object from hash
@@ -33,6 +33,8 @@ module DocuSign_Rooms
33
33
 
34
34
  attr_accessor :base64_contents
35
35
 
36
+ attr_accessor :is_dynamic
37
+
36
38
  # Attribute mapping from ruby-style variable name to JSON key.
37
39
  def self.attribute_map
38
40
  {
@@ -45,7 +47,8 @@ module DocuSign_Rooms
45
47
  :'created_date' => :'createdDate',
46
48
  :'is_signed' => :'isSigned',
47
49
  :'content_type' => :'contentType',
48
- :'base64_contents' => :'base64Contents'
50
+ :'base64_contents' => :'base64Contents',
51
+ :'is_dynamic' => :'isDynamic'
49
52
  }
50
53
  end
51
54
 
@@ -61,7 +64,8 @@ module DocuSign_Rooms
61
64
  :'created_date' => :'DateTime',
62
65
  :'is_signed' => :'BOOLEAN',
63
66
  :'content_type' => :'String',
64
- :'base64_contents' => :'String'
67
+ :'base64_contents' => :'String',
68
+ :'is_dynamic' => :'BOOLEAN'
65
69
  }
66
70
  end
67
71
 
@@ -112,6 +116,10 @@ module DocuSign_Rooms
112
116
  if attributes.has_key?(:'base64Contents')
113
117
  self.base64_contents = attributes[:'base64Contents']
114
118
  end
119
+
120
+ if attributes.has_key?(:'isDynamic')
121
+ self.is_dynamic = attributes[:'isDynamic']
122
+ end
115
123
  end
116
124
 
117
125
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -151,7 +159,8 @@ module DocuSign_Rooms
151
159
  created_date == o.created_date &&
152
160
  is_signed == o.is_signed &&
153
161
  content_type == o.content_type &&
154
- base64_contents == o.base64_contents
162
+ base64_contents == o.base64_contents &&
163
+ is_dynamic == o.is_dynamic
155
164
  end
156
165
 
157
166
  # @see the `==` method
@@ -163,7 +172,7 @@ module DocuSign_Rooms
163
172
  # Calculates hash code according to all attributes.
164
173
  # @return [Fixnum] Hash code
165
174
  def hash
166
- [document_id, name, room_id, owner_id, size, folder_id, created_date, is_signed, content_type, base64_contents].hash
175
+ [document_id, name, room_id, owner_id, size, folder_id, created_date, is_signed, content_type, base64_contents, is_dynamic].hash
167
176
  end
168
177
 
169
178
  # Builds the object from hash
@@ -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