docusign_rooms 1.0.0.beta → 1.2.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. data/CHANGELOG.md +7 -56
  2. data/README.md +1 -1
  3. data/docusign_rooms.gemspec +1 -0
  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 +33 -31
  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 +12 -14
  13. data/lib/docusign_rooms/api/fields_api.rb +11 -9
  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_groups_api.rb +457 -5
  17. data/lib/docusign_rooms/api/form_libraries_api.rb +14 -10
  18. data/lib/docusign_rooms/api/offices_api.rb +42 -36
  19. data/lib/docusign_rooms/api/origins_of_leads_api.rb +5 -3
  20. data/lib/docusign_rooms/api/property_types_api.rb +5 -3
  21. data/lib/docusign_rooms/api/regions_api.rb +40 -34
  22. data/lib/docusign_rooms/api/roles_api.rb +63 -54
  23. data/lib/docusign_rooms/api/room_contact_types_api.rb +5 -3
  24. data/lib/docusign_rooms/api/room_folders_api.rb +7 -5
  25. data/lib/docusign_rooms/api/room_templates_api.rb +11 -5
  26. data/lib/docusign_rooms/api/rooms_api.rb +202 -179
  27. data/lib/docusign_rooms/api/seller_decision_types_api.rb +5 -3
  28. data/lib/docusign_rooms/api/special_circumstance_types_api.rb +5 -3
  29. data/lib/docusign_rooms/api/states_api.rb +5 -3
  30. data/lib/docusign_rooms/api/task_date_types_api.rb +5 -3
  31. data/lib/docusign_rooms/api/task_list_templates_api.rb +9 -7
  32. data/lib/docusign_rooms/api/task_lists_api.rb +26 -24
  33. data/lib/docusign_rooms/api/task_responsibility_types_api.rb +5 -3
  34. data/lib/docusign_rooms/api/task_statuses_api.rb +5 -3
  35. data/lib/docusign_rooms/api/time_zones_api.rb +5 -3
  36. data/lib/docusign_rooms/api/transaction_sides_api.rb +5 -3
  37. data/lib/docusign_rooms/api/users_api.rb +164 -174
  38. data/lib/docusign_rooms/client/api_client.rb +3 -2
  39. data/lib/docusign_rooms/configuration.rb +2 -1
  40. data/lib/docusign_rooms/models/access_level.rb +32 -0
  41. data/lib/docusign_rooms/models/account_status.rb +29 -0
  42. data/lib/docusign_rooms/models/account_summary.rb +1 -35
  43. data/lib/docusign_rooms/models/assignable_roles.rb +13 -4
  44. data/lib/docusign_rooms/models/classic_agent_to_invite.rb +10 -1
  45. data/lib/docusign_rooms/models/classic_manager_to_invite.rb +1 -35
  46. data/lib/docusign_rooms/models/document.rb +22 -4
  47. data/lib/docusign_rooms/models/fields_custom_data_filter_type.rb +30 -0
  48. data/lib/docusign_rooms/models/form_group.rb +214 -0
  49. data/lib/docusign_rooms/models/form_group_for_create.rb +188 -0
  50. data/lib/docusign_rooms/models/form_group_for_update.rb +188 -0
  51. data/lib/docusign_rooms/models/form_group_form_to_assign.rb +197 -0
  52. data/lib/docusign_rooms/models/form_group_summary_list.rb +13 -4
  53. data/lib/docusign_rooms/models/form_library_summary_list.rb +13 -4
  54. data/lib/docusign_rooms/models/form_summary_list.rb +13 -4
  55. data/lib/docusign_rooms/models/group_form.rb +210 -0
  56. data/lib/docusign_rooms/models/member_sorting_option.rb +33 -0
  57. data/lib/docusign_rooms/models/office_summary_list.rb +13 -4
  58. data/lib/docusign_rooms/models/permissions.rb +79 -16
  59. data/lib/docusign_rooms/models/product_version.rb +29 -0
  60. data/lib/docusign_rooms/models/region_summary_list.rb +13 -4
  61. data/lib/docusign_rooms/models/role.rb +1 -1
  62. data/lib/docusign_rooms/models/role_summary_list.rb +13 -4
  63. data/lib/docusign_rooms/models/roles_filter_context_types.rb +30 -0
  64. data/lib/docusign_rooms/models/room.rb +1 -1
  65. data/lib/docusign_rooms/models/room_document.rb +40 -4
  66. data/lib/docusign_rooms/models/room_document_list.rb +10 -1
  67. data/lib/docusign_rooms/models/room_document_owner.rb +219 -0
  68. data/lib/docusign_rooms/models/room_folder_list.rb +13 -4
  69. data/lib/docusign_rooms/models/room_status.rb +31 -0
  70. data/lib/docusign_rooms/models/room_summary_list.rb +13 -4
  71. data/lib/docusign_rooms/models/room_templates_summary_list.rb +13 -4
  72. data/lib/docusign_rooms/models/room_user_sorting_option.rb +33 -0
  73. data/lib/docusign_rooms/models/room_user_summary.rb +22 -4
  74. data/lib/docusign_rooms/models/room_users_result.rb +13 -4
  75. data/lib/docusign_rooms/models/task_list_template_list.rb +13 -4
  76. data/lib/docusign_rooms/models/user.rb +1 -35
  77. data/lib/docusign_rooms/models/user_summary.rb +1 -35
  78. data/lib/docusign_rooms/models/user_summary_list.rb +13 -4
  79. data/lib/docusign_rooms/models/user_to_invite.rb +1 -35
  80. data/lib/docusign_rooms/version.rb +1 -1
  81. data/lib/docusign_rooms.rb +14 -2
  82. data/runLinter.sh +1 -0
  83. metadata +113 -60
  84. checksums.yaml +0 -7
  85. data/Gemfile.lock +0 -71
  86. data/docusign_rooms-1.0.0.pre.alpha.gem +0 -0
  87. data/lib/.DS_Store +0 -0
  88. data/lib/docusign_rooms/.DS_Store +0 -0
  89. data/lib/docusign_rooms/client/.DS_Store +0 -0
  90. data/tests/Gemfile.lock +0 -42
  91. data/tests/docs/private.pem +0 -27
