docusign_admin 1.2.0 → 2.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +35 -0
  3. data/docusign_admin.gemspec +3 -3
  4. data/lib/docusign_admin/api/accounts_api.rb +1 -1
  5. data/lib/docusign_admin/api/bulk_exports_api.rb +1 -1
  6. data/lib/docusign_admin/api/bulk_imports_api.rb +1 -1
  7. data/lib/docusign_admin/api/ds_groups_api.rb +1 -1
  8. data/lib/docusign_admin/api/identity_providers_api.rb +1 -1
  9. data/lib/docusign_admin/api/organizations_api.rb +1 -1
  10. data/lib/docusign_admin/api/product_permission_profiles_api.rb +1 -1
  11. data/lib/docusign_admin/api/provision_asset_group_api.rb +524 -0
  12. data/lib/docusign_admin/api/reserved_domains_api.rb +1 -1
  13. data/lib/docusign_admin/api/users_api.rb +5 -1
  14. data/lib/docusign_admin/client/api_client.rb +10 -10
  15. data/lib/docusign_admin/client/api_error.rb +1 -1
  16. data/lib/docusign_admin/configuration.rb +1 -1
  17. data/lib/docusign_admin/models/add_ds_group_and_users_response.rb +1 -1
  18. data/lib/docusign_admin/models/add_ds_group_users_response.rb +1 -1
  19. data/lib/docusign_admin/models/add_user_response.rb +1 -1
  20. data/lib/docusign_admin/models/add_user_response_account_properties.rb +1 -1
  21. data/lib/docusign_admin/models/address_information.rb +246 -0
  22. data/lib/docusign_admin/models/asset_group_account_clone.rb +370 -0
  23. data/lib/docusign_admin/models/asset_group_account_clone_source_account.rb +219 -0
  24. data/lib/docusign_admin/models/asset_group_account_clone_target_account.rb +234 -0
  25. data/lib/docusign_admin/models/asset_group_account_clone_target_account_admin.rb +248 -0
  26. data/lib/docusign_admin/models/asset_group_account_clones.rb +186 -0
  27. data/lib/docusign_admin/models/asset_group_account_response.rb +254 -0
  28. data/lib/docusign_admin/models/asset_group_accounts_response.rb +186 -0
  29. data/lib/docusign_admin/models/certificate_response.rb +1 -1
  30. data/lib/docusign_admin/models/clone_error_details.rb +204 -0
  31. data/lib/docusign_admin/models/delete_membership_request.rb +1 -1
  32. data/lib/docusign_admin/models/delete_membership_response.rb +1 -1
  33. data/lib/docusign_admin/models/delete_memberships_request.rb +1 -1
  34. data/lib/docusign_admin/models/delete_memberships_response.rb +1 -1
  35. data/lib/docusign_admin/models/delete_response.rb +1 -1
  36. data/lib/docusign_admin/models/delete_user_identity_request.rb +1 -1
  37. data/lib/docusign_admin/models/docu_sign_account_domain_model_address.rb +255 -0
  38. data/lib/docusign_admin/models/domain_response.rb +1 -1
  39. data/lib/docusign_admin/models/domains_response.rb +1 -1
  40. data/lib/docusign_admin/models/ds_group_add_request.rb +1 -1
  41. data/lib/docusign_admin/models/ds_group_and_users_response.rb +1 -1
  42. data/lib/docusign_admin/models/ds_group_list_response.rb +1 -1
  43. data/lib/docusign_admin/models/ds_group_request.rb +1 -1
  44. data/lib/docusign_admin/models/ds_group_response.rb +1 -1
  45. data/lib/docusign_admin/models/ds_group_user_response.rb +1 -1
  46. data/lib/docusign_admin/models/ds_group_users_add_request.rb +1 -1
  47. data/lib/docusign_admin/models/ds_group_users_remove_request.rb +1 -1
  48. data/lib/docusign_admin/models/ds_group_users_response.rb +1 -1
  49. data/lib/docusign_admin/models/error_details.rb +1 -1
  50. data/lib/docusign_admin/models/force_activate_membership_request.rb +1 -1
  51. data/lib/docusign_admin/models/group_request.rb +1 -1
  52. data/lib/docusign_admin/models/identity_provider_response.rb +1 -1
  53. data/lib/docusign_admin/models/identity_providers_response.rb +1 -1
  54. data/lib/docusign_admin/models/individual_membership_data_redaction_request.rb +1 -1
  55. data/lib/docusign_admin/models/individual_user_data_redaction_request.rb +1 -1
  56. data/lib/docusign_admin/models/individual_user_data_redaction_response.rb +1 -1
  57. data/lib/docusign_admin/models/link_response.rb +1 -1
  58. data/lib/docusign_admin/models/member_group_response.rb +1 -1
  59. data/lib/docusign_admin/models/member_groups_response.rb +1 -1
  60. data/lib/docusign_admin/models/membership_data_redaction_request.rb +1 -1
  61. data/lib/docusign_admin/models/membership_data_redaction_response.rb +1 -1
  62. data/lib/docusign_admin/models/membership_response.rb +1 -1
  63. data/lib/docusign_admin/models/new_account_user_request.rb +1 -1
  64. data/lib/docusign_admin/models/new_multi_product_user_add_request.rb +1 -1
  65. data/lib/docusign_admin/models/new_user_request.rb +1 -1
  66. data/lib/docusign_admin/models/new_user_request_account_properties.rb +1 -1
  67. data/lib/docusign_admin/models/new_user_response.rb +1 -1
  68. data/lib/docusign_admin/models/new_user_response_account_properties.rb +1 -1
  69. data/lib/docusign_admin/models/oasirr_error_details.rb +1 -1
  70. data/lib/docusign_admin/models/oasirr_organization_account_settings_error_data_response.rb +1 -1
  71. data/lib/docusign_admin/models/oetr_error_details.rb +1 -1
  72. data/lib/docusign_admin/models/org_export_selected_account.rb +1 -1
  73. data/lib/docusign_admin/models/org_export_selected_domain.rb +1 -1
  74. data/lib/docusign_admin/models/org_report_configuration_response.rb +1 -1
  75. data/lib/docusign_admin/models/org_report_create_response.rb +1 -1
  76. data/lib/docusign_admin/models/org_report_list_response.rb +1 -1
  77. data/lib/docusign_admin/models/org_report_list_response_org_report.rb +1 -1
  78. data/lib/docusign_admin/models/org_report_list_response_requestor.rb +1 -1
  79. data/lib/docusign_admin/models/org_report_request.rb +1 -1
  80. data/lib/docusign_admin/models/organization_account_request.rb +1 -1
  81. data/lib/docusign_admin/models/organization_account_response.rb +1 -1
  82. data/lib/docusign_admin/models/organization_account_settings_import_requestor_response.rb +1 -1
  83. data/lib/docusign_admin/models/organization_account_settings_import_response.rb +1 -1
  84. data/lib/docusign_admin/models/organization_account_settings_import_result_response.rb +1 -1
  85. data/lib/docusign_admin/models/organization_accounts_request.rb +1 -1
  86. data/lib/docusign_admin/models/organization_export_account.rb +1 -1
  87. data/lib/docusign_admin/models/organization_export_domain.rb +1 -1
  88. data/lib/docusign_admin/models/organization_export_request.rb +1 -1
  89. data/lib/docusign_admin/models/organization_export_requestor_response.rb +1 -1
  90. data/lib/docusign_admin/models/organization_export_response.rb +1 -1
  91. data/lib/docusign_admin/models/organization_export_task_response.rb +1 -1
  92. data/lib/docusign_admin/models/organization_exports_response.rb +1 -1
  93. data/lib/docusign_admin/models/organization_import_response.rb +1 -1
  94. data/lib/docusign_admin/models/organization_import_response_error_rollup.rb +1 -1
  95. data/lib/docusign_admin/models/organization_import_response_requestor.rb +1 -1
  96. data/lib/docusign_admin/models/organization_import_response_warning_rollup.rb +1 -1
  97. data/lib/docusign_admin/models/organization_imports_response.rb +1 -1
  98. data/lib/docusign_admin/models/organization_response.rb +1 -1
  99. data/lib/docusign_admin/models/organization_salesforce_account_managers_response.rb +1 -1
  100. data/lib/docusign_admin/models/organization_simple_id_object.rb +1 -1
  101. data/lib/docusign_admin/models/organization_subscription_response.rb +248 -0
  102. data/lib/docusign_admin/models/organization_user_response.rb +1 -1
  103. data/lib/docusign_admin/models/organization_users_response.rb +1 -1
  104. data/lib/docusign_admin/models/organizations_response.rb +1 -1
  105. data/lib/docusign_admin/models/osamr_contact.rb +1 -1
  106. data/lib/docusign_admin/models/paging_response_properties.rb +1 -1
  107. data/lib/docusign_admin/models/permission_profile_request.rb +1 -1
  108. data/lib/docusign_admin/models/permission_profile_response.rb +1 -1
  109. data/lib/docusign_admin/models/permission_profile_response2_1.rb +1 -1
  110. data/lib/docusign_admin/models/permissions_response.rb +1 -1
  111. data/lib/docusign_admin/models/product_permission_profile_request.rb +1 -1
  112. data/lib/docusign_admin/models/product_permission_profile_response.rb +1 -1
  113. data/lib/docusign_admin/models/product_permission_profiles_request.rb +1 -1
  114. data/lib/docusign_admin/models/product_permission_profiles_response.rb +1 -1
  115. data/lib/docusign_admin/models/remove_ds_group_users_response.rb +1 -1
  116. data/lib/docusign_admin/models/remove_user_products_response.rb +1 -1
  117. data/lib/docusign_admin/models/required_attribute_mapping_response.rb +1 -1
  118. data/lib/docusign_admin/models/saml2_identity_provider_response.rb +1 -1
  119. data/lib/docusign_admin/models/setting_response.rb +1 -1
  120. data/lib/docusign_admin/models/sub_account_create_request.rb +192 -0
  121. data/lib/docusign_admin/models/sub_account_create_request_sub_account_creation_subscription.rb +203 -0
  122. data/lib/docusign_admin/models/sub_account_create_request_sub_account_creation_target_account_admin.rb +253 -0
  123. data/lib/docusign_admin/models/sub_account_create_request_sub_account_creation_target_account_details.rb +237 -0
  124. data/lib/docusign_admin/models/sub_account_create_subscription_details.rb +216 -0
  125. data/lib/docusign_admin/models/sub_account_create_subscription_module_details.rb +194 -0
  126. data/lib/docusign_admin/models/sub_account_create_target_account.rb +234 -0
  127. data/lib/docusign_admin/models/sub_account_create_target_account_admin.rb +248 -0
  128. data/lib/docusign_admin/models/sub_account_create_worker.rb +360 -0
  129. data/lib/docusign_admin/models/sub_account_create_worker_response.rb +186 -0
  130. data/lib/docusign_admin/models/sub_account_error_details.rb +204 -0
  131. data/lib/docusign_admin/models/subscription_plan_item_response.rb +210 -0
  132. data/lib/docusign_admin/models/subscription_provision_model_account_create_account_admin.rb +253 -0
  133. data/lib/docusign_admin/models/subscription_provision_model_account_create_create_account_details.rb +271 -0
  134. data/lib/docusign_admin/models/subscription_provision_model_account_create_create_account_subscription_details.rb +203 -0
  135. data/lib/docusign_admin/models/subscription_provision_model_account_create_create_sub_account_details.rb +280 -0
  136. data/lib/docusign_admin/models/subscription_provision_model_asset_group_work.rb +516 -0
  137. data/lib/docusign_admin/models/subscription_provision_model_asset_group_work_result.rb +201 -0
  138. data/lib/docusign_admin/models/subscription_provision_model_change_event.rb +201 -0
  139. data/lib/docusign_admin/models/subscription_provision_model_service_error_details.rb +210 -0
  140. data/lib/docusign_admin/models/update_membership_request.rb +1 -1
  141. data/lib/docusign_admin/models/update_response.rb +1 -1
  142. data/lib/docusign_admin/models/update_user_email_request.rb +1 -1
  143. data/lib/docusign_admin/models/update_user_request.rb +1 -1
  144. data/lib/docusign_admin/models/update_users_email_request.rb +1 -1
  145. data/lib/docusign_admin/models/update_users_request.rb +1 -1
  146. data/lib/docusign_admin/models/user_drilldown_response.rb +1 -1
  147. data/lib/docusign_admin/models/user_identity_request.rb +1 -1
  148. data/lib/docusign_admin/models/user_identity_response.rb +1 -1
  149. data/lib/docusign_admin/models/user_product_permission_profiles_request.rb +1 -1
  150. data/lib/docusign_admin/models/user_product_permission_profiles_response.rb +1 -1
  151. data/lib/docusign_admin/models/user_product_profile_delete_request.rb +1 -1
  152. data/lib/docusign_admin/models/user_update_response.rb +1 -1
  153. data/lib/docusign_admin/models/users_drilldown_response.rb +1 -1
  154. data/lib/docusign_admin/models/users_update_response.rb +1 -1
  155. data/lib/docusign_admin/version.rb +2 -2
  156. data/lib/docusign_admin.rb +32 -1
  157. data/tests/Gemfile +1 -0
  158. metadata +38 -6
