docusign_rooms 1.0.0.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +66 -0
  3. data/Gemfile +7 -0
  4. data/Gemfile.lock +71 -0
  5. data/LICENSE +21 -0
  6. data/README.md +80 -0
  7. data/Rakefile +8 -0
  8. data/docusign_rooms-1.0.0.pre.alpha.gem +0 -0
  9. data/docusign_rooms.gemspec +45 -0
  10. data/git_push.sh +55 -0
  11. data/lib/.DS_Store +0 -0
  12. data/lib/docusign_rooms.rb +193 -0
  13. data/lib/docusign_rooms/.DS_Store +0 -0
  14. data/lib/docusign_rooms/api/accounts_api.rb +73 -0
  15. data/lib/docusign_rooms/api/activity_types_api.rb +69 -0
  16. data/lib/docusign_rooms/api/closing_statuses_api.rb +69 -0
  17. data/lib/docusign_rooms/api/contact_sides_api.rb +69 -0
  18. data/lib/docusign_rooms/api/countries_api.rb +69 -0
  19. data/lib/docusign_rooms/api/currencies_api.rb +69 -0
  20. data/lib/docusign_rooms/api/documents_api.rb +200 -0
  21. data/lib/docusign_rooms/api/e_sign_permission_profiles_api.rb +73 -0
  22. data/lib/docusign_rooms/api/external_form_fill_sessions_api.rb +79 -0
  23. data/lib/docusign_rooms/api/fields_api.rb +92 -0
  24. data/lib/docusign_rooms/api/financing_types_api.rb +69 -0
  25. data/lib/docusign_rooms/api/form_details_api.rb +77 -0
  26. data/lib/docusign_rooms/api/form_groups_api.rb +89 -0
  27. data/lib/docusign_rooms/api/form_libraries_api.rb +158 -0
  28. data/lib/docusign_rooms/api/offices_api.rb +310 -0
  29. data/lib/docusign_rooms/api/origins_of_leads_api.rb +69 -0
  30. data/lib/docusign_rooms/api/property_types_api.rb +69 -0
  31. data/lib/docusign_rooms/api/regions_api.rb +306 -0
  32. data/lib/docusign_rooms/api/roles_api.rb +328 -0
  33. data/lib/docusign_rooms/api/room_contact_types_api.rb +69 -0
  34. data/lib/docusign_rooms/api/room_folders_api.rb +93 -0
  35. data/lib/docusign_rooms/api/room_templates_api.rb +97 -0
  36. data/lib/docusign_rooms/api/rooms_api.rb +1146 -0
  37. data/lib/docusign_rooms/api/seller_decision_types_api.rb +69 -0
  38. data/lib/docusign_rooms/api/special_circumstance_types_api.rb +69 -0
  39. data/lib/docusign_rooms/api/states_api.rb +69 -0
  40. data/lib/docusign_rooms/api/task_date_types_api.rb +69 -0
  41. data/lib/docusign_rooms/api/task_list_templates_api.rb +89 -0
  42. data/lib/docusign_rooms/api/task_lists_api.rb +188 -0
  43. data/lib/docusign_rooms/api/task_responsibility_types_api.rb +69 -0
  44. data/lib/docusign_rooms/api/task_statuses_api.rb +69 -0
  45. data/lib/docusign_rooms/api/time_zones_api.rb +69 -0
  46. data/lib/docusign_rooms/api/transaction_sides_api.rb +69 -0
  47. data/lib/docusign_rooms/api/users_api.rb +908 -0
  48. data/lib/docusign_rooms/client/.DS_Store +0 -0
  49. data/lib/docusign_rooms/client/api_client.rb +590 -0
  50. data/lib/docusign_rooms/client/api_error.rb +37 -0
  51. data/lib/docusign_rooms/client/auth/oauth.rb +1061 -0
  52. data/lib/docusign_rooms/configuration.rb +202 -0
  53. data/lib/docusign_rooms/models/account_summary.rb +262 -0
  54. data/lib/docusign_rooms/models/activity_type.rb +192 -0
  55. data/lib/docusign_rooms/models/api_error.rb +192 -0
  56. data/lib/docusign_rooms/models/assignable_roles.rb +239 -0
  57. data/lib/docusign_rooms/models/classic_admin_to_invite.rb +216 -0
  58. data/lib/docusign_rooms/models/classic_agent_to_invite.rb +240 -0
  59. data/lib/docusign_rooms/models/classic_manager_permissions.rb +291 -0
  60. data/lib/docusign_rooms/models/classic_manager_to_invite.rb +338 -0
  61. data/lib/docusign_rooms/models/closing_status.rb +192 -0
  62. data/lib/docusign_rooms/models/contact_side.rb +192 -0
  63. data/lib/docusign_rooms/models/country.rb +192 -0
  64. data/lib/docusign_rooms/models/currency.rb +192 -0
  65. data/lib/docusign_rooms/models/custom_data.rb +192 -0
  66. data/lib/docusign_rooms/models/depends_on.rb +192 -0
  67. data/lib/docusign_rooms/models/designated_office.rb +188 -0
  68. data/lib/docusign_rooms/models/designated_region.rb +188 -0
  69. data/lib/docusign_rooms/models/document.rb +265 -0
  70. data/lib/docusign_rooms/models/document_user.rb +291 -0
  71. data/lib/docusign_rooms/models/document_user_for_create.rb +188 -0
  72. data/lib/docusign_rooms/models/e_sign_account_role_settings.rb +183 -0
  73. data/lib/docusign_rooms/models/e_sign_permission_profile.rb +201 -0
  74. data/lib/docusign_rooms/models/e_sign_permission_profile_list.rb +185 -0
  75. data/lib/docusign_rooms/models/external_form_fill_session.rb +183 -0
  76. data/lib/docusign_rooms/models/external_form_fill_session_for_create.rb +211 -0
  77. data/lib/docusign_rooms/models/field.rb +248 -0
  78. data/lib/docusign_rooms/models/field_configuration.rb +259 -0
  79. data/lib/docusign_rooms/models/field_data.rb +185 -0
  80. data/lib/docusign_rooms/models/field_data_for_create.rb +185 -0
  81. data/lib/docusign_rooms/models/field_data_for_update.rb +185 -0
  82. data/lib/docusign_rooms/models/field_set.rb +203 -0
  83. data/lib/docusign_rooms/models/financing_type.rb +192 -0
  84. data/lib/docusign_rooms/models/form_details.rb +246 -0
  85. data/lib/docusign_rooms/models/form_for_add.rb +188 -0
  86. data/lib/docusign_rooms/models/form_group_summary.rb +201 -0
  87. data/lib/docusign_rooms/models/form_group_summary_list.rb +230 -0
  88. data/lib/docusign_rooms/models/form_library_summary.rb +201 -0
  89. data/lib/docusign_rooms/models/form_library_summary_list.rb +230 -0
  90. data/lib/docusign_rooms/models/form_summary.rb +201 -0
  91. data/lib/docusign_rooms/models/form_summary_list.rb +230 -0
  92. data/lib/docusign_rooms/models/global_activity_types.rb +185 -0
  93. data/lib/docusign_rooms/models/global_closing_statuses.rb +185 -0
  94. data/lib/docusign_rooms/models/global_contact_sides.rb +185 -0
  95. data/lib/docusign_rooms/models/global_countries.rb +185 -0
  96. data/lib/docusign_rooms/models/global_currencies.rb +185 -0
  97. data/lib/docusign_rooms/models/global_financing_types.rb +185 -0
  98. data/lib/docusign_rooms/models/global_origins_of_leads.rb +185 -0
  99. data/lib/docusign_rooms/models/global_property_types.rb +185 -0
  100. data/lib/docusign_rooms/models/global_room_contact_types.rb +185 -0
  101. data/lib/docusign_rooms/models/global_seller_decision_types.rb +185 -0
  102. data/lib/docusign_rooms/models/global_special_circumstance_types.rb +185 -0
  103. data/lib/docusign_rooms/models/global_states.rb +185 -0
  104. data/lib/docusign_rooms/models/global_task_date_types.rb +185 -0
  105. data/lib/docusign_rooms/models/global_task_responsibility_types.rb +185 -0
  106. data/lib/docusign_rooms/models/global_task_statuses.rb +185 -0
  107. data/lib/docusign_rooms/models/global_time_zones.rb +185 -0
  108. data/lib/docusign_rooms/models/global_transaction_sides.rb +185 -0
  109. data/lib/docusign_rooms/models/locked_out_details.rb +188 -0
  110. data/lib/docusign_rooms/models/nullable_field_data.rb +185 -0
  111. data/lib/docusign_rooms/models/nullable_permissions.rb +660 -0
  112. data/lib/docusign_rooms/models/office.rb +287 -0
  113. data/lib/docusign_rooms/models/office_for_create.rb +269 -0
  114. data/lib/docusign_rooms/models/office_reference_count.rb +192 -0
  115. data/lib/docusign_rooms/models/office_reference_count_list.rb +185 -0
  116. data/lib/docusign_rooms/models/office_summary.rb +282 -0
  117. data/lib/docusign_rooms/models/office_summary_list.rb +230 -0
  118. data/lib/docusign_rooms/models/origin_of_lead.rb +192 -0
  119. data/lib/docusign_rooms/models/permissions.rb +660 -0
  120. data/lib/docusign_rooms/models/property_type.rb +192 -0
  121. data/lib/docusign_rooms/models/region.rb +206 -0
  122. data/lib/docusign_rooms/models/region_reference_count.rb +192 -0
  123. data/lib/docusign_rooms/models/region_reference_count_list.rb +185 -0
  124. data/lib/docusign_rooms/models/region_summary.rb +201 -0
  125. data/lib/docusign_rooms/models/region_summary_list.rb +230 -0
  126. data/lib/docusign_rooms/models/role.rb +246 -0
  127. data/lib/docusign_rooms/models/role_for_create.rb +201 -0
  128. data/lib/docusign_rooms/models/role_for_update.rb +201 -0
  129. data/lib/docusign_rooms/models/role_summary.rb +228 -0
  130. data/lib/docusign_rooms/models/role_summary_list.rb +230 -0
  131. data/lib/docusign_rooms/models/room.rb +282 -0
  132. data/lib/docusign_rooms/models/room_contact_type.rb +192 -0
  133. data/lib/docusign_rooms/models/room_document.rb +246 -0
  134. data/lib/docusign_rooms/models/room_document_list.rb +230 -0
  135. data/lib/docusign_rooms/models/room_folder.rb +201 -0
  136. data/lib/docusign_rooms/models/room_folder_list.rb +230 -0
  137. data/lib/docusign_rooms/models/room_for_create.rb +248 -0
  138. data/lib/docusign_rooms/models/room_invite.rb +240 -0
  139. data/lib/docusign_rooms/models/room_invite_response.rb +237 -0
  140. data/lib/docusign_rooms/models/room_picture.rb +183 -0
  141. data/lib/docusign_rooms/models/room_summary.rb +273 -0
  142. data/lib/docusign_rooms/models/room_summary_list.rb +230 -0
  143. data/lib/docusign_rooms/models/room_template.rb +201 -0
  144. data/lib/docusign_rooms/models/room_templates_summary_list.rb +230 -0
  145. data/lib/docusign_rooms/models/room_user.rb +246 -0
  146. data/lib/docusign_rooms/models/room_user_for_update.rb +192 -0
  147. data/lib/docusign_rooms/models/room_user_removal_detail.rb +183 -0
  148. data/lib/docusign_rooms/models/room_user_summary.rb +237 -0
  149. data/lib/docusign_rooms/models/room_users_result.rb +230 -0
  150. data/lib/docusign_rooms/models/select_list_field_option.rb +201 -0
  151. data/lib/docusign_rooms/models/seller_decision_type.rb +192 -0
  152. data/lib/docusign_rooms/models/special_circumstance_type.rb +192 -0
  153. data/lib/docusign_rooms/models/state.rb +192 -0
  154. data/lib/docusign_rooms/models/task_date_type.rb +192 -0
  155. data/lib/docusign_rooms/models/task_list.rb +275 -0
  156. data/lib/docusign_rooms/models/task_list_for_create.rb +183 -0
  157. data/lib/docusign_rooms/models/task_list_summary.rb +264 -0
  158. data/lib/docusign_rooms/models/task_list_summary_list.rb +185 -0
  159. data/lib/docusign_rooms/models/task_list_template.rb +210 -0
  160. data/lib/docusign_rooms/models/task_list_template_list.rb +230 -0
  161. data/lib/docusign_rooms/models/task_responsibility_type.rb +192 -0
  162. data/lib/docusign_rooms/models/task_status.rb +192 -0
  163. data/lib/docusign_rooms/models/task_summary.rb +291 -0
  164. data/lib/docusign_rooms/models/time_zone.rb +192 -0
  165. data/lib/docusign_rooms/models/transaction_side.rb +192 -0
  166. data/lib/docusign_rooms/models/user.rb +338 -0
  167. data/lib/docusign_rooms/models/user_for_update.rb +188 -0
  168. data/lib/docusign_rooms/models/user_summary.rb +307 -0
  169. data/lib/docusign_rooms/models/user_summary_list.rb +230 -0
  170. data/lib/docusign_rooms/models/user_to_invite.rb +337 -0
  171. data/lib/docusign_rooms/version.rb +14 -0
  172. data/tests/Gemfile +5 -0
  173. data/tests/Gemfile.lock +42 -0
  174. data/tests/docs/Test.pdf +0 -0
  175. data/tests/docs/private.pem +27 -0
  176. data/tests/spec/unit_tests_using_jwt_spec.rb +125 -0
  177. metadata +420 -0