@@ -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
@@ -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
@@ -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).
@@ -0,0 +1,32 @@
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 AccessLevel
16
+
17
+ CONTRIBUTOR = 'Contributor'.freeze
18
+ OFFICE = 'Office'.freeze
19
+ REGION = 'Region'.freeze
20
+ COMPANY = 'Company'.freeze
21
+ ADMIN = 'Admin'.freeze
22
+
23
+ # Builds the enum from string
24
+ # @param [String] The enum value in the form of the string
25
+ # @return [String] The enum value
26
+ def build_from_hash(value)
27
+ constantValues = AccessLevel.constants.select { |c| AccessLevel::const_get(c) == value }
28
+ raise "Invalid ENUM value #{value} for class #AccessLevel" if constantValues.empty?
29
+ value
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,29 @@
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 AccountStatus
16
+
17
+ ACTIVE = 'Active'.freeze
18
+ PENDING = 'Pending'.freeze
19
+
20
+ # Builds the enum from string
21
+ # @param [String] The enum value in the form of the string
22
+ # @return [String] The enum value
23
+ def build_from_hash(value)
24
+ constantValues = AccountStatus.constants.select { |c| AccountStatus::const_get(c) == value }
25
+ raise "Invalid ENUM value #{value} for class #AccountStatus" if constantValues.empty?
26
+ value
27
+ end
28
+ end
29
+ end
@@ -25,28 +25,6 @@ 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
-
50
28
  # Attribute mapping from ruby-style variable name to JSON key.
51
29
  def self.attribute_map