@@ -1,5 +1,5 @@
1
1
  =begin
2
- #DocuSign Admin API
2
+ #Docusign Admin API
3
3
 
4
4
  #An API for an organization administrator to manage organizations, accounts and users
5
5
 
@@ -74,6 +74,9 @@ module DocuSign_Admin
74
74
  # Select users whose data have been modified since the date specified; account_id or organization_reserved_domain_id must be specified.
75
75
  attr_accessor :last_modified_since
76
76
 
77
+ # Select users with groups the users belong to; The organization must have entitlement AllowMultiApplication enabled.
78
+ attr_accessor :include_ds_groups
79
+
77
80
  def self.default
78
81
  @@default ||= GetUsersOptions.new
79
82
  end
@@ -644,6 +647,7 @@ module DocuSign_Admin
644
647
  query_params[:'account_id'] = options.account_id if !options.account_id.nil?
645
648
  query_params[:'organization_reserved_domain_id'] = options.organization_reserved_domain_id if !options.organization_reserved_domain_id.nil?
646
649
  query_params[:'last_modified_since'] = options.last_modified_since if !options.last_modified_since.nil?
650
+ query_params[:'include_ds_groups'] = options.include_ds_groups if !options.include_ds_groups.nil?
647
651
 
648
652
  # header parameters
