docusign_admin 1.3.0 → 2.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -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 +251 -7
  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 +6 -6
  23. data/lib/docusign_admin/models/asset_group_account_clone_source_account.rb +1 -1
  24. data/lib/docusign_admin/models/asset_group_account_clone_target_account.rb +1 -1
  25. data/lib/docusign_admin/models/asset_group_account_clone_target_account_admin.rb +1 -1
  26. data/lib/docusign_admin/models/asset_group_account_clones.rb +1 -1
  27. data/lib/docusign_admin/models/asset_group_account_response.rb +1 -1
  28. data/lib/docusign_admin/models/asset_group_accounts_response.rb +1 -1
  29. data/lib/docusign_admin/models/certificate_response.rb +1 -1
  30. data/lib/docusign_admin/models/delete_membership_request.rb +1 -1
  31. data/lib/docusign_admin/models/delete_membership_response.rb +1 -1
  32. data/lib/docusign_admin/models/delete_memberships_request.rb +1 -1
  33. data/lib/docusign_admin/models/delete_memberships_response.rb +1 -1
  34. data/lib/docusign_admin/models/delete_response.rb +1 -1
  35. data/lib/docusign_admin/models/delete_user_identity_request.rb +1 -1
  36. data/lib/docusign_admin/models/docu_sign_account_domain_model_address.rb +255 -0
  37. data/lib/docusign_admin/models/domain_response.rb +1 -1
  38. data/lib/docusign_admin/models/domains_response.rb +1 -1
  39. data/lib/docusign_admin/models/ds_group_add_request.rb +1 -1
  40. data/lib/docusign_admin/models/ds_group_and_users_response.rb +1 -1
  41. data/lib/docusign_admin/models/ds_group_list_response.rb +1 -1
  42. data/lib/docusign_admin/models/ds_group_request.rb +1 -1
  43. data/lib/docusign_admin/models/ds_group_response.rb +1 -1
  44. data/lib/docusign_admin/models/ds_group_user_response.rb +1 -1
  45. data/lib/docusign_admin/models/ds_group_users_add_request.rb +1 -1
  46. data/lib/docusign_admin/models/ds_group_users_remove_request.rb +1 -1
  47. data/lib/docusign_admin/models/ds_group_users_response.rb +1 -1
  48. data/lib/docusign_admin/models/error_details.rb +1 -1
  49. data/lib/docusign_admin/models/force_activate_membership_request.rb +1 -1
  50. data/lib/docusign_admin/models/group_request.rb +1 -1
  51. data/lib/docusign_admin/models/identity_provider_response.rb +1 -1
  52. data/lib/docusign_admin/models/identity_providers_response.rb +1 -1
  53. data/lib/docusign_admin/models/individual_membership_data_redaction_request.rb +1 -1
  54. data/lib/docusign_admin/models/individual_user_data_redaction_request.rb +1 -1
  55. data/lib/docusign_admin/models/individual_user_data_redaction_response.rb +1 -1
  56. data/lib/docusign_admin/models/link_response.rb +1 -1
  57. data/lib/docusign_admin/models/member_group_response.rb +1 -1
  58. data/lib/docusign_admin/models/member_groups_response.rb +1 -1
  59. data/lib/docusign_admin/models/membership_data_redaction_request.rb +1 -1
  60. data/lib/docusign_admin/models/membership_data_redaction_response.rb +1 -1
  61. data/lib/docusign_admin/models/membership_response.rb +1 -1
  62. data/lib/docusign_admin/models/new_account_user_request.rb +1 -1
  63. data/lib/docusign_admin/models/new_multi_product_user_add_request.rb +1 -1
  64. data/lib/docusign_admin/models/new_user_request.rb +1 -1
  65. data/lib/docusign_admin/models/new_user_request_account_properties.rb +1 -1
  66. data/lib/docusign_admin/models/new_user_response.rb +1 -1
  67. data/lib/docusign_admin/models/new_user_response_account_properties.rb +1 -1
  68. data/lib/docusign_admin/models/oasirr_error_details.rb +1 -1
  69. data/lib/docusign_admin/models/oasirr_organization_account_settings_error_data_response.rb +1 -1
  70. data/lib/docusign_admin/models/oetr_error_details.rb +1 -1
  71. data/lib/docusign_admin/models/org_export_selected_account.rb +1 -1
  72. data/lib/docusign_admin/models/org_export_selected_domain.rb +1 -1
  73. data/lib/docusign_admin/models/org_report_configuration_response.rb +1 -1
  74. data/lib/docusign_admin/models/org_report_create_response.rb +1 -1
  75. data/lib/docusign_admin/models/org_report_list_response.rb +1 -1
  76. data/lib/docusign_admin/models/org_report_list_response_org_report.rb +1 -1
  77. data/lib/docusign_admin/models/org_report_list_response_requestor.rb +1 -1
  78. data/lib/docusign_admin/models/org_report_request.rb +1 -1
  79. data/lib/docusign_admin/models/organization_account_request.rb +1 -1
  80. data/lib/docusign_admin/models/organization_account_response.rb +1 -1
  81. data/lib/docusign_admin/models/organization_account_settings_import_requestor_response.rb +1 -1
  82. data/lib/docusign_admin/models/organization_account_settings_import_response.rb +1 -1
  83. data/lib/docusign_admin/models/organization_account_settings_import_result_response.rb +1 -1
  84. data/lib/docusign_admin/models/organization_accounts_request.rb +1 -1
  85. data/lib/docusign_admin/models/organization_export_account.rb +1 -1
  86. data/lib/docusign_admin/models/organization_export_domain.rb +1 -1
  87. data/lib/docusign_admin/models/organization_export_request.rb +1 -1
  88. data/lib/docusign_admin/models/organization_export_requestor_response.rb +1 -1
  89. data/lib/docusign_admin/models/organization_export_response.rb +1 -1
  90. data/lib/docusign_admin/models/organization_export_task_response.rb +1 -1
  91. data/lib/docusign_admin/models/organization_exports_response.rb +1 -1
  92. data/lib/docusign_admin/models/organization_import_response.rb +1 -1
  93. data/lib/docusign_admin/models/organization_import_response_error_rollup.rb +1 -1
  94. data/lib/docusign_admin/models/organization_import_response_requestor.rb +1 -1
  95. data/lib/docusign_admin/models/organization_import_response_warning_rollup.rb +1 -1
  96. data/lib/docusign_admin/models/organization_imports_response.rb +1 -1
  97. data/lib/docusign_admin/models/organization_response.rb +1 -1
  98. data/lib/docusign_admin/models/organization_salesforce_account_managers_response.rb +1 -1
  99. data/lib/docusign_admin/models/organization_simple_id_object.rb +1 -1
  100. data/lib/docusign_admin/models/organization_subscription_response.rb +248 -0
  101. data/lib/docusign_admin/models/organization_user_response.rb +1 -1
  102. data/lib/docusign_admin/models/organization_users_response.rb +1 -1
  103. data/lib/docusign_admin/models/organizations_response.rb +1 -1
  104. data/lib/docusign_admin/models/osamr_contact.rb +1 -1
  105. data/lib/docusign_admin/models/paging_response_properties.rb +1 -1
  106. data/lib/docusign_admin/models/permission_profile_request.rb +1 -1
  107. data/lib/docusign_admin/models/permission_profile_response.rb +1 -1
  108. data/lib/docusign_admin/models/permission_profile_response2_1.rb +1 -1
  109. data/lib/docusign_admin/models/permissions_response.rb +1 -1
  110. data/lib/docusign_admin/models/product_permission_profile_request.rb +1 -1
  111. data/lib/docusign_admin/models/product_permission_profile_response.rb +1 -1
  112. data/lib/docusign_admin/models/product_permission_profiles_request.rb +1 -1
  113. data/lib/docusign_admin/models/product_permission_profiles_response.rb +1 -1
  114. data/lib/docusign_admin/models/remove_ds_group_users_response.rb +1 -1
  115. data/lib/docusign_admin/models/remove_user_products_response.rb +1 -1
  116. data/lib/docusign_admin/models/required_attribute_mapping_response.rb +1 -1
  117. data/lib/docusign_admin/models/saml2_identity_provider_response.rb +1 -1
  118. data/lib/docusign_admin/models/setting_response.rb +1 -1
  119. data/lib/docusign_admin/models/sub_account_create_request.rb +192 -0
  120. data/lib/docusign_admin/models/sub_account_create_request_sub_account_creation_subscription.rb +203 -0
  121. data/lib/docusign_admin/models/sub_account_create_request_sub_account_creation_target_account_admin.rb +253 -0
  122. data/lib/docusign_admin/models/sub_account_create_request_sub_account_creation_target_account_details.rb +237 -0
  123. data/lib/docusign_admin/models/sub_account_create_subscription_details.rb +216 -0
  124. data/lib/docusign_admin/models/sub_account_create_subscription_module_details.rb +194 -0
  125. data/lib/docusign_admin/models/sub_account_create_target_account.rb +234 -0
  126. data/lib/docusign_admin/models/sub_account_create_target_account_admin.rb +248 -0
  127. data/lib/docusign_admin/models/sub_account_create_worker.rb +360 -0
  128. data/lib/docusign_admin/models/sub_account_create_worker_response.rb +186 -0
  129. data/lib/docusign_admin/models/sub_account_error_details.rb +204 -0
  130. data/lib/docusign_admin/models/subscription_plan_item_response.rb +210 -0
  131. data/lib/docusign_admin/models/subscription_provision_model_account_create_account_admin.rb +253 -0
  132. data/lib/docusign_admin/models/subscription_provision_model_account_create_create_account_details.rb +271 -0
  133. data/lib/docusign_admin/models/subscription_provision_model_account_create_create_account_subscription_details.rb +203 -0
  134. data/lib/docusign_admin/models/subscription_provision_model_account_create_create_sub_account_details.rb +280 -0
  135. data/lib/docusign_admin/models/subscription_provision_model_asset_group_work.rb +516 -0
  136. data/lib/docusign_admin/models/subscription_provision_model_asset_group_work_result.rb +201 -0
  137. data/lib/docusign_admin/models/subscription_provision_model_change_event.rb +201 -0
  138. data/lib/docusign_admin/models/subscription_provision_model_service_error_details.rb +210 -0
  139. data/lib/docusign_admin/models/update_membership_request.rb +1 -1
  140. data/lib/docusign_admin/models/update_response.rb +1 -1
  141. data/lib/docusign_admin/models/update_user_email_request.rb +1 -1
  142. data/lib/docusign_admin/models/update_user_request.rb +1 -1
  143. data/lib/docusign_admin/models/update_users_email_request.rb +1 -1
  144. data/lib/docusign_admin/models/update_users_request.rb +1 -1
  145. data/lib/docusign_admin/models/user_drilldown_response.rb +1 -1
  146. data/lib/docusign_admin/models/user_identity_request.rb +1 -1
  147. data/lib/docusign_admin/models/user_identity_response.rb +1 -1
  148. data/lib/docusign_admin/models/user_product_permission_profiles_request.rb +1 -1
  149. data/lib/docusign_admin/models/user_product_permission_profiles_response.rb +1 -1
  150. data/lib/docusign_admin/models/user_product_profile_delete_request.rb +1 -1
  151. data/lib/docusign_admin/models/user_update_response.rb +1 -1
  152. data/lib/docusign_admin/models/users_drilldown_response.rb +1 -1
  153. data/lib/docusign_admin/models/users_update_response.rb +1 -1
  154. data/lib/docusign_admin/version.rb +2 -2
  155. data/lib/docusign_admin.rb +24 -2
  156. data/tests/Gemfile +1 -0
  157. metadata +29 -6