@@ -0,0 +1,202 @@
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 'uri'
13
+
14
+ module DocuSign_Rooms
15
+ class Configuration
16
+ # Defines url scheme
17
+ attr_accessor :scheme
18
+
19
+ # Defines url host
20
+ attr_accessor :host
21
+
22
+ # Defines url base path
23
+ attr_accessor :base_path
24
+
25
+ # Defines API keys used with API Key authentications.
26
+ #
27
+ # @return [Hash] key: parameter name, value: parameter value (API key)
28
+ #
29
+ # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
30
+ # config.api_key['api_key'] = 'xxx'
31
+ attr_accessor :api_key
32
+
33
+ # Defines API key prefixes used with API Key authentications.
34
+ #
35
+ # @return [Hash] key: parameter name, value: API key prefix
36
+ #
37
+ # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
38
+ # config.api_key_prefix['api_key'] = 'Token'
39
+ attr_accessor :api_key_prefix
40
+
41
+ # Defines the username used with HTTP basic authentication.
42
+ #
43
+ # @return [String]
44
+ attr_accessor :username
45
+
46
+ # Defines the password used with HTTP basic authentication.
47
+ #
48
+ # @return [String]
49
+ attr_accessor :password
50
+
51
+ # Defines the access token (Bearer) used with OAuth2.
52
+ attr_accessor :access_token
53
+
54
+ # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
55
+ # details will be logged with `logger.debug` (see the `logger` attribute).
56
+ # Default to false.
57
+ #
58
+ # @return [true, false]
59
+ attr_accessor :debugging
60
+
61
+ # Defines the logger used for debugging.
62
+ # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
63
+ #
64
+ # @return [#debug]
65
+ attr_accessor :logger
66
+
67
+ # Defines the temporary folder to store downloaded files
68
+ # (for API endpoints that have file response).
69
+ # Default to use `Tempfile`.
70
+ #
71
+ # @return [String]
72
+ attr_accessor :temp_folder_path
73
+
74
+ # The time limit for HTTP request in seconds.
75
+ # Default to 0 (never times out).
76
+ attr_accessor :timeout
77
+
78
+ ### TLS/SSL setting
79
+ # Set this to false to skip verifying SSL certificate when calling API from https server.
80
+ # Default to true.
81
+ #
82
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
83
+ #
84
+ # @return [true, false]
85
+ attr_accessor :verify_ssl
86
+
87
+ ### TLS/SSL setting
88
+ # Set this to false to skip verifying SSL host name
89
+ # Default to true.
90
+ #
91
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
92
+ #
93
+ # @return [true, false]
94
+ attr_accessor :verify_ssl_host
95
+
96
+ ### TLS/SSL setting
97
+ # Set this to customize the certificate file to verify the peer.
98
+ #
99
+ # @return [String] the path to the certificate file
100
+ #
101
+ # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
102
+ # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
103
+ attr_accessor :ssl_ca_cert
104
+
105
+ ### TLS/SSL setting
106
+ # Client certificate file (for client certificate)
107
+ attr_accessor :cert_file
108
+
109
+ ### TLS/SSL setting
110
+ # Client private key file (for client certificate)
111
+ attr_accessor :key_file
112
+
113
+ # Set this to customize parameters encoding of array parameter with multi collectionFormat.
114
+ # Default to nil.
115
+ #
116
+ # @see The params_encoding option of Ethon. Related source code:
117
+ # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
118
+ attr_accessor :params_encoding
119
+
120
+ attr_accessor :inject_format
121
+
122
+ attr_accessor :force_ending_format
123
+
124
+ def initialize
125
+ @scheme = 'https'
126
+ @host = 'rooms.docusign.com'
127
+ @base_path = '/restapi'
128
+ @api_key = {}
129
+ @api_key_prefix = {}
130
+ @timeout = 0
131
+ @verify_ssl = true
132
+ @verify_ssl_host = true
133
+ @params_encoding = nil
134
+ @cert_file = nil
135
+ @key_file = nil
136
+ @debugging = false
137
+ @inject_format = false
138
+ @force_ending_format = false
139
+ @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
140
+
141
+ yield(self) if block_given?
142
+ end
143
+
144
+ # The default Configuration object.
145
+ def self.default
146
+ @@default ||= Configuration.new
147
+ end
148
+
149
+ def configure
150
+ yield(self) if block_given?
151
+ end
152
+
153
+ def scheme=(scheme)
154
+ # remove :// from scheme
155
+ @scheme = scheme.sub(/:\/\//, '')
156
+ end
157
+
158
+ def host=(host)
159
+ # remove http(s):// and anything after a slash
160
+ @host = host.sub(/https?:\/\//, '').split('/').first
161
+ end
162
+
163
+ def base_path=(base_path)
164
+ # Add leading and trailing slashes to base_path
165
+ @base_path = "/#{base_path}".gsub(/\/+/, '/')
166
+ @base_path = '' if @base_path == '/'
167
+ end
168
+
169
+ def base_url
170
+ url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
171
+ URI.encode(url)
172
+ end
173
+
174
+ # Gets API key (with prefix if set).
175
+ # @param [String] param_name the parameter name of API key auth
176
+ def api_key_with_prefix(param_name)
177
+ if @api_key_prefix[param_name]
178
+ "#{@api_key_prefix[param_name]} #{@api_key[param_name]}"
179
+ else
180
+ @api_key[param_name]
181
+ end
182
+ end
183
+
184
+ # Gets Basic Auth token string
185
+ def basic_auth_token
186
+ 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
187
+ end
188
+
189
+ # Returns Auth Settings hash for api client.
190
+ def auth_settings
191
+ {
192
+ 'docusignAccessCode' =>
193
+ {
194
+ type: 'oauth2',
195
+ in: 'header',
196
+ key: 'Authorization',
197
+ value: "Bearer #{access_token}"
198
+ },
199
+ }
200
+ end
201
+ end
202
+ end
@@ -0,0 +1,262 @@
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 AccountSummary
16
+ attr_accessor :company_id
17
+
18
+ attr_accessor :name
19
+
20
+ attr_accessor :company_version
21
+
22
+ attr_accessor :docu_sign_account_guid
23
+
24
+ attr_accessor :default_field_set_id
25
+
26
+ attr_accessor :require_office_library_assignments
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
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'company_id' => :'companyId',
54
+ :'name' => :'name',
55
+ :'company_version' => :'companyVersion',
56
+ :'docu_sign_account_guid' => :'docuSignAccountGuid',
57
+ :'default_field_set_id' => :'defaultFieldSetId',
58
+ :'require_office_library_assignments' => :'requireOfficeLibraryAssignments'
59
+ }
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.swagger_types
64
+ {
65
+ :'company_id' => :'Integer',
66
+ :'name' => :'String',
67
+ :'company_version' => :'String',
68
+ :'docu_sign_account_guid' => :'String',
69
+ :'default_field_set_id' => :'String',
70
+ :'require_office_library_assignments' => :'BOOLEAN'
71
+ }
72
+ end
73
+
74
+ # Initializes the object
75
+ # @param [Hash] attributes Model attributes in the form of hash
76
+ def initialize(attributes = {})
77
+ return unless attributes.is_a?(Hash)
78
+
79
+ # convert string to symbol for hash key
80
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
81
+
82
+ if attributes.has_key?(:'companyId')
83
+ self.company_id = attributes[:'companyId']
84
+ end
85
+
86
+ if attributes.has_key?(:'name')
87
+ self.name = attributes[:'name']
88
+ end
89
+
90
+ if attributes.has_key?(:'companyVersion')
91
+ self.company_version = attributes[:'companyVersion']
92
+ end
93
+
94
+ if attributes.has_key?(:'docuSignAccountGuid')
95
+ self.docu_sign_account_guid = attributes[:'docuSignAccountGuid']
96
+ end
97
+
98
+ if attributes.has_key?(:'defaultFieldSetId')
99
+ self.default_field_set_id = attributes[:'defaultFieldSetId']
100
+ end
101
+
102
+ if attributes.has_key?(:'requireOfficeLibraryAssignments')
103
+ self.require_office_library_assignments = attributes[:'requireOfficeLibraryAssignments']
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ invalid_properties = Array.new
111
+ invalid_properties
112
+ end
113
+
114
+ # Check to see if the all the properties in the model are valid
115
+ # @return true if the model is valid
116
+ def valid?
117
+ company_version_validator = EnumAttributeValidator.new('String', ['v5', 'v6'])
118
+ return false unless company_version_validator.valid?(@company_version)
119
+ true
120
+ end
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
+
132
+ # Checks equality by comparing each attribute.
133
+ # @param [Object] Object to be compared
134
+ def ==(o)
135
+ return true if self.equal?(o)
136
+ self.class == o.class &&
137
+ company_id == o.company_id &&
138
+ name == o.name &&
139
+ company_version == o.company_version &&
140
+ docu_sign_account_guid == o.docu_sign_account_guid &&
141
+ default_field_set_id == o.default_field_set_id &&
142
+ require_office_library_assignments == o.require_office_library_assignments
143
+ end
144
+
145
+ # @see the `==` method
146
+ # @param [Object] Object to be compared
147
+ def eql?(o)
148
+ self == o
149
+ end
150
+
151
+ # Calculates hash code according to all attributes.
152
+ # @return [Fixnum] Hash code
153
+ def hash
154
+ [company_id, name, company_version, docu_sign_account_guid, default_field_set_id, require_office_library_assignments].hash
155
+ end
156
+
157
+ # Builds the object from hash
158
+ # @param [Hash] attributes Model attributes in the form of hash
159
+ # @return [Object] Returns the model itself
160
+ def build_from_hash(attributes)
161
+ return nil unless attributes.is_a?(Hash)
162
+ self.class.swagger_types.each_pair do |key, type|
163
+ if type =~ /\AArray<(.*)>/i
164
+ # check to ensure the input is an array given that the attribute
165
+ # is documented as an array but the input is not
166
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
167
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
168
+ end
169
+ elsif !attributes[self.class.attribute_map[key]].nil?
170
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
171
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
172
+ end
173
+
174
+ self
175
+ end
176
+
177
+ # Deserializes the data based on type
178
+ # @param string type Data type
179
+ # @param string value Value to be deserialized
180
+ # @return [Object] Deserialized data
181
+ def _deserialize(type, value)
182
+ case type.to_sym
183
+ when :DateTime
184
+ DateTime.parse(value)
185
+ when :Date
186
+ Date.parse(value)
187
+ when :String
188
+ value.to_s
189
+ when :Integer
190
+ value.to_i
191
+ when :Float
192
+ value.to_f
193
+ when :BOOLEAN
194
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
195
+ true
196
+ else
197
+ false
198
+ end
199
+ when :Object
200
+ # generic object (usually a Hash), return directly
201
+ value
202
+ when /\AArray<(?<inner_type>.+)>\z/
203
+ inner_type = Regexp.last_match[:inner_type]
204
+ value.map { |v| _deserialize(inner_type, v) }
205
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
206
+ k_type = Regexp.last_match[:k_type]
207
+ v_type = Regexp.last_match[:v_type]
208
+ {}.tap do |hash|
209
+ value.each do |k, v|
210
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
211
+ end
212
+ end
213
+ else # model
214
+ temp_model = DocuSign_Rooms.const_get(type).new
215
+ temp_model.build_from_hash(value)
216
+ end
217
+ end
218
+
219
+ # Returns the string representation of the object
220
+ # @return [String] String presentation of the object
221
+ def to_s
222
+ to_hash.to_s
223
+ end
224
+
225
+ # to_body is an alias to to_hash (backward compatibility)
226
+ # @return [Hash] Returns the object in the form of hash
227
+ def to_body
228
+ to_hash
229
+ end
230
+
231
+ # Returns the object in the form of hash
232
+ # @return [Hash] Returns the object in the form of hash
233
+ def to_hash
234
+ hash = {}
235
+ self.class.attribute_map.each_pair do |attr, param|
236
+ value = self.send(attr)
237
+ next if value.nil?
238
+ hash[param] = _to_hash(value)
239
+ end
240
+ hash
241
+ end
242
+
243
+ # Outputs non-array value in the form of hash
244
+ # For object, use to_hash. Otherwise, just return the value
245
+ # @param [Object] value Any valid value
246
+ # @return [Hash] Returns the value in the form of hash
247
+ def _to_hash(value)
248
+ if value.is_a?(Array)
249
+ value.compact.map { |v| _to_hash(v) }
250
+ elsif value.is_a?(Hash)
251
+ {}.tap do |hash|
252
+ value.each { |k, v| hash[k] = _to_hash(v) }
253
+ end
254
+ elsif value.respond_to? :to_hash
255
+ value.to_hash
256
+ else
257
+ value
258
+ end
259
+ end
260
+
261
+ end
262
+ end