649
653
  header_params = {}
@@ -1,5 +1,5 @@
1
1
  =begin
2
- #DocuSign Admin API
2
+ #Docusign Admin API
3
3
 
4
4
  #An API for an organization administrator to manage organizations, accounts and users
5
5
 
@@ -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.2.0/ruby"
38
+ @user_agent = "Swagger-Codegen/v2.1/2.0.0.rc1/ruby-#{RUBY_VERSION}p#{RUBY_PATCHLEVEL}"
39
39
  @default_headers = {
40
40
  'Content-Type' => "application/json",
41
41
  'User-Agent' => @user_agent
@@ -407,9 +407,9 @@ module DocuSign_Admin
407
407
  #raise ArgumentError.new('oAuthBasePath cannot be empty') unless oauth_base_path
408
408
 
409
409
  # Derive OAuth Base Path if not given
410
- if self.base_path.start_with?("https://demo") or self.base_path.start_with?("http://demo")
410
+ if self.base_path.nil? or self.base_path.start_with?("https://demo") or self.base_path.start_with?("http://demo") or self.base_path.start_with?("https://apps-d") or self.base_path.start_with?("http://apps-d")
411
411
  self.oauth_base_path = OAuth::DEMO_OAUTH_BASE_PATH
412
- elsif self.base_path.start_with?("https://stage") or self.base_path.start_with?("http://stage")
412
+ elsif self.base_path.start_with?("https://stage") or self.base_path.start_with?("http://stage") or self.base_path.start_with?("https://apps-s") or self.base_path.start_with?("http://apps-s")
413
413
  self.oauth_base_path = OAuth::STAGE_OAUTH_BASE_PATH
414
414
  else
415
415
  self.oauth_base_path = OAuth::PRODUCTION_OAUTH_BASE_PATH
@@ -426,7 +426,7 @@ module DocuSign_Admin
426
426
  end
427
427
 
428
428
  # Helper method to configure the OAuth accessCode/implicit flow parameters
429
- # @param [String] client_id DocuSign OAuth Client Id(AKA Integrator Key)
429
+ # @param [String] client_id Docusign OAuth Client Id(AKA Integrator Key)
430
430
  # @param scopes The list of requested scopes. Client applications may be scoped to a limited set of system access.
431
431
  # @param [String] redirect_uri This determines where to deliver the response containing the authorization code
432
432
  # @param [String] response_type Determines the response type of the authorization request, NOTE: these response types are mutually exclusive for a client application. A public/native client application may only request a response type
@@ -446,8 +446,8 @@ module DocuSign_Admin
446
446
  end
447
447
 
448
448
  # Request JWT User Token
449
- # @param [String] client_id DocuSign OAuth Client Id(AKA Integrator Key)
450
- # @param [String] user_id DocuSign user Id to be impersonated
449
+ # @param [String] client_id Docusign OAuth Client Id(AKA Integrator Key)
450
+ # @param [String] user_id Docusign user Id to be impersonated
451
451
  # @param [String] private_key_or_filename the RSA private key
452
452
  # @param [Number] expires_in number of seconds remaining before the JWT assertion is considered as invalid
453
453
  # @param scopes The list of requested scopes. Client applications may be scoped to a limited set of system access.
@@ -497,7 +497,7 @@ module DocuSign_Admin
497
497
  end
498
498
 
499
499
  # Request JWT User Token
500
- # @param [String] client_id DocuSign OAuth Client Id(AKA Integrator Key)
500
+ # @param [String] client_id Docusign OAuth Client Id(AKA Integrator Key)
501
501
  # @param [String] private_key_or_filename the RSA private key
502
502
  # @param [Number] expires_in number of seconds remaining before the JWT assertion is considered as invalid
503
503
  # @param scopes The list of requested scopes. Client applications may be scoped to a limited set of system access.
@@ -559,8 +559,8 @@ module DocuSign_Admin
559
559
  end
560
560
 
561
561
  # GenerateAccessToken will exchange the authorization code for an access token and refresh tokens.
562
- # @param [String] client_id DocuSign OAuth Client Id(AKA Integrator Key)
563
- # @param [String] client_secret The secret key you generated when you set up the integration in DocuSign Admin console.
562
+ # @param [String] client_id Docusign OAuth Client Id(AKA Integrator Key)
563
+ # @param [String] client_secret The secret key you generated when you set up the integration in Docusign Admin console.
564
564
  # @param [String] code The authorization code
565
565
  def generate_access_token(client_id, client_secret, code)
566
566
  raise ArgumentError.new('client_id cannot be empty') if client_id.empty?
@@ -1,5 +1,5 @@
1
1
  =begin
2
- #DocuSign Admin API
2
+ #Docusign Admin API
3
3
 
4
4
  #An API for an organization administrator to manage organizations, accounts and users
5
5
 
@@ -1,5 +1,5 @@
1
1
  =begin
2
- #DocuSign Admin API
2
+ #Docusign Admin API
3
3
 
4
4
  #An API for an organization administrator to manage organizations, accounts and users
5
5
 
@@ -1,5 +1,5 @@
1
1
  =begin
2
- #DocuSign Admin API
2
+ #Docusign Admin API
3
3
 
4
4
  #An API for an organization administrator to manage organizations, accounts and users
5
5
 
@@ -1,5 +1,5 @@
1
1
  =begin
2
- #DocuSign Admin API
2
+ #Docusign Admin API
3
3
 
4
4
  #An API for an organization administrator to manage organizations, accounts and users
5
5
 
@@ -1,5 +1,5 @@
1
1
  =begin
2
- #DocuSign Admin API
2
+ #Docusign Admin API
3
3
 
4
4
  #An API for an organization administrator to manage organizations, accounts and users
5
5
 
@@ -1,5 +1,5 @@
1
1
  =begin
2
- #DocuSign Admin API
2
+ #Docusign Admin API
3
3
 
4
4
  #An API for an organization administrator to manage organizations, accounts and users
5
5
 
@@ -0,0 +1,246 @@
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 AddressInformation
16
+ attr_accessor :street_address
17
+
18
+ attr_accessor :street_address_2
19
+
20
+ attr_accessor :locality
21
+
22
+ attr_accessor :region
23
+
24
+ attr_accessor :postal_code
25
+
26
+ attr_accessor :country
27
+
28
+ attr_accessor :phone
29
+
30
+ attr_accessor :fax
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'street_address' => :'street_address',
36
+ :'street_address_2' => :'street_address_2',
37
+ :'locality' => :'locality',
38
+ :'region' => :'region',
39
+ :'postal_code' => :'postal_code',
40
+ :'country' => :'country',
41
+ :'phone' => :'phone',
42
+ :'fax' => :'fax'
43
+ }
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.swagger_types
48
+ {
49
+ :'street_address' => :'String',
50
+ :'street_address_2' => :'String',
51
+ :'locality' => :'String',
52
+ :'region' => :'String',
53
+ :'postal_code' => :'String',
54
+ :'country' => :'String',
55
+ :'phone' => :'String',
56
+ :'fax' => :'String'
57
+ }
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ return unless attributes.is_a?(Hash)
64
+
65
+ # convert string to symbol for hash key
66
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
67
+
68
+ if attributes.has_key?(:'street_address')
69
+ self.street_address = attributes[:'street_address']
70
+ end
71
+
72
+ if attributes.has_key?(:'street_address_2')
73
+ self.street_address_2 = attributes[:'street_address_2']
74
+ end
75
+
76
+ if attributes.has_key?(:'locality')
77
+ self.locality = attributes[:'locality']
78
+ end
79
+
80
+ if attributes.has_key?(:'region')
81
+ self.region = attributes[:'region']
82
+ end
83
+
84
+ if attributes.has_key?(:'postal_code')
85
+ self.postal_code = attributes[:'postal_code']
86
+ end
87
+
88
+ if attributes.has_key?(:'country')
89
+ self.country = attributes[:'country']
90
+ end
91
+
92
+ if attributes.has_key?(:'phone')
93
+ self.phone = attributes[:'phone']
94
+ end
95
+
96
+ if attributes.has_key?(:'fax')
97
+ self.fax = attributes[:'fax']
98
+ end
99
+ end
100
+
101
+ # Show invalid properties with the reasons. Usually used together with valid?
102
+ # @return Array for valid properties with the reasons
103
+ def list_invalid_properties
104
+ invalid_properties = Array.new
105
+ invalid_properties
106
+ end
107
+
108
+ # Check to see if the all the properties in the model are valid
109
+ # @return true if the model is valid
110
+ def valid?
111
+ true
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ street_address == o.street_address &&
120
+ street_address_2 == o.street_address_2 &&
121
+ locality == o.locality &&
122
+ region == o.region &&
123
+ postal_code == o.postal_code &&
124
+ country == o.country &&
125
+ phone == o.phone &&
126
+ fax == o.fax
127
+ end
128
+
129
+ # @see the `==` method
130
+ # @param [Object] Object to be compared
131
+ def eql?(o)
132
+ self == o
133
+ end
134
+
135
+ # Calculates hash code according to all attributes.
136
+ # @return [Fixnum] Hash code
137
+ def hash
138
+ [street_address, street_address_2, locality, region, postal_code, country, phone, fax].hash
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def build_from_hash(attributes)
145
+ return nil unless attributes.is_a?(Hash)
146
+ self.class.swagger_types.each_pair do |key, type|
147
+ if type =~ /\AArray<(.*)>/i
148
+ # check to ensure the input is an array given that the attribute
149
+ # is documented as an array but the input is not
150
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
151
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
152
+ end
153
+ elsif !attributes[self.class.attribute_map[key]].nil?
154
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
155
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
156
+ end
157
+
158
+ self
159
+ end
160
+
161
+ # Deserializes the data based on type
162
+ # @param string type Data type
163
+ # @param string value Value to be deserialized
164
+ # @return [Object] Deserialized data
165
+ def _deserialize(type, value)
166
+ case type.to_sym
167
+ when :DateTime
168
+ DateTime.parse(value)
169
+ when :Date
170
+ Date.parse(value)
171
+ when :String
172
+ value.to_s
173
+ when :Integer
174
+ value.to_i
175
+ when :Float
176
+ value.to_f
177
+ when :BOOLEAN
178
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
179
+ true
180
+ else
181
+ false
182
+ end
183
+ when :Object
184
+ # generic object (usually a Hash), return directly
185
+ value
186
+ when /\AArray<(?<inner_type>.+)>\z/
187
+ inner_type = Regexp.last_match[:inner_type]
188
+ value.map { |v| _deserialize(inner_type, v) }
189
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
190
+ k_type = Regexp.last_match[:k_type]
191
+ v_type = Regexp.last_match[:v_type]
192
+ {}.tap do |hash|
193
+ value.each do |k, v|
194
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
195
+ end
196
+ end
197
+ else # model
198
+ temp_model = DocuSign_Admin.const_get(type).new
199
+ temp_model.build_from_hash(value)
200
+ end
201
+ end
202
+
203
+ # Returns the string representation of the object
204
+ # @return [String] String presentation of the object
205
+ def to_s
206
+ to_hash.to_s
207
+ end
208
+
209
+ # to_body is an alias to to_hash (backward compatibility)
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_body
212
+ to_hash
213
+ end
214
+
215
+ # Returns the object in the form of hash
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_hash
218
+ hash = {}
219
+ self.class.attribute_map.each_pair do |attr, param|
220
+ value = self.send(attr)
221
+ next if value.nil?
222
+ hash[param] = _to_hash(value)
223
+ end
224
+ hash
225
+ end
226
+
227
+ # Outputs non-array value in the form of hash
228
+ # For object, use to_hash. Otherwise, just return the value
229
+ # @param [Object] value Any valid value
230
+ # @return [Hash] Returns the value in the form of hash
231
+ def _to_hash(value)
232
+ if value.is_a?(Array)
233
+ value.compact.map { |v| _to_hash(v) }
234
+ elsif value.is_a?(Hash)
235
+ {}.tap do |hash|
236
+ value.each { |k, v| hash[k] = _to_hash(v) }
237
+ end
238
+ elsif value.respond_to? :to_hash
239
+ value.to_hash
240
+ else
241
+ value
242
+ end
243
+ end
244
+
245
+ end
246
+ end