@@ -0,0 +1,216 @@
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 SubAccountCreateSubscriptionDetails
16
+ # Subscription ID
17
+ attr_accessor :id
18
+
19
+ # Plan ID
20
+ attr_accessor :plan_id
21
+
22
+ # Plan Name
23
+ attr_accessor :plan_name
24
+
25
+ # List of module IDs selected for creating the new account
26
+ attr_accessor :modules
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'id' => :'id',
32
+ :'plan_id' => :'planId',
33
+ :'plan_name' => :'planName',
34
+ :'modules' => :'modules'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+ :'id' => :'String',
42
+ :'plan_id' => :'String',
43
+ :'plan_name' => :'String',
44
+ :'modules' => :'Array<SubAccountCreateSubscriptionModuleDetails>'
45
+ }
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ def initialize(attributes = {})
51
+ return unless attributes.is_a?(Hash)
52
+
53
+ # convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
55
+
56
+ if attributes.has_key?(:'id')
57
+ self.id = attributes[:'id']
58
+ end
59
+
60
+ if attributes.has_key?(:'planId')
61
+ self.plan_id = attributes[:'planId']
62
+ end
63
+
64
+ if attributes.has_key?(:'planName')
65
+ self.plan_name = attributes[:'planName']
66
+ end
67
+
68
+ if attributes.has_key?(:'modules')
69
+ if (value = attributes[:'modules']).is_a?(Array)
70
+ self.modules = value
71
+ end
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ invalid_properties = Array.new
79
+ invalid_properties
80
+ end
81
+
82
+ # Check to see if the all the properties in the model are valid
83
+ # @return true if the model is valid
84
+ def valid?
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ id == o.id &&
94
+ plan_id == o.plan_id &&
95
+ plan_name == o.plan_name &&
96
+ modules == o.modules
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Fixnum] Hash code
107
+ def hash
108
+ [id, plan_id, plan_name, modules].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def build_from_hash(attributes)
115
+ return nil unless attributes.is_a?(Hash)
116
+ self.class.swagger_types.each_pair do |key, type|
117
+ if type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
121
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
122
+ end
123
+ elsif !attributes[self.class.attribute_map[key]].nil?
124
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
125
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
126
+ end
127
+
128
+ self
129
+ end
130
+
131
+ # Deserializes the data based on type
132
+ # @param string type Data type
133
+ # @param string value Value to be deserialized
134
+ # @return [Object] Deserialized data
135
+ def _deserialize(type, value)
136
+ case type.to_sym
137
+ when :DateTime
138
+ DateTime.parse(value)
139
+ when :Date
140
+ Date.parse(value)
141
+ when :String
142
+ value.to_s
143
+ when :Integer
144
+ value.to_i
145
+ when :Float
146
+ value.to_f
147
+ when :BOOLEAN
148
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149
+ true
150
+ else
151
+ false
152
+ end
153
+ when :Object
154
+ # generic object (usually a Hash), return directly
155
+ value
156
+ when /\AArray<(?<inner_type>.+)>\z/
157
+ inner_type = Regexp.last_match[:inner_type]
158
+ value.map { |v| _deserialize(inner_type, v) }
159
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
160
+ k_type = Regexp.last_match[:k_type]
161
+ v_type = Regexp.last_match[:v_type]
162
+ {}.tap do |hash|
163
+ value.each do |k, v|
164
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165
+ end
166
+ end
167
+ else # model
168
+ temp_model = DocuSign_Admin.const_get(type).new
169
+ temp_model.build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ next if value.nil?
192
+ hash[param] = _to_hash(value)
193
+ end
194
+ hash
195
+ end
196
+
197
+ # Outputs non-array value in the form of hash
198
+ # For object, use to_hash. Otherwise, just return the value
199
+ # @param [Object] value Any valid value
200
+ # @return [Hash] Returns the value in the form of hash
201
+ def _to_hash(value)
202
+ if value.is_a?(Array)
203
+ value.compact.map { |v| _to_hash(v) }
204
+ elsif value.is_a?(Hash)
205
+ {}.tap do |hash|
206
+ value.each { |k, v| hash[k] = _to_hash(v) }
207
+ end
208
+ elsif value.respond_to? :to_hash
209
+ value.to_hash
210
+ else
211
+ value
212
+ end
213
+ end
214
+
215
+ end
216
+ end
@@ -0,0 +1,194 @@
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 SubAccountCreateSubscriptionModuleDetails
16
+ # Module ID
17
+ attr_accessor :module_id
18
+
19
+ # Module Name
20
+ attr_accessor :module_name
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'module_id' => :'moduleId',
26
+ :'module_name' => :'moduleName'
27
+ }
28
+ end
29
+
30
+ # Attribute type mapping.
31
+ def self.swagger_types
32
+ {
33
+ :'module_id' => :'String',
34
+ :'module_name' => :'String'
35
+ }
36
+ end
37
+
38
+ # Initializes the object
39
+ # @param [Hash] attributes Model attributes in the form of hash
40
+ def initialize(attributes = {})
41
+ return unless attributes.is_a?(Hash)
42
+
43
+ # convert string to symbol for hash key
44
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
45
+
46
+ if attributes.has_key?(:'moduleId')
47
+ self.module_id = attributes[:'moduleId']
48
+ end
49
+
50
+ if attributes.has_key?(:'moduleName')
51
+ self.module_name = attributes[:'moduleName']
52
+ end
53
+ end
54
+
55
+ # Show invalid properties with the reasons. Usually used together with valid?
56
+ # @return Array for valid properties with the reasons
57
+ def list_invalid_properties
58
+ invalid_properties = Array.new
59
+ invalid_properties
60
+ end
61
+
62
+ # Check to see if the all the properties in the model are valid
63
+ # @return true if the model is valid
64
+ def valid?
65
+ true
66
+ end
67
+
68
+ # Checks equality by comparing each attribute.
69
+ # @param [Object] Object to be compared
70
+ def ==(o)
71
+ return true if self.equal?(o)
72
+ self.class == o.class &&
73
+ module_id == o.module_id &&
74
+ module_name == o.module_name
75
+ end
76
+
77
+ # @see the `==` method
78
+ # @param [Object] Object to be compared
79
+ def eql?(o)
80
+ self == o
81
+ end
82
+
83
+ # Calculates hash code according to all attributes.
84
+ # @return [Fixnum] Hash code
85
+ def hash
86
+ [module_id, module_name].hash
87
+ end
88
+
89
+ # Builds the object from hash
90
+ # @param [Hash] attributes Model attributes in the form of hash
91
+ # @return [Object] Returns the model itself
92
+ def build_from_hash(attributes)
93
+ return nil unless attributes.is_a?(Hash)
94
+ self.class.swagger_types.each_pair do |key, type|
95
+ if type =~ /\AArray<(.*)>/i
96
+ # check to ensure the input is an array given that the attribute
97
+ # is documented as an array but the input is not
98
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
99
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
100
+ end
101
+ elsif !attributes[self.class.attribute_map[key]].nil?
102
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
103
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
104
+ end
105
+
106
+ self
107
+ end
108
+
109
+ # Deserializes the data based on type
110
+ # @param string type Data type
111
+ # @param string value Value to be deserialized
112
+ # @return [Object] Deserialized data
113
+ def _deserialize(type, value)
114
+ case type.to_sym
115
+ when :DateTime
116
+ DateTime.parse(value)
117
+ when :Date
118
+ Date.parse(value)
119
+ when :String
120
+ value.to_s
121
+ when :Integer
122
+ value.to_i
123
+ when :Float
124
+ value.to_f
125
+ when :BOOLEAN
126
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
127
+ true
128
+ else
129
+ false
130
+ end
131
+ when :Object
132
+ # generic object (usually a Hash), return directly
133
+ value
134
+ when /\AArray<(?<inner_type>.+)>\z/
135
+ inner_type = Regexp.last_match[:inner_type]
136
+ value.map { |v| _deserialize(inner_type, v) }
137
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
138
+ k_type = Regexp.last_match[:k_type]
139
+ v_type = Regexp.last_match[:v_type]
140
+ {}.tap do |hash|
141
+ value.each do |k, v|
142
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
143
+ end
144
+ end
145
+ else # model
146
+ temp_model = DocuSign_Admin.const_get(type).new
147
+ temp_model.build_from_hash(value)
148
+ end
149
+ end
150
+
151
+ # Returns the string representation of the object
152
+ # @return [String] String presentation of the object
153
+ def to_s
154
+ to_hash.to_s
155
+ end
156
+
157
+ # to_body is an alias to to_hash (backward compatibility)
158
+ # @return [Hash] Returns the object in the form of hash
159
+ def to_body
160
+ to_hash
161
+ end
162
+
163
+ # Returns the object in the form of hash
164
+ # @return [Hash] Returns the object in the form of hash
165
+ def to_hash
166
+ hash = {}
167
+ self.class.attribute_map.each_pair do |attr, param|
168
+ value = self.send(attr)
169
+ next if value.nil?
170
+ hash[param] = _to_hash(value)
171
+ end
172
+ hash
173
+ end
174
+
175
+ # Outputs non-array value in the form of hash
176
+ # For object, use to_hash. Otherwise, just return the value
177
+ # @param [Object] value Any valid value
178
+ # @return [Hash] Returns the value in the form of hash
179
+ def _to_hash(value)
180
+ if value.is_a?(Array)
181
+ value.compact.map { |v| _to_hash(v) }
182
+ elsif value.is_a?(Hash)
183
+ {}.tap do |hash|
184
+ value.each { |k, v| hash[k] = _to_hash(v) }
185
+ end
186
+ elsif value.respond_to? :to_hash
187
+ value.to_hash
188
+ else
189
+ value
190
+ end
191
+ end
192
+
193
+ end
194
+ end
@@ -0,0 +1,234 @@
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 SubAccountCreateTargetAccount
16
+ # The target account id being created. It will be empty Guid if account is not created yet.
17
+ attr_accessor :id
18
+
19
+ # The name of the target account.
20
+ attr_accessor :name
21
+
22
+ # The region where the target account is in.
23
+ attr_accessor :region
24
+
25
+ # The country code where the target account is in.
26
+ attr_accessor :country_code
27
+
28
+ # The site where the target account is on.
29
+ attr_accessor :site
30
+
31
+ # The admin user for the target account.
32
+ attr_accessor :admin
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'id' => :'id',
38
+ :'name' => :'name',
39
+ :'region' => :'region',
40
+ :'country_code' => :'countryCode',
41
+ :'site' => :'site',
42
+ :'admin' => :'admin'
43
+ }
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.swagger_types
48
+ {
49
+ :'id' => :'String',
50
+ :'name' => :'String',
51
+ :'region' => :'String',
52
+ :'country_code' => :'String',
53
+ :'site' => :'String',
54
+ :'admin' => :'SubAccountCreateTargetAccountAdmin'
55
+ }
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ return unless attributes.is_a?(Hash)
62
+
63
+ # convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
65
+
66
+ if attributes.has_key?(:'id')
67
+ self.id = attributes[:'id']
68
+ end
69
+
70
+ if attributes.has_key?(:'name')
71
+ self.name = attributes[:'name']
72
+ end
73
+
74
+ if attributes.has_key?(:'region')
75
+ self.region = attributes[:'region']
76
+ end
77
+
78
+ if attributes.has_key?(:'countryCode')
79
+ self.country_code = attributes[:'countryCode']
80
+ end
81
+
82
+ if attributes.has_key?(:'site')
83
+ self.site = attributes[:'site']
84
+ end
85
+
86
+ if attributes.has_key?(:'admin')
87
+ self.admin = attributes[:'admin']
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ invalid_properties = Array.new
95
+ invalid_properties
96
+ end
97
+
98
+ # Check to see if the all the properties in the model are valid
99
+ # @return true if the model is valid
100
+ def valid?
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ id == o.id &&
110
+ name == o.name &&
111
+ region == o.region &&
112
+ country_code == o.country_code &&
113
+ site == o.site &&
114
+ admin == o.admin
115
+ end
116
+
117
+ # @see the `==` method
118
+ # @param [Object] Object to be compared
119
+ def eql?(o)
120
+ self == o
121
+ end
122
+
123
+ # Calculates hash code according to all attributes.
124
+ # @return [Fixnum] Hash code
125
+ def hash
126
+ [id, name, region, country_code, site, admin].hash
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def build_from_hash(attributes)
133
+ return nil unless attributes.is_a?(Hash)
134
+ self.class.swagger_types.each_pair do |key, type|
135
+ if type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
139
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
140
+ end
141
+ elsif !attributes[self.class.attribute_map[key]].nil?
142
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
143
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
144
+ end
145
+
146
+ self
147
+ end
148
+
149
+ # Deserializes the data based on type
150
+ # @param string type Data type
151
+ # @param string value Value to be deserialized
152
+ # @return [Object] Deserialized data
153
+ def _deserialize(type, value)
154
+ case type.to_sym
155
+ when :DateTime
156
+ DateTime.parse(value)
157
+ when :Date
158
+ Date.parse(value)
159
+ when :String
160
+ value.to_s
161
+ when :Integer
162
+ value.to_i
163
+ when :Float
164
+ value.to_f
165
+ when :BOOLEAN
166
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
+ true
168
+ else
169
+ false
170
+ end
171
+ when :Object
172
+ # generic object (usually a Hash), return directly
173
+ value
174
+ when /\AArray<(?<inner_type>.+)>\z/
175
+ inner_type = Regexp.last_match[:inner_type]
176
+ value.map { |v| _deserialize(inner_type, v) }
177
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
+ k_type = Regexp.last_match[:k_type]
179
+ v_type = Regexp.last_match[:v_type]
180
+ {}.tap do |hash|
181
+ value.each do |k, v|
182
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
+ end
184
+ end
185
+ else # model
186
+ temp_model = DocuSign_Admin.const_get(type).new
187
+ temp_model.build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ next if value.nil?
210
+ hash[param] = _to_hash(value)
211
+ end
212
+ hash
213
+ end
214
+
215
+ # Outputs non-array value in the form of hash
216
+ # For object, use to_hash. Otherwise, just return the value
217
+ # @param [Object] value Any valid value
218
+ # @return [Hash] Returns the value in the form of hash
219
+ def _to_hash(value)
220
+ if value.is_a?(Array)
221
+ value.compact.map { |v| _to_hash(v) }
222
+ elsif value.is_a?(Hash)
223
+ {}.tap do |hash|
224
+ value.each { |k, v| hash[k] = _to_hash(v) }
225
+ end
226
+ elsif value.respond_to? :to_hash
227
+ value.to_hash
228
+ else
229
+ value
230
+ end
231
+ end
232
+
233
+ end
234
+ end