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
@@ -0,0 +1,192 @@
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 SubAccountCreateRequest
16
+ attr_accessor :subscription_details
17
+
18
+ attr_accessor :target_account
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'subscription_details' => :'subscriptionDetails',
24
+ :'target_account' => :'targetAccount'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.swagger_types
30
+ {
31
+ :'subscription_details' => :'SubAccountCreateRequestSubAccountCreationSubscription',
32
+ :'target_account' => :'SubAccountCreateRequestSubAccountCreationTargetAccountDetails'
33
+ }
34
+ end
35
+
36
+ # Initializes the object
37
+ # @param [Hash] attributes Model attributes in the form of hash
38
+ def initialize(attributes = {})
39
+ return unless attributes.is_a?(Hash)
40
+
41
+ # convert string to symbol for hash key
42
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
43
+
44
+ if attributes.has_key?(:'subscriptionDetails')
45
+ self.subscription_details = attributes[:'subscriptionDetails']
46
+ end
47
+
48
+ if attributes.has_key?(:'targetAccount')
49
+ self.target_account = attributes[:'targetAccount']
50
+ end
51
+ end
52
+
53
+ # Show invalid properties with the reasons. Usually used together with valid?
54
+ # @return Array for valid properties with the reasons
55
+ def list_invalid_properties
56
+ invalid_properties = Array.new
57
+ invalid_properties
58
+ end
59
+
60
+ # Check to see if the all the properties in the model are valid
61
+ # @return true if the model is valid
62
+ def valid?
63
+ true
64
+ end
65
+
66
+ # Checks equality by comparing each attribute.
67
+ # @param [Object] Object to be compared
68
+ def ==(o)
69
+ return true if self.equal?(o)
70
+ self.class == o.class &&
71
+ subscription_details == o.subscription_details &&
72
+ target_account == o.target_account
73
+ end
74
+
75
+ # @see the `==` method
76
+ # @param [Object] Object to be compared
77
+ def eql?(o)
78
+ self == o
79
+ end
80
+
81
+ # Calculates hash code according to all attributes.
82
+ # @return [Fixnum] Hash code
83
+ def hash
84
+ [subscription_details, target_account].hash
85
+ end
86
+
87
+ # Builds the object from hash
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ # @return [Object] Returns the model itself
90
+ def build_from_hash(attributes)
91
+ return nil unless attributes.is_a?(Hash)
92
+ self.class.swagger_types.each_pair do |key, type|
93
+ if type =~ /\AArray<(.*)>/i
94
+ # check to ensure the input is an array given that the attribute
95
+ # is documented as an array but the input is not
96
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
97
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
98
+ end
99
+ elsif !attributes[self.class.attribute_map[key]].nil?
100
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
101
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
102
+ end
103
+
104
+ self
105
+ end
106
+
107
+ # Deserializes the data based on type
108
+ # @param string type Data type
109
+ # @param string value Value to be deserialized
110
+ # @return [Object] Deserialized data
111
+ def _deserialize(type, value)
112
+ case type.to_sym
113
+ when :DateTime
114
+ DateTime.parse(value)
115
+ when :Date
116
+ Date.parse(value)
117
+ when :String
118
+ value.to_s
119
+ when :Integer
120
+ value.to_i
121
+ when :Float
122
+ value.to_f
123
+ when :BOOLEAN
124
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
125
+ true
126
+ else
127
+ false
128
+ end
129
+ when :Object
130
+ # generic object (usually a Hash), return directly
131
+ value
132
+ when /\AArray<(?<inner_type>.+)>\z/
133
+ inner_type = Regexp.last_match[:inner_type]
134
+ value.map { |v| _deserialize(inner_type, v) }
135
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
136
+ k_type = Regexp.last_match[:k_type]
137
+ v_type = Regexp.last_match[:v_type]
138
+ {}.tap do |hash|
139
+ value.each do |k, v|
140
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
141
+ end
142
+ end
143
+ else # model
144
+ temp_model = DocuSign_Admin.const_get(type).new
145
+ temp_model.build_from_hash(value)
146
+ end
147
+ end
148
+
149
+ # Returns the string representation of the object
150
+ # @return [String] String presentation of the object
151
+ def to_s
152
+ to_hash.to_s
153
+ end
154
+
155
+ # to_body is an alias to to_hash (backward compatibility)
156
+ # @return [Hash] Returns the object in the form of hash
157
+ def to_body
158
+ to_hash
159
+ end
160
+
161
+ # Returns the object in the form of hash
162
+ # @return [Hash] Returns the object in the form of hash
163
+ def to_hash
164
+ hash = {}
165
+ self.class.attribute_map.each_pair do |attr, param|
166
+ value = self.send(attr)
167
+ next if value.nil?
168
+ hash[param] = _to_hash(value)
169
+ end
170
+ hash
171
+ end
172
+
173
+ # Outputs non-array value in the form of hash
174
+ # For object, use to_hash. Otherwise, just return the value
175
+ # @param [Object] value Any valid value
176
+ # @return [Hash] Returns the value in the form of hash
177
+ def _to_hash(value)
178
+ if value.is_a?(Array)
179
+ value.compact.map { |v| _to_hash(v) }
180
+ elsif value.is_a?(Hash)
181
+ {}.tap do |hash|
182
+ value.each { |k, v| hash[k] = _to_hash(v) }
183
+ end
184
+ elsif value.respond_to? :to_hash
185
+ value.to_hash
186
+ else
187
+ value
188
+ end
189
+ end
190
+
191
+ end
192
+ end
@@ -0,0 +1,203 @@
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 SubAccountCreateRequestSubAccountCreationSubscription
16
+ attr_accessor :id
17
+
18
+ attr_accessor :plan_id
19
+
20
+ attr_accessor :modules
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'id' => :'id',
26
+ :'plan_id' => :'planId',
27
+ :'modules' => :'modules'
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.swagger_types
33
+ {
34
+ :'id' => :'String',
35
+ :'plan_id' => :'String',
36
+ :'modules' => :'Array<String>'
37
+ }
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ return unless attributes.is_a?(Hash)
44
+
45
+ # convert string to symbol for hash key
46
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
47
+
48
+ if attributes.has_key?(:'id')
49
+ self.id = attributes[:'id']
50
+ end
51
+
52
+ if attributes.has_key?(:'planId')
53
+ self.plan_id = attributes[:'planId']
54
+ end
55
+
56
+ if attributes.has_key?(:'modules')
57
+ if (value = attributes[:'modules']).is_a?(Array)
58
+ self.modules = value
59
+ end
60
+ end
61
+ end
62
+
63
+ # Show invalid properties with the reasons. Usually used together with valid?
64
+ # @return Array for valid properties with the reasons
65
+ def list_invalid_properties
66
+ invalid_properties = Array.new
67
+ invalid_properties
68
+ end
69
+
70
+ # Check to see if the all the properties in the model are valid
71
+ # @return true if the model is valid
72
+ def valid?
73
+ true
74
+ end
75
+
76
+ # Checks equality by comparing each attribute.
77
+ # @param [Object] Object to be compared
78
+ def ==(o)
79
+ return true if self.equal?(o)
80
+ self.class == o.class &&
81
+ id == o.id &&
82
+ plan_id == o.plan_id &&
83
+ modules == o.modules
84
+ end
85
+
86
+ # @see the `==` method
87
+ # @param [Object] Object to be compared
88
+ def eql?(o)
89
+ self == o
90
+ end
91
+
92
+ # Calculates hash code according to all attributes.
93
+ # @return [Fixnum] Hash code
94
+ def hash
95
+ [id, plan_id, modules].hash
96
+ end
97
+
98
+ # Builds the object from hash
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ # @return [Object] Returns the model itself
101
+ def build_from_hash(attributes)
102
+ return nil unless attributes.is_a?(Hash)
103
+ self.class.swagger_types.each_pair do |key, type|
104
+ if type =~ /\AArray<(.*)>/i
105
+ # check to ensure the input is an array given that the attribute
106
+ # is documented as an array but the input is not
107
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
108
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
109
+ end
110
+ elsif !attributes[self.class.attribute_map[key]].nil?
111
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
112
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
113
+ end
114
+
115
+ self
116
+ end
117
+
118
+ # Deserializes the data based on type
119
+ # @param string type Data type
120
+ # @param string value Value to be deserialized
121
+ # @return [Object] Deserialized data
122
+ def _deserialize(type, value)
123
+ case type.to_sym
124
+ when :DateTime
125
+ DateTime.parse(value)
126
+ when :Date
127
+ Date.parse(value)
128
+ when :String
129
+ value.to_s
130
+ when :Integer
131
+ value.to_i
132
+ when :Float
133
+ value.to_f
134
+ when :BOOLEAN
135
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
136
+ true
137
+ else
138
+ false
139
+ end
140
+ when :Object
141
+ # generic object (usually a Hash), return directly
142
+ value
143
+ when /\AArray<(?<inner_type>.+)>\z/
144
+ inner_type = Regexp.last_match[:inner_type]
145
+ value.map { |v| _deserialize(inner_type, v) }
146
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
147
+ k_type = Regexp.last_match[:k_type]
148
+ v_type = Regexp.last_match[:v_type]
149
+ {}.tap do |hash|
150
+ value.each do |k, v|
151
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
152
+ end
153
+ end
154
+ else # model
155
+ temp_model = DocuSign_Admin.const_get(type).new
156
+ temp_model.build_from_hash(value)
157
+ end
158
+ end
159
+
160
+ # Returns the string representation of the object
161
+ # @return [String] String presentation of the object
162
+ def to_s
163
+ to_hash.to_s
164
+ end
165
+
166
+ # to_body is an alias to to_hash (backward compatibility)
167
+ # @return [Hash] Returns the object in the form of hash
168
+ def to_body
169
+ to_hash
170
+ end
171
+
172
+ # Returns the object in the form of hash
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_hash
175
+ hash = {}
176
+ self.class.attribute_map.each_pair do |attr, param|
177
+ value = self.send(attr)
178
+ next if value.nil?
179
+ hash[param] = _to_hash(value)
180
+ end
181
+ hash
182
+ end
183
+
184
+ # Outputs non-array value in the form of hash
185
+ # For object, use to_hash. Otherwise, just return the value
186
+ # @param [Object] value Any valid value
187
+ # @return [Hash] Returns the value in the form of hash
188
+ def _to_hash(value)
189
+ if value.is_a?(Array)
190
+ value.compact.map { |v| _to_hash(v) }
191
+ elsif value.is_a?(Hash)
192
+ {}.tap do |hash|
193
+ value.each { |k, v| hash[k] = _to_hash(v) }
194
+ end
195
+ elsif value.respond_to? :to_hash
196
+ value.to_hash
197
+ else
198
+ value
199
+ end
200
+ end
201
+
202
+ end
203
+ end
@@ -0,0 +1,253 @@
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 SubAccountCreateRequestSubAccountCreationTargetAccountAdmin
16
+ attr_accessor :address
17
+
18
+ attr_accessor :email
19
+
20
+ attr_accessor :first_name
21
+
22
+ attr_accessor :last_name
23
+
24
+ attr_accessor :locale
25
+
26
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'address' => :'address',
52
+ :'email' => :'email',
53
+ :'first_name' => :'firstName',
54
+ :'last_name' => :'lastName',
55
+ :'locale' => :'locale'
56
+ }
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.swagger_types
61
+ {
62
+ :'address' => :'AddressInformation',
63
+ :'email' => :'String',
64
+ :'first_name' => :'String',
65
+ :'last_name' => :'String',
66
+ :'locale' => :'String'
67
+ }
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ return unless attributes.is_a?(Hash)
74
+
75
+ # convert string to symbol for hash key
76
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
77
+
78
+ if attributes.has_key?(:'address')
79
+ self.address = attributes[:'address']
80
+ end
81
+
82
+ if attributes.has_key?(:'email')
83
+ self.email = attributes[:'email']
84
+ end
85
+
86
+ if attributes.has_key?(:'firstName')
87
+ self.first_name = attributes[:'firstName']
88
+ end
89
+
90
+ if attributes.has_key?(:'lastName')
91
+ self.last_name = attributes[:'lastName']
92
+ end
93
+
94
+ if attributes.has_key?(:'locale')
95
+ self.locale = attributes[:'locale']
96
+ end
97
+ end
98
+
99
+ # Show invalid properties with the reasons. Usually used together with valid?
100
+ # @return Array for valid properties with the reasons
101
+ def list_invalid_properties
102
+ invalid_properties = Array.new
103
+ invalid_properties
104
+ end
105
+
106
+ # Check to see if the all the properties in the model are valid
107
+ # @return true if the model is valid
108
+ def valid?
109
+ locale_validator = EnumAttributeValidator.new('String', ['None', 'zh_cn', 'zh_tw', 'nl', 'en', 'fr', 'de', 'it', 'ja', 'ko', 'pt', 'pt_br', 'ru', 'es', 'pl'])
110
+ return false unless locale_validator.valid?(@locale)
111
+ true
112
+ end
113
+
114
+ # Custom attribute writer method checking allowed values (enum).
115
+ # @param [Object] locale Object to be assigned
116
+ def locale=(locale)
117
+ validator = EnumAttributeValidator.new('String', ['None', 'zh_cn', 'zh_tw', 'nl', 'en', 'fr', 'de', 'it', 'ja', 'ko', 'pt', 'pt_br', 'ru', 'es', 'pl'])
118
+ unless validator.valid?(locale)
119
+ fail ArgumentError, 'invalid value for "locale", must be one of #{validator.allowable_values}.'
120
+ end
121
+ @locale = locale
122
+ end
123
+
124
+ # Checks equality by comparing each attribute.
125
+ # @param [Object] Object to be compared
126
+ def ==(o)
127
+ return true if self.equal?(o)
128
+ self.class == o.class &&
129
+ address == o.address &&
130
+ email == o.email &&
131
+ first_name == o.first_name &&
132
+ last_name == o.last_name &&
133
+ locale == o.locale
134
+ end
135
+
136
+ # @see the `==` method
137
+ # @param [Object] Object to be compared
138
+ def eql?(o)
139
+ self == o
140
+ end
141
+
142
+ # Calculates hash code according to all attributes.
143
+ # @return [Fixnum] Hash code
144
+ def hash
145
+ [address, email, first_name, last_name, locale].hash
146
+ end
147
+
148
+ # Builds the object from hash
149
+ # @param [Hash] attributes Model attributes in the form of hash
150
+ # @return [Object] Returns the model itself
151
+ def build_from_hash(attributes)
152
+ return nil unless attributes.is_a?(Hash)
153
+ self.class.swagger_types.each_pair do |key, type|
154
+ if type =~ /\AArray<(.*)>/i
155
+ # check to ensure the input is an array given that the attribute
156
+ # is documented as an array but the input is not
157
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
158
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
159
+ end
160
+ elsif !attributes[self.class.attribute_map[key]].nil?
161
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
162
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
163
+ end
164
+
165
+ self
166
+ end
167
+
168
+ # Deserializes the data based on type
169
+ # @param string type Data type
170
+ # @param string value Value to be deserialized
171
+ # @return [Object] Deserialized data
172
+ def _deserialize(type, value)
173
+ case type.to_sym
174
+ when :DateTime
175
+ DateTime.parse(value)
176
+ when :Date
177
+ Date.parse(value)
178
+ when :String
179
+ value.to_s
180
+ when :Integer
181
+ value.to_i
182
+ when :Float
183
+ value.to_f
184
+ when :BOOLEAN
185
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
186
+ true
187
+ else
188
+ false
189
+ end
190
+ when :Object
191
+ # generic object (usually a Hash), return directly
192
+ value
193
+ when /\AArray<(?<inner_type>.+)>\z/
194
+ inner_type = Regexp.last_match[:inner_type]
195
+ value.map { |v| _deserialize(inner_type, v) }
196
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
197
+ k_type = Regexp.last_match[:k_type]
198
+ v_type = Regexp.last_match[:v_type]
199
+ {}.tap do |hash|
200
+ value.each do |k, v|
201
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
202
+ end
203
+ end
204
+ else # model
205
+ temp_model = DocuSign_Admin.const_get(type).new
206
+ temp_model.build_from_hash(value)
207
+ end
208
+ end
209
+
210
+ # Returns the string representation of the object
211
+ # @return [String] String presentation of the object
212
+ def to_s
213
+ to_hash.to_s
214
+ end
215
+
216
+ # to_body is an alias to to_hash (backward compatibility)
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_body
219
+ to_hash
220
+ end
221
+
222
+ # Returns the object in the form of hash
223
+ # @return [Hash] Returns the object in the form of hash
224
+ def to_hash
225
+ hash = {}
226
+ self.class.attribute_map.each_pair do |attr, param|
227
+ value = self.send(attr)
228
+ next if value.nil?
229
+ hash[param] = _to_hash(value)
230
+ end
231
+ hash
232
+ end
233
+
234
+ # Outputs non-array value in the form of hash
235
+ # For object, use to_hash. Otherwise, just return the value
236
+ # @param [Object] value Any valid value
237
+ # @return [Hash] Returns the value in the form of hash
238
+ def _to_hash(value)
239
+ if value.is_a?(Array)
240
+ value.compact.map { |v| _to_hash(v) }
241
+ elsif value.is_a?(Hash)
242
+ {}.tap do |hash|
243
+ value.each { |k, v| hash[k] = _to_hash(v) }
244
+ end
245
+ elsif value.respond_to? :to_hash
246
+ value.to_hash
247
+ else
248
+ value
249
+ end
250
+ end
251
+
252
+ end
253
+ end