52
30
  {
@@ -64,7 +42,7 @@ module DocuSign_Rooms
64
42
  {
65
43
  :'company_id' => :'Integer',
66
44
  :'name' => :'String',
67
- :'company_version' => :'String',
45
+ :'company_version' => :'ProductVersion',
68
46
  :'docu_sign_account_guid' => :'String',
69
47
  :'default_field_set_id' => :'String',
70
48
  :'require_office_library_assignments' => :'BOOLEAN'
@@ -114,21 +92,9 @@ module DocuSign_Rooms
114
92
  # Check to see if the all the properties in the model are valid
115
93
  # @return true if the model is valid
116
94
  def valid?
117
- company_version_validator = EnumAttributeValidator.new('String', ['v5', 'v6'])
118
- return false unless company_version_validator.valid?(@company_version)
119
95
  true
120
96
  end
121
97
 
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
-
132
98
  # Checks equality by comparing each attribute.
133
99
  # @param [Object] Object to be compared
134
100
  def ==(o)
@@ -27,6 +27,8 @@ module DocuSign_Rooms
27
27
 
28
28
  attr_accessor :prior_uri
29
29
 
30
+ attr_accessor :total_row_count
31
+
30
32
  # Attribute mapping from ruby-style variable name to JSON key.
31
33
  def self.attribute_map
32
34
  {
@@ -36,7 +38,8 @@ module DocuSign_Rooms
36
38
  :'start_position' => :'startPosition',
37
39
  :'end_position' => :'endPosition',
38
40
  :'next_uri' => :'nextUri',
39
- :'prior_uri' => :'priorUri'
41
+ :'prior_uri' => :'priorUri',
42
+ :'total_row_count' => :'totalRowCount'
40
43
  }
41
44
  end
42
45
 
@@ -49,7 +52,8 @@ module DocuSign_Rooms
49
52
  :'start_position' => :'Integer',
50
53
  :'end_position' => :'Integer',
51
54
  :'next_uri' => :'String',
52
- :'prior_uri' => :'String'
55
+ :'prior_uri' => :'String',
56
+ :'total_row_count' => :'Integer'
53
57
  }
54
58
  end
55
59
 
@@ -90,6 +94,10 @@ module DocuSign_Rooms
90
94
  if attributes.has_key?(:'priorUri')
91
95
  self.prior_uri = attributes[:'priorUri']
92
96
  end
97
+
98
+ if attributes.has_key?(:'totalRowCount')
99
+ self.total_row_count = attributes[:'totalRowCount']
100
+ end
93
101
  end
94
102
 
95
103
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -116,7 +124,8 @@ module DocuSign_Rooms
116
124
  start_position == o.start_position &&
117
125
  end_position == o.end_position &&
118
126
  next_uri == o.next_uri &&
119
- prior_uri == o.prior_uri
127
+ prior_uri == o.prior_uri &&
128
+ total_row_count == o.total_row_count
120
129
  end
121
130
 
122
131
  # @see the `==` method
@@ -128,7 +137,7 @@ module DocuSign_Rooms
128
137
  # Calculates hash code according to all attributes.
129
138
  # @return [Fixnum] Hash code
130
139
  def hash
131
- [current_role_id, roles, result_set_size, start_position, end_position, next_uri, prior_uri].hash
140
+ [current_role_id, roles, result_set_size, start_position, end_position, next_uri, prior_uri, total_row_count].hash
132
141
  end
133
142
 
134
143
  # Builds the object from hash
@@ -21,6 +21,8 @@ module DocuSign_Rooms
21
21
 
22
22
  attr_accessor :office_id
23
23
 
24
+ attr_accessor :company_type_id
25
+
24
26
  # Required when the company is tightly bound to an eSign account; otherwise ignored.
25
27
  attr_accessor :e_sign_permission_profile_id
26
28
 
@@ -31,6 +33,7 @@ module DocuSign_Rooms
31
33
  :'last_name' => :'lastName',
32
34
  :'email' => :'email',
33
35
  :'office_id' => :'officeId',
36
+ :'company_type_id' => :'companyTypeId',
34
37
  :'e_sign_permission_profile_id' => :'eSignPermissionProfileId'
35
38
  }
36
39
  end
@@ -42,6 +45,7 @@ module DocuSign_Rooms
42
45
  :'last_name' => :'String',
43
46
  :'email' => :'String',
44
47
  :'office_id' => :'Integer',
48
+ :'company_type_id' => :'String',
45
49
  :'e_sign_permission_profile_id' => :'String'
46
50
  }
47
51
  end
@@ -70,6 +74,10 @@ module DocuSign_Rooms
70
74
  self.office_id = attributes[:'officeId']
71
75
  end
72
76
 
77
+ if attributes.has_key?(:'companyTypeId')
78
+ self.company_type_id = attributes[:'companyTypeId']
79
+ end
80
+
73
81
  if attributes.has_key?(:'eSignPermissionProfileId')
74
82
  self.e_sign_permission_profile_id = attributes[:'eSignPermissionProfileId']
75
83
  end
@@ -117,6 +125,7 @@ module DocuSign_Rooms
117
125
  last_name == o.last_name &&
118
126
  email == o.email &&
119
127
  office_id == o.office_id &&
128
+ company_type_id == o.company_type_id &&
120
129
  e_sign_permission_profile_id == o.e_sign_permission_profile_id
121
130
  end
122
131
 
@@ -129,7 +138,7 @@ module DocuSign_Rooms
129
138
  # Calculates hash code according to all attributes.
130
139
  # @return [Fixnum] Hash code
131
140
  def hash
132
- [first_name, last_name, email, office_id, e_sign_permission_profile_id].hash
141
+ [first_name, last_name, email, office_id, company_type_id, e_sign_permission_profile_id].hash
133
142
  end
134
143
 
135
144
  # Builds the object from hash
@@ -34,28 +34,6 @@ module DocuSign_Rooms
34
34
  # Required when the company is tightly bound to an eSign account; otherwise ignored.
