docusign_admin 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/docusign_admin/api/accounts_api.rb +55 -0
- data/lib/docusign_admin/api/bulk_imports_api.rb +28 -17
- data/lib/docusign_admin/api/organizations_api.rb +79 -0
- data/lib/docusign_admin/client/api_client.rb +3 -6
- data/lib/docusign_admin/models/individual_membership_data_redaction_request.rb +183 -0
- data/lib/docusign_admin/models/individual_user_data_redaction_request.rb +194 -0
- data/lib/docusign_admin/models/individual_user_data_redaction_response.rb +237 -0
- data/lib/docusign_admin/models/membership_data_redaction_request.rb +183 -0
- data/lib/docusign_admin/models/membership_data_redaction_response.rb +226 -0
- data/lib/docusign_admin/version.rb +1 -1
- data/lib/docusign_admin.rb +6 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c062d94ed05bf441d92c28560111f91530e246efb42a032232152d1234f4afd
|
4
|
+
data.tar.gz: 76ce3cb71f7b81a786b8572ede1f476c547c4cb933d9f05eb57d5be73e1876a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e3a312d159e247e9477ad8413f1e0e1205caeb38abd3d4d6f65506cc43f720ea4446875402b39ef430b7a92b95717d653d675346403ada36f41666b7b1084f4
|
7
|
+
data.tar.gz: 5e69fa3cdc7157565ff3e829dd52c587483986b054188f5d752cd9cccbd07e657da52841d68d465a3d32a372d2029bb46967cdf7c3058fd013d33bde727a13cf
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## [v1.2.0] - Admin API v2.1-1.2.0 - 2023-05-21
|
2
|
+
### Changed
|
3
|
+
- Added support for version v2.1-1.2.0 of the DocuSign Admin API.
|
4
|
+
- Updated the SDK release version.
|
5
|
+
|
1
6
|
## [v1.1.0] - Admin API v2.1-1.1.0 - 2022-04-26
|
2
7
|
### Changed
|
3
8
|
- Added support for version v2.1-1.1.0 of the DocuSign Admin API.
|
@@ -209,5 +209,60 @@ module DocuSign_Admin
|
|
209
209
|
end
|
210
210
|
return data, status_code, headers
|
211
211
|
end
|
212
|
+
|
213
|
+
# Redacts membership data for users with memberships in an account.
|
214
|
+
# Required scopes: user_data_redact
|
215
|
+
# @param account_id The account ID Guid
|
216
|
+
# @param request_model The request body describing the membership to be redacted
|
217
|
+
# @return [IndividualUserDataRedactionResponse]
|
218
|
+
def redact_individual_membership_data(account_id, request_model)
|
219
|
+
data, _status_code, _headers = redact_individual_membership_data_with_http_info(account_id, request_model)
|
220
|
+
return data
|
221
|
+
end
|
222
|
+
|
223
|
+
# Redacts membership data for users with memberships in an account.
|
224
|
+
# Required scopes: user_data_redact
|
225
|
+
# @param account_id The account ID Guid
|
226
|
+
# @param request_model The request body describing the membership to be redacted
|
227
|
+
# @return [Array<(IndividualUserDataRedactionResponse, Fixnum, Hash)>] IndividualUserDataRedactionResponse data, response status code and response headers
|
228
|
+
def redact_individual_membership_data_with_http_info(account_id, request_model)
|
229
|
+
if @api_client.config.debugging
|
230
|
+
@api_client.config.logger.debug "Calling API: AccountsApi.redact_individual_membership_data ..."
|
231
|
+
end
|
232
|
+
# verify the required parameter 'account_id' is set
|
233
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.redact_individual_membership_data" if account_id.nil?
|
234
|
+
# verify the required parameter 'request_model' is set
|
235
|
+
fail ArgumentError, "Missing the required parameter 'request_model' when calling AccountsApi.redact_individual_membership_data" if request_model.nil?
|
236
|
+
# resource path
|
237
|
+
local_var_path = "/v2/data_redaction/accounts/{accountId}/user".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s)
|
238
|
+
|
239
|
+
# query parameters
|
240
|
+
query_params = {}
|
241
|
+
|
242
|
+
# header parameters
|
243
|
+
header_params = {}
|
244
|
+
# HTTP header 'Accept' (if needed)
|
245
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
246
|
+
# HTTP header 'Content-Type'
|
247
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
248
|
+
|
249
|
+
# form parameters
|
250
|
+
form_params = {}
|
251
|
+
|
252
|
+
# http body (model)
|
253
|
+
post_body = @api_client.object_to_http_body(request_model)
|
254
|
+
auth_names = []
|
255
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
256
|
+
:header_params => header_params,
|
257
|
+
:query_params => query_params,
|
258
|
+
:form_params => form_params,
|
259
|
+
:body => post_body,
|
260
|
+
:auth_names => auth_names,
|
261
|
+
:return_type => 'IndividualUserDataRedactionResponse')
|
262
|
+
if @api_client.config.debugging
|
263
|
+
@api_client.config.logger.debug "API called: AccountsApi#redact_individual_membership_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
264
|
+
end
|
265
|
+
return data, status_code, headers
|
266
|
+
end
|
212
267
|
end
|
213
268
|
end
|
@@ -24,7 +24,7 @@ module DocuSign_Admin
|
|
24
24
|
# Creates a new account settings import request.
|
25
25
|
# Required scopes: account_write
|
26
26
|
# @param organization_id The organization ID Guid
|
27
|
-
# @param file_csv CSV file.
|
27
|
+
# @param file_csv CSV file.
|
28
28
|
# @return [OrganizationAccountSettingsImportResponse]
|
29
29
|
def add_bulk_account_settings_import(organization_id, file_csv)
|
30
30
|
data, _status_code, _headers = add_bulk_account_settings_import_with_http_info(organization_id, file_csv)
|
@@ -34,7 +34,7 @@ module DocuSign_Admin
|
|
34
34
|
# Creates a new account settings import request.
|
35
35
|
# Required scopes: account_write
|
36
36
|
# @param organization_id The organization ID Guid
|
37
|
-
# @param file_csv CSV file.
|
37
|
+
# @param file_csv CSV file.
|
38
38
|
# @return [Array<(OrganizationAccountSettingsImportResponse, Fixnum, Hash)>] OrganizationAccountSettingsImportResponse data, response status code and response headers
|
39
39
|
def add_bulk_account_settings_import_with_http_info(organization_id, file_csv)
|
40
40
|
if @api_client.config.debugging
|
@@ -80,7 +80,7 @@ module DocuSign_Admin
|
|
80
80
|
# Import request for adding users to accounts within the organization.
|
81
81
|
# Required scopes: user_write
|
82
82
|
# @param organization_id The organization ID Guid
|
83
|
-
# @param file_csv CSV file.
|
83
|
+
# @param file_csv CSV file.
|
84
84
|
# @return [OrganizationImportResponse]
|
85
85
|
def create_bulk_import_add_users_request(organization_id, file_csv)
|
86
86
|
data, _status_code, _headers = create_bulk_import_add_users_request_with_http_info(organization_id, file_csv)
|
@@ -90,7 +90,7 @@ module DocuSign_Admin
|
|
90
90
|
# Import request for adding users to accounts within the organization.
|
91
91
|
# Required scopes: user_write
|
92
92
|
# @param organization_id The organization ID Guid
|
93
|
-
# @param file_csv CSV file.
|
93
|
+
# @param file_csv CSV file.
|
94
94
|
# @return [Array<(OrganizationImportResponse, Fixnum, Hash)>] OrganizationImportResponse data, response status code and response headers
|
95
95
|
def create_bulk_import_add_users_request_with_http_info(organization_id, file_csv)
|
96
96
|
if @api_client.config.debugging
|
@@ -136,22 +136,26 @@ module DocuSign_Admin
|
|
136
136
|
# Closes the Bulk User Import request
|
137
137
|
# Required scopes: user_write
|
138
138
|
# @param organization_id The organization ID Guid
|
139
|
+
# @param file_csv CSV file.
|
139
140
|
# @return [OrganizationImportResponse]
|
140
|
-
def create_bulk_import_close_users_request(organization_id)
|
141
|
-
data, _status_code, _headers = create_bulk_import_close_users_request_with_http_info(organization_id)
|
141
|
+
def create_bulk_import_close_users_request(organization_id, file_csv)
|
142
|
+
data, _status_code, _headers = create_bulk_import_close_users_request_with_http_info(organization_id, file_csv)
|
142
143
|
return data
|
143
144
|
end
|
144
145
|
|
145
146
|
# Closes the Bulk User Import request
|
146
147
|
# Required scopes: user_write
|
147
148
|
# @param organization_id The organization ID Guid
|
149
|
+
# @param file_csv CSV file.
|
148
150
|
# @return [Array<(OrganizationImportResponse, Fixnum, Hash)>] OrganizationImportResponse data, response status code and response headers
|
149
|
-
def create_bulk_import_close_users_request_with_http_info(organization_id)
|
151
|
+
def create_bulk_import_close_users_request_with_http_info(organization_id, file_csv)
|
150
152
|
if @api_client.config.debugging
|
151
153
|
@api_client.config.logger.debug "Calling API: BulkImportsApi.create_bulk_import_close_users_request ..."
|
152
154
|
end
|
153
155
|
# verify the required parameter 'organization_id' is set
|
154
156
|
fail ArgumentError, "Missing the required parameter 'organization_id' when calling BulkImportsApi.create_bulk_import_close_users_request" if organization_id.nil?
|
157
|
+
# verify the required parameter 'file_csv' is set
|
158
|
+
fail ArgumentError, "Missing the required parameter 'file_csv' when calling BulkImportsApi.create_bulk_import_close_users_request" if file_csv.nil?
|
155
159
|
# resource path
|
156
160
|
local_var_path = "/v2/organizations/{organizationId}/imports/bulk_users/close".sub('{format}','json').sub('{' + 'organizationId' + '}', organization_id.to_s)
|
157
161
|
|
@@ -163,10 +167,11 @@ module DocuSign_Admin
|
|
163
167
|
# HTTP header 'Accept' (if needed)
|
164
168
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
165
169
|
# HTTP header 'Content-Type'
|
166
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['
|
170
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
167
171
|
|
168
172
|
# form parameters
|
169
173
|
form_params = {}
|
174
|
+
form_params["file.csv"] = file_csv
|
170
175
|
|
171
176
|
# http body (model)
|
172
177
|
post_body = nil
|
@@ -239,9 +244,10 @@ module DocuSign_Admin
|
|
239
244
|
# Required scopes: user_write
|
240
245
|
# @param organization_id The organization ID Guid
|
241
246
|
# @param account_id The account ID Guid
|
247
|
+
# @param file_csv CSV file.
|
242
248
|
# @return [OrganizationImportResponse]
|
243
|
-
def create_bulk_import_single_account_add_users_request(organization_id, account_id)
|
244
|
-
data, _status_code, _headers = create_bulk_import_single_account_add_users_request_with_http_info(organization_id, account_id)
|
249
|
+
def create_bulk_import_single_account_add_users_request(organization_id, account_id, file_csv)
|
250
|
+
data, _status_code, _headers = create_bulk_import_single_account_add_users_request_with_http_info(organization_id, account_id, file_csv)
|
245
251
|
return data
|
246
252
|
end
|
247
253
|
|
@@ -249,8 +255,9 @@ module DocuSign_Admin
|
|
249
255
|
# Required scopes: user_write
|
250
256
|
# @param organization_id The organization ID Guid
|
251
257
|
# @param account_id The account ID Guid
|
258
|
+
# @param file_csv CSV file.
|
252
259
|
# @return [Array<(OrganizationImportResponse, Fixnum, Hash)>] OrganizationImportResponse data, response status code and response headers
|
253
|
-
def create_bulk_import_single_account_add_users_request_with_http_info(organization_id, account_id)
|
260
|
+
def create_bulk_import_single_account_add_users_request_with_http_info(organization_id, account_id, file_csv)
|
254
261
|
if @api_client.config.debugging
|
255
262
|
@api_client.config.logger.debug "Calling API: BulkImportsApi.create_bulk_import_single_account_add_users_request ..."
|
256
263
|
end
|
@@ -297,9 +304,10 @@ module DocuSign_Admin
|
|
297
304
|
# Required scopes: user_write
|
298
305
|
# @param organization_id The organization ID Guid
|
299
306
|
# @param account_id The account ID Guid
|
307
|
+
# @param file_csv CSV file.
|
300
308
|
# @return [OrganizationImportResponse]
|
301
|
-
def create_bulk_import_single_account_update_users_request(organization_id, account_id)
|
302
|
-
data, _status_code, _headers = create_bulk_import_single_account_update_users_request_with_http_info(organization_id, account_id)
|
309
|
+
def create_bulk_import_single_account_update_users_request(organization_id, account_id, file_csv)
|
310
|
+
data, _status_code, _headers = create_bulk_import_single_account_update_users_request_with_http_info(organization_id, account_id, file_csv)
|
303
311
|
return data
|
304
312
|
end
|
305
313
|
|
@@ -307,8 +315,9 @@ module DocuSign_Admin
|
|
307
315
|
# Required scopes: user_write
|
308
316
|
# @param organization_id The organization ID Guid
|
309
317
|
# @param account_id The account ID Guid
|
318
|
+
# @param file_csv CSV file.
|
310
319
|
# @return [Array<(OrganizationImportResponse, Fixnum, Hash)>] OrganizationImportResponse data, response status code and response headers
|
311
|
-
def create_bulk_import_single_account_update_users_request_with_http_info(organization_id, account_id)
|
320
|
+
def create_bulk_import_single_account_update_users_request_with_http_info(organization_id, account_id, file_csv)
|
312
321
|
if @api_client.config.debugging
|
313
322
|
@api_client.config.logger.debug "Calling API: BulkImportsApi.create_bulk_import_single_account_update_users_request ..."
|
314
323
|
end
|
@@ -354,17 +363,19 @@ module DocuSign_Admin
|
|
354
363
|
# Import request for updating users to accounts within the organization.
|
355
364
|
# Required scopes: user_write
|
356
365
|
# @param organization_id The organization ID Guid
|
366
|
+
# @param file_csv CSV file.
|
357
367
|
# @return [OrganizationImportResponse]
|
358
|
-
def create_bulk_import_update_users_request(organization_id)
|
359
|
-
data, _status_code, _headers = create_bulk_import_update_users_request_with_http_info(organization_id)
|
368
|
+
def create_bulk_import_update_users_request(organization_id, file_csv)
|
369
|
+
data, _status_code, _headers = create_bulk_import_update_users_request_with_http_info(organization_id, file_csv)
|
360
370
|
return data
|
361
371
|
end
|
362
372
|
|
363
373
|
# Import request for updating users to accounts within the organization.
|
364
374
|
# Required scopes: user_write
|
365
375
|
# @param organization_id The organization ID Guid
|
376
|
+
# @param file_csv CSV file.
|
366
377
|
# @return [Array<(OrganizationImportResponse, Fixnum, Hash)>] OrganizationImportResponse data, response status code and response headers
|
367
|
-
def create_bulk_import_update_users_request_with_http_info(organization_id)
|
378
|
+
def create_bulk_import_update_users_request_with_http_info(organization_id, file_csv)
|
368
379
|
if @api_client.config.debugging
|
369
380
|
@api_client.config.logger.debug "Calling API: BulkImportsApi.create_bulk_import_update_users_request ..."
|
370
381
|
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
=begin
|
2
|
+
#DocuSign Admin API
|
3
|
+
|
4
|
+
#An API for an organization administrator to manage organizations, accounts and users
|
5
|
+
|
6
|
+
OpenAPI spec version: v2.1
|
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_Admin
|
15
|
+
|
16
|
+
|
17
|
+
class OrganizationsApi
|
18
|
+
attr_accessor :api_client
|
19
|
+
|
20
|
+
def initialize(api_client = OrganizationsApi.default)
|
21
|
+
@api_client = api_client
|
22
|
+
end
|
23
|
+
|
24
|
+
# Redacts membership and user data for users in an organization.
|
25
|
+
# Required scopes: user_data_redact
|
26
|
+
# @param organization_id The organization ID Guid
|
27
|
+
# @param request_model The request body describing the users and memberships to be redacted
|
28
|
+
# @return [IndividualUserDataRedactionResponse]
|
29
|
+
def redact_individual_user_data(organization_id, request_model)
|
30
|
+
data, _status_code, _headers = redact_individual_user_data_with_http_info(organization_id, request_model)
|
31
|
+
return data
|
32
|
+
end
|
33
|
+
|
34
|
+
# Redacts membership and user data for users in an organization.
|
35
|
+
# Required scopes: user_data_redact
|
36
|
+
# @param organization_id The organization ID Guid
|
37
|
+
# @param request_model The request body describing the users and memberships to be redacted
|
38
|
+
# @return [Array<(IndividualUserDataRedactionResponse, Fixnum, Hash)>] IndividualUserDataRedactionResponse data, response status code and response headers
|
39
|
+
def redact_individual_user_data_with_http_info(organization_id, request_model)
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug "Calling API: OrganizationsApi.redact_individual_user_data ..."
|
42
|
+
end
|
43
|
+
# verify the required parameter 'organization_id' is set
|
44
|
+
fail ArgumentError, "Missing the required parameter 'organization_id' when calling OrganizationsApi.redact_individual_user_data" if organization_id.nil?
|
45
|
+
# verify the required parameter 'request_model' is set
|
46
|
+
fail ArgumentError, "Missing the required parameter 'request_model' when calling OrganizationsApi.redact_individual_user_data" if request_model.nil?
|
47
|
+
# resource path
|
48
|
+
local_var_path = "/v2/data_redaction/organizations/{organizationId}/user".sub('{format}','json').sub('{' + 'organizationId' + '}', organization_id.to_s)
|
49
|
+
|
50
|
+
# query parameters
|
51
|
+
query_params = {}
|
52
|
+
|
53
|
+
# header parameters
|
54
|
+
header_params = {}
|
55
|
+
# HTTP header 'Accept' (if needed)
|
56
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
57
|
+
# HTTP header 'Content-Type'
|
58
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
59
|
+
|
60
|
+
# form parameters
|
61
|
+
form_params = {}
|
62
|
+
|
63
|
+
# http body (model)
|
64
|
+
post_body = @api_client.object_to_http_body(request_model)
|
65
|
+
auth_names = []
|
66
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
67
|
+
:header_params => header_params,
|
68
|
+
:query_params => query_params,
|
69
|
+
:form_params => form_params,
|
70
|
+
:body => post_body,
|
71
|
+
:auth_names => auth_names,
|
72
|
+
:return_type => 'IndividualUserDataRedactionResponse')
|
73
|
+
if @api_client.config.debugging
|
74
|
+
@api_client.config.logger.debug "API called: OrganizationsApi#redact_individual_user_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
75
|
+
end
|
76
|
+
return data, status_code, headers
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -35,7 +35,7 @@ module DocuSign_Admin
|
|
35
35
|
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
36
36
|
def initialize(config = Configuration.default)
|
37
37
|
@config = config
|
38
|
-
@user_agent = "Swagger-Codegen/1.
|
38
|
+
@user_agent = "Swagger-Codegen/1.2.0/ruby"
|
39
39
|
@default_headers = {
|
40
40
|
'Content-Type' => "application/json",
|
41
41
|
'User-Agent' => @user_agent
|
@@ -107,10 +107,6 @@ module DocuSign_Admin
|
|
107
107
|
# set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
|
108
108
|
_verify_ssl_host = @config.verify_ssl_host ? 2 : 0
|
109
109
|
|
110
|
-
if header_params['Content-Type'] == 'multipart/form-data'
|
111
|
-
header_params['Content-Disposition'] = 'form-data; name=file; filename=file.csv'
|
112
|
-
end
|
113
|
-
|
114
110
|
req_opts = {
|
115
111
|
:method => http_method,
|
116
112
|
:headers => header_params,
|
@@ -285,7 +281,8 @@ module DocuSign_Admin
|
|
285
281
|
# let typhoeus handle File, Array and nil parameters
|
286
282
|
data[key] = value
|
287
283
|
else
|
288
|
-
if
|
284
|
+
if header_params['Content-Type'] == 'multipart/form-data'
|
285
|
+
header_params['Content-Disposition'] = 'form-data; name=file; filename=' + key
|
289
286
|
data = value
|
290
287
|
else
|
291
288
|
data[key] = value.to_s
|
@@ -0,0 +1,183 @@
|
|
1
|
+
=begin
|
2
|
+
#DocuSign Admin API
|
3
|
+
|
4
|
+
#An API for an organization administrator to manage organizations, accounts and users
|
5
|
+
|
6
|
+
OpenAPI spec version: v2.1
|
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_Admin
|
15
|
+
class IndividualMembershipDataRedactionRequest
|
16
|
+
attr_accessor :user_id
|
17
|
+
|
18
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
19
|
+
def self.attribute_map
|
20
|
+
{
|
21
|
+
:'user_id' => :'user_id'
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
# Attribute type mapping.
|
26
|
+
def self.swagger_types
|
27
|
+
{
|
28
|
+
:'user_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?(:'user_id')
|
41
|
+
self.user_id = attributes[:'user_id']
|
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
|
+
user_id == o.user_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
|
+
[user_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_Admin.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
|