35
35
  attr_accessor :e_sign_permission_profile_id
36
36
 
37
- class EnumAttributeValidator
38
- attr_reader :datatype
39
- attr_reader :allowable_values
40
-
41
- def initialize(datatype, allowable_values)
42
- @allowable_values = allowable_values.map do |value|
43
- case datatype.to_s
44
- when /Integer/i
45
- value.to_i
46
- when /Float/i
47
- value.to_f
48
- else
49
- value
50
- end
51
- end
52
- end
53
-
54
- def valid?(value)
55
- !value || allowable_values.include?(value)
56
- end
57
- end
58
-
59
37
  # Attribute mapping from ruby-style variable name to JSON key.
60
38
  def self.attribute_map
61
39
  {
@@ -80,7 +58,7 @@ module DocuSign_Rooms
80
58
  :'email' => :'String',
81
59
  :'default_office_id' => :'Integer',
82
60
  :'title_id' => :'Integer',
83
- :'access_level' => :'String',
61
+ :'access_level' => :'AccessLevel',
84
62
  :'permissions' => :'ClassicManagerPermissions',
85
63
  :'offices' => :'Array<Integer>',
86
64
  :'regions' => :'Array<Integer>',
@@ -185,22 +163,10 @@ module DocuSign_Rooms
185
163
  return false if @default_office_id.nil?
186
164
  return false if @title_id.nil?
187
165
  return false if @access_level.nil?
188
- access_level_validator = EnumAttributeValidator.new('String', ['Contributor', 'Office', 'Region', 'Company', 'Admin'])
189
- return false unless access_level_validator.valid?(@access_level)
190
166
  return false if @permissions.nil?
191
167
  true
192
168
  end
193
169
 
194
- # Custom attribute writer method checking allowed values (enum).
195
- # @param [Object] access_level Object to be assigned
196
- def access_level=(access_level)
197
- validator = EnumAttributeValidator.new('String', ['Contributor', 'Office', 'Region', 'Company', 'Admin'])
198
- unless validator.valid?(access_level)
199
- fail ArgumentError, 'invalid value for "access_level", must be one of #{validator.allowable_values}.'
200
- end
201
- @access_level = access_level
202
- end
203
-
204
170
  # Checks equality by comparing each attribute.
205
171
  # @param [Object] Object to be compared
206
172
  def ==(o)
@@ -29,8 +29,12 @@ module DocuSign_Rooms
29
29
 
30
30
  attr_accessor :is_signed
31
31
 
32
+ attr_accessor :content_type
33
+
32
34
  attr_accessor :base64_contents
33
35
 
36
+ attr_accessor :is_dynamic
37
+
34
38
  # Attribute mapping from ruby-style variable name to JSON key.
35
39
  def self.attribute_map
36
40
  {
@@ -42,7 +46,9 @@ module DocuSign_Rooms
42
46
  :'folder_id' => :'folderId',
43
47
  :'created_date' => :'createdDate',
44
48
  :'is_signed' => :'isSigned',
45
- :'base64_contents' => :'base64Contents'
49
+ :'content_type' => :'contentType',
50
+ :'base64_contents' => :'base64Contents',
51
+ :'is_dynamic' => :'isDynamic'
46
52
  }
47
53
  end
48
54
 
@@ -57,7 +63,9 @@ module DocuSign_Rooms
57
63
  :'folder_id' => :'Integer',
58
64
  :'created_date' => :'DateTime',
59
65
  :'is_signed' => :'BOOLEAN',
60
- :'base64_contents' => :'String'
66
+ :'content_type' => :'String',
67
+ :'base64_contents' => :'String',
68
+ :'is_dynamic' => :'BOOLEAN'
61
69
  }
62
70
  end
63
71
 
@@ -101,9 +109,17 @@ module DocuSign_Rooms
101
109
  self.is_signed = attributes[:'isSigned']
102
110
  end
103
111
 
112
+ if attributes.has_key?(:'contentType')
113
+ self.content_type = attributes[:'contentType']
114
+ end
115
+
104
116
  if attributes.has_key?(:'base64Contents')
105
117
  self.base64_contents = attributes[:'base64Contents']
106
118
  end
119
+
120
+ if attributes.has_key?(:'isDynamic')
121
+ self.is_dynamic = attributes[:'isDynamic']
122
+ end
107
123
  end
108
124
 
109
125
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -142,7 +158,9 @@ module DocuSign_Rooms
142
158
  folder_id == o.folder_id &&
143
159
  created_date == o.created_date &&
144
160
  is_signed == o.is_signed &&
145
- base64_contents == o.base64_contents
161
+ content_type == o.content_type &&
162
+ base64_contents == o.base64_contents &&
163
+ is_dynamic == o.is_dynamic
146
164
  end
147
165
 
148
166
  # @see the `==` method
@@ -154,7 +172,7 @@ module DocuSign_Rooms
154
172
  # Calculates hash code according to all attributes.
155
173
  # @return [Fixnum] Hash code
156
174
  def hash
157
- [document_id, name, room_id, owner_id, size, folder_id, created_date, is_signed, 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
158
176
  end
159
177
 
160
178
  # Builds the object from hash
@@ -0,0 +1,30 @@
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 FieldsCustomDataFilterType
16
+
17
+ NONE = 'None'.freeze
18
+ IS_REQUIRED_ON_CREATE = 'IsRequiredOnCreate'.freeze
19
+ IS_REQUIRED_ON_SUBMIT = 'IsRequiredOnSubmit'.freeze
20
+
21
+ # Builds the enum from string
22
+ # @param [String] The enum value in the form of the string
23
+ # @return [String] The enum value
24
+ def build_from_hash(value)
25
+ constantValues = FieldsCustomDataFilterType.constants.select { |c| FieldsCustomDataFilterType::const_get(c) == value }
26
+ raise "Invalid ENUM value #{value} for class #FieldsCustomDataFilterType" if constantValues.empty?
27
+ value
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,214 @@
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 FormGroup
16
+ attr_accessor :form_group_id
17
+
18
+ attr_accessor :name
19
+
20
+ attr_accessor :office_ids
21
+
22
+ attr_accessor :forms
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'form_group_id' => :'formGroupId',
28
+ :'name' => :'name',
29
+ :'office_ids' => :'officeIds',
30
+ :'forms' => :'forms'
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.swagger_types
36
+ {
37
+ :'form_group_id' => :'String',
38
+ :'name' => :'String',
39
+ :'office_ids' => :'Array<Integer>',
40
+ :'forms' => :'Array<GroupForm>'
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?(:'formGroupId')
53
+ self.form_group_id = attributes[:'formGroupId']
54
+ end
55
+
56
+ if attributes.has_key?(:'name')
57
+ self.name = attributes[:'name']
58
+ end
59
+
60
+ if attributes.has_key?(:'officeIds')
61
+ if (value = attributes[:'officeIds']).is_a?(Array)
62
+ self.office_ids = value
63
+ end
64
+ end
65
+
66
+ if attributes.has_key?(:'forms')
67
+ if (value = attributes[:'forms']).is_a?(Array)
68
+ self.forms = value
69
+ end
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ form_group_id == o.form_group_id &&
92
+ name == o.name &&
93
+ office_ids == o.office_ids &&
94
+ forms == o.forms
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param [Object] Object to be compared
99
+ def eql?(o)
100
+ self == o
101
+ end
102
+
103
+ # Calculates hash code according to all attributes.
104
+ # @return [Fixnum] Hash code
105
+ def hash
106
+ [form_group_id, name, office_ids, forms].hash
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+ self.class.swagger_types.each_pair do |key, type|
115
+ if type =~ /\AArray<(.*)>/i
116
+ # check to ensure the input is an array given that the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :DateTime
136
+ DateTime.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :BOOLEAN
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ temp_model = DocuSign_Rooms.const_get(type).new
167
+ temp_model.build_from_hash(value)
168
+ end
169
+ end
170
+
171
+ # Returns the string representation of the object
172
+ # @return [String] String presentation of the object
173
+ def to_s
174
+ to_hash.to_s
175
+ end
176
+
177
+ # to_body is an alias to to_hash (backward compatibility)
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_body
180
+ to_hash
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ next if value.nil?
190
+ hash[param] = _to_hash(value)
191
+ end
192
+ hash
193
+ end
194
+
195
+ # Outputs non-array value in the form of hash
196
+ # For object, use to_hash. Otherwise, just return the value
197
+ # @param [Object] value Any valid value
198
+ # @return [Hash] Returns the value in the form of hash
199
+ def _to_hash(value)
200
+ if value.is_a?(Array)
201
+ value.compact.map { |v| _to_hash(v) }
202
+ elsif value.is_a?(Hash)
203
+ {}.tap do |hash|
204
+ value.each { |k, v| hash[k] = _to_hash(v) }
205
+ end
206
+ elsif value.respond_to? :to_hash
207
+ value.to_hash
208
+ else
209
+ value
210
+ end
211
+ end
212
+
213
+ end
214
+ end