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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/docusign_admin.gemspec +3 -3
- data/lib/docusign_admin/api/accounts_api.rb +1 -1
- data/lib/docusign_admin/api/bulk_exports_api.rb +1 -1
- data/lib/docusign_admin/api/bulk_imports_api.rb +1 -1
- data/lib/docusign_admin/api/ds_groups_api.rb +1 -1
- data/lib/docusign_admin/api/identity_providers_api.rb +1 -1
- data/lib/docusign_admin/api/organizations_api.rb +1 -1
- data/lib/docusign_admin/api/product_permission_profiles_api.rb +1 -1
- data/lib/docusign_admin/api/provision_asset_group_api.rb +251 -7
- data/lib/docusign_admin/api/reserved_domains_api.rb +1 -1
- data/lib/docusign_admin/api/users_api.rb +5 -1
- data/lib/docusign_admin/client/api_client.rb +10 -10
- data/lib/docusign_admin/client/api_error.rb +1 -1
- data/lib/docusign_admin/configuration.rb +1 -1
- data/lib/docusign_admin/models/add_ds_group_and_users_response.rb +1 -1
- data/lib/docusign_admin/models/add_ds_group_users_response.rb +1 -1
- data/lib/docusign_admin/models/add_user_response.rb +1 -1
- data/lib/docusign_admin/models/add_user_response_account_properties.rb +1 -1
- data/lib/docusign_admin/models/address_information.rb +246 -0
- data/lib/docusign_admin/models/asset_group_account_clone.rb +6 -6
- data/lib/docusign_admin/models/asset_group_account_clone_source_account.rb +1 -1
- data/lib/docusign_admin/models/asset_group_account_clone_target_account.rb +1 -1
- data/lib/docusign_admin/models/asset_group_account_clone_target_account_admin.rb +1 -1
- data/lib/docusign_admin/models/asset_group_account_clones.rb +1 -1
- data/lib/docusign_admin/models/asset_group_account_response.rb +1 -1
- data/lib/docusign_admin/models/asset_group_accounts_response.rb +1 -1
- data/lib/docusign_admin/models/certificate_response.rb +1 -1
- data/lib/docusign_admin/models/delete_membership_request.rb +1 -1
- data/lib/docusign_admin/models/delete_membership_response.rb +1 -1
- data/lib/docusign_admin/models/delete_memberships_request.rb +1 -1
- data/lib/docusign_admin/models/delete_memberships_response.rb +1 -1
- data/lib/docusign_admin/models/delete_response.rb +1 -1
- data/lib/docusign_admin/models/delete_user_identity_request.rb +1 -1
- data/lib/docusign_admin/models/docu_sign_account_domain_model_address.rb +255 -0
- data/lib/docusign_admin/models/domain_response.rb +1 -1
- data/lib/docusign_admin/models/domains_response.rb +1 -1
- data/lib/docusign_admin/models/ds_group_add_request.rb +1 -1
- data/lib/docusign_admin/models/ds_group_and_users_response.rb +1 -1
- data/lib/docusign_admin/models/ds_group_list_response.rb +1 -1
- data/lib/docusign_admin/models/ds_group_request.rb +1 -1
- data/lib/docusign_admin/models/ds_group_response.rb +1 -1
- data/lib/docusign_admin/models/ds_group_user_response.rb +1 -1
- data/lib/docusign_admin/models/ds_group_users_add_request.rb +1 -1
- data/lib/docusign_admin/models/ds_group_users_remove_request.rb +1 -1
- data/lib/docusign_admin/models/ds_group_users_response.rb +1 -1
- data/lib/docusign_admin/models/error_details.rb +1 -1
- data/lib/docusign_admin/models/force_activate_membership_request.rb +1 -1
- data/lib/docusign_admin/models/group_request.rb +1 -1
- data/lib/docusign_admin/models/identity_provider_response.rb +1 -1
- data/lib/docusign_admin/models/identity_providers_response.rb +1 -1
- data/lib/docusign_admin/models/individual_membership_data_redaction_request.rb +1 -1
- data/lib/docusign_admin/models/individual_user_data_redaction_request.rb +1 -1
- data/lib/docusign_admin/models/individual_user_data_redaction_response.rb +1 -1
- data/lib/docusign_admin/models/link_response.rb +1 -1
- data/lib/docusign_admin/models/member_group_response.rb +1 -1
- data/lib/docusign_admin/models/member_groups_response.rb +1 -1
- data/lib/docusign_admin/models/membership_data_redaction_request.rb +1 -1
- data/lib/docusign_admin/models/membership_data_redaction_response.rb +1 -1
- data/lib/docusign_admin/models/membership_response.rb +1 -1
- data/lib/docusign_admin/models/new_account_user_request.rb +1 -1
- data/lib/docusign_admin/models/new_multi_product_user_add_request.rb +1 -1
- data/lib/docusign_admin/models/new_user_request.rb +1 -1
- data/lib/docusign_admin/models/new_user_request_account_properties.rb +1 -1
- data/lib/docusign_admin/models/new_user_response.rb +1 -1
- data/lib/docusign_admin/models/new_user_response_account_properties.rb +1 -1
- data/lib/docusign_admin/models/oasirr_error_details.rb +1 -1
- data/lib/docusign_admin/models/oasirr_organization_account_settings_error_data_response.rb +1 -1
- data/lib/docusign_admin/models/oetr_error_details.rb +1 -1
- data/lib/docusign_admin/models/org_export_selected_account.rb +1 -1
- data/lib/docusign_admin/models/org_export_selected_domain.rb +1 -1
- data/lib/docusign_admin/models/org_report_configuration_response.rb +1 -1
- data/lib/docusign_admin/models/org_report_create_response.rb +1 -1
- data/lib/docusign_admin/models/org_report_list_response.rb +1 -1
- data/lib/docusign_admin/models/org_report_list_response_org_report.rb +1 -1
- data/lib/docusign_admin/models/org_report_list_response_requestor.rb +1 -1
- data/lib/docusign_admin/models/org_report_request.rb +1 -1
- data/lib/docusign_admin/models/organization_account_request.rb +1 -1
- data/lib/docusign_admin/models/organization_account_response.rb +1 -1
- data/lib/docusign_admin/models/organization_account_settings_import_requestor_response.rb +1 -1
- data/lib/docusign_admin/models/organization_account_settings_import_response.rb +1 -1
- data/lib/docusign_admin/models/organization_account_settings_import_result_response.rb +1 -1
- data/lib/docusign_admin/models/organization_accounts_request.rb +1 -1
- data/lib/docusign_admin/models/organization_export_account.rb +1 -1
- data/lib/docusign_admin/models/organization_export_domain.rb +1 -1
- data/lib/docusign_admin/models/organization_export_request.rb +1 -1
- data/lib/docusign_admin/models/organization_export_requestor_response.rb +1 -1
- data/lib/docusign_admin/models/organization_export_response.rb +1 -1
- data/lib/docusign_admin/models/organization_export_task_response.rb +1 -1
- data/lib/docusign_admin/models/organization_exports_response.rb +1 -1
- data/lib/docusign_admin/models/organization_import_response.rb +1 -1
- data/lib/docusign_admin/models/organization_import_response_error_rollup.rb +1 -1
- data/lib/docusign_admin/models/organization_import_response_requestor.rb +1 -1
- data/lib/docusign_admin/models/organization_import_response_warning_rollup.rb +1 -1
- data/lib/docusign_admin/models/organization_imports_response.rb +1 -1
- data/lib/docusign_admin/models/organization_response.rb +1 -1
- data/lib/docusign_admin/models/organization_salesforce_account_managers_response.rb +1 -1
- data/lib/docusign_admin/models/organization_simple_id_object.rb +1 -1
- data/lib/docusign_admin/models/organization_subscription_response.rb +248 -0
- data/lib/docusign_admin/models/organization_user_response.rb +1 -1
- data/lib/docusign_admin/models/organization_users_response.rb +1 -1
- data/lib/docusign_admin/models/organizations_response.rb +1 -1
- data/lib/docusign_admin/models/osamr_contact.rb +1 -1
- data/lib/docusign_admin/models/paging_response_properties.rb +1 -1
- data/lib/docusign_admin/models/permission_profile_request.rb +1 -1
- data/lib/docusign_admin/models/permission_profile_response.rb +1 -1
- data/lib/docusign_admin/models/permission_profile_response2_1.rb +1 -1
- data/lib/docusign_admin/models/permissions_response.rb +1 -1
- data/lib/docusign_admin/models/product_permission_profile_request.rb +1 -1
- data/lib/docusign_admin/models/product_permission_profile_response.rb +1 -1
- data/lib/docusign_admin/models/product_permission_profiles_request.rb +1 -1
- data/lib/docusign_admin/models/product_permission_profiles_response.rb +1 -1
- data/lib/docusign_admin/models/remove_ds_group_users_response.rb +1 -1
- data/lib/docusign_admin/models/remove_user_products_response.rb +1 -1
- data/lib/docusign_admin/models/required_attribute_mapping_response.rb +1 -1
- data/lib/docusign_admin/models/saml2_identity_provider_response.rb +1 -1
- data/lib/docusign_admin/models/setting_response.rb +1 -1
- data/lib/docusign_admin/models/sub_account_create_request.rb +192 -0
- data/lib/docusign_admin/models/sub_account_create_request_sub_account_creation_subscription.rb +203 -0
- data/lib/docusign_admin/models/sub_account_create_request_sub_account_creation_target_account_admin.rb +253 -0
- data/lib/docusign_admin/models/sub_account_create_request_sub_account_creation_target_account_details.rb +237 -0
- data/lib/docusign_admin/models/sub_account_create_subscription_details.rb +216 -0
- data/lib/docusign_admin/models/sub_account_create_subscription_module_details.rb +194 -0
- data/lib/docusign_admin/models/sub_account_create_target_account.rb +234 -0
- data/lib/docusign_admin/models/sub_account_create_target_account_admin.rb +248 -0
- data/lib/docusign_admin/models/sub_account_create_worker.rb +360 -0
- data/lib/docusign_admin/models/sub_account_create_worker_response.rb +186 -0
- data/lib/docusign_admin/models/sub_account_error_details.rb +204 -0
- data/lib/docusign_admin/models/subscription_plan_item_response.rb +210 -0
- data/lib/docusign_admin/models/subscription_provision_model_account_create_account_admin.rb +253 -0
- data/lib/docusign_admin/models/subscription_provision_model_account_create_create_account_details.rb +271 -0
- data/lib/docusign_admin/models/subscription_provision_model_account_create_create_account_subscription_details.rb +203 -0
- data/lib/docusign_admin/models/subscription_provision_model_account_create_create_sub_account_details.rb +280 -0
- data/lib/docusign_admin/models/subscription_provision_model_asset_group_work.rb +516 -0
- data/lib/docusign_admin/models/subscription_provision_model_asset_group_work_result.rb +201 -0
- data/lib/docusign_admin/models/subscription_provision_model_change_event.rb +201 -0
- data/lib/docusign_admin/models/subscription_provision_model_service_error_details.rb +210 -0
- data/lib/docusign_admin/models/update_membership_request.rb +1 -1
- data/lib/docusign_admin/models/update_response.rb +1 -1
- data/lib/docusign_admin/models/update_user_email_request.rb +1 -1
- data/lib/docusign_admin/models/update_user_request.rb +1 -1
- data/lib/docusign_admin/models/update_users_email_request.rb +1 -1
- data/lib/docusign_admin/models/update_users_request.rb +1 -1
- data/lib/docusign_admin/models/user_drilldown_response.rb +1 -1
- data/lib/docusign_admin/models/user_identity_request.rb +1 -1
- data/lib/docusign_admin/models/user_identity_response.rb +1 -1
- data/lib/docusign_admin/models/user_product_permission_profiles_request.rb +1 -1
- data/lib/docusign_admin/models/user_product_permission_profiles_response.rb +1 -1
- data/lib/docusign_admin/models/user_product_profile_delete_request.rb +1 -1
- data/lib/docusign_admin/models/user_update_response.rb +1 -1
- data/lib/docusign_admin/models/users_drilldown_response.rb +1 -1
- data/lib/docusign_admin/models/users_update_response.rb +1 -1
- data/lib/docusign_admin/version.rb +2 -2
- data/lib/docusign_admin.rb +24 -2
- data/tests/Gemfile +1 -0
- metadata +29 -6
@@ -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 SubscriptionProvisionModelAccountCreateCreateAccountSubscriptionDetails
|
16
|
+
attr_accessor :subscription_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
|
+
:'subscription_id' => :'SubscriptionId',
|
26
|
+
:'plan_id' => :'PlanId',
|
27
|
+
:'modules' => :'Modules'
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# Attribute type mapping.
|
32
|
+
def self.swagger_types
|
33
|
+
{
|
34
|
+
:'subscription_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?(:'SubscriptionId')
|
49
|
+
self.subscription_id = attributes[:'SubscriptionId']
|
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
|
+
subscription_id == o.subscription_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
|
+
[subscription_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,280 @@
|
|
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 SubscriptionProvisionModelAccountCreateCreateSubAccountDetails
|
16
|
+
attr_accessor :subscription_details
|
17
|
+
|
18
|
+
attr_accessor :name
|
19
|
+
|
20
|
+
attr_accessor :country_code
|
21
|
+
|
22
|
+
attr_accessor :region
|
23
|
+
|
24
|
+
attr_accessor :site
|
25
|
+
|
26
|
+
attr_accessor :address
|
27
|
+
|
28
|
+
attr_accessor :admin_user
|
29
|
+
|
30
|
+
attr_accessor :billing_profile_type
|
31
|
+
|
32
|
+
class EnumAttributeValidator
|
33
|
+
attr_reader :datatype
|
34
|
+
attr_reader :allowable_values
|
35
|
+
|
36
|
+
def initialize(datatype, allowable_values)
|
37
|
+
@allowable_values = allowable_values.map do |value|
|
38
|
+
case datatype.to_s
|
39
|
+
when /Integer/i
|
40
|
+
value.to_i
|
41
|
+
when /Float/i
|
42
|
+
value.to_f
|
43
|
+
else
|
44
|
+
value
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def valid?(value)
|
50
|
+
!value || allowable_values.include?(value)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
55
|
+
def self.attribute_map
|
56
|
+
{
|
57
|
+
:'subscription_details' => :'SubscriptionDetails',
|
58
|
+
:'name' => :'Name',
|
59
|
+
:'country_code' => :'CountryCode',
|
60
|
+
:'region' => :'Region',
|
61
|
+
:'site' => :'Site',
|
62
|
+
:'address' => :'Address',
|
63
|
+
:'admin_user' => :'AdminUser',
|
64
|
+
:'billing_profile_type' => :'BillingProfileType'
|
65
|
+
}
|
66
|
+
end
|
67
|
+
|
68
|
+
# Attribute type mapping.
|
69
|
+
def self.swagger_types
|
70
|
+
{
|
71
|
+
:'subscription_details' => :'SubscriptionProvisionModelAccountCreateCreateAccountSubscriptionDetails',
|
72
|
+
:'name' => :'String',
|
73
|
+
:'country_code' => :'String',
|
74
|
+
:'region' => :'String',
|
75
|
+
:'site' => :'String',
|
76
|
+
:'address' => :'DocuSignAccountDomainModelAddress',
|
77
|
+
:'admin_user' => :'SubscriptionProvisionModelAccountCreateAccountAdmin',
|
78
|
+
:'billing_profile_type' => :'String'
|
79
|
+
}
|
80
|
+
end
|
81
|
+
|
82
|
+
# Initializes the object
|
83
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
84
|
+
def initialize(attributes = {})
|
85
|
+
return unless attributes.is_a?(Hash)
|
86
|
+
|
87
|
+
# convert string to symbol for hash key
|
88
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
89
|
+
|
90
|
+
if attributes.has_key?(:'SubscriptionDetails')
|
91
|
+
self.subscription_details = attributes[:'SubscriptionDetails']
|
92
|
+
end
|
93
|
+
|
94
|
+
if attributes.has_key?(:'Name')
|
95
|
+
self.name = attributes[:'Name']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.has_key?(:'CountryCode')
|
99
|
+
self.country_code = attributes[:'CountryCode']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.has_key?(:'Region')
|
103
|
+
self.region = attributes[:'Region']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.has_key?(:'Site')
|
107
|
+
self.site = attributes[:'Site']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.has_key?(:'Address')
|
111
|
+
self.address = attributes[:'Address']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.has_key?(:'AdminUser')
|
115
|
+
self.admin_user = attributes[:'AdminUser']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.has_key?(:'BillingProfileType')
|
119
|
+
self.billing_profile_type = attributes[:'BillingProfileType']
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
124
|
+
# @return Array for valid properties with the reasons
|
125
|
+
def list_invalid_properties
|
126
|
+
invalid_properties = Array.new
|
127
|
+
invalid_properties
|
128
|
+
end
|
129
|
+
|
130
|
+
# Check to see if the all the properties in the model are valid
|
131
|
+
# @return true if the model is valid
|
132
|
+
def valid?
|
133
|
+
billing_profile_type_validator = EnumAttributeValidator.new('String', ['Web', 'Direct'])
|
134
|
+
return false unless billing_profile_type_validator.valid?(@billing_profile_type)
|
135
|
+
true
|
136
|
+
end
|
137
|
+
|
138
|
+
# Custom attribute writer method checking allowed values (enum).
|
139
|
+
# @param [Object] billing_profile_type Object to be assigned
|
140
|
+
def billing_profile_type=(billing_profile_type)
|
141
|
+
validator = EnumAttributeValidator.new('String', ['Web', 'Direct'])
|
142
|
+
unless validator.valid?(billing_profile_type)
|
143
|
+
fail ArgumentError, 'invalid value for "billing_profile_type", must be one of #{validator.allowable_values}.'
|
144
|
+
end
|
145
|
+
@billing_profile_type = billing_profile_type
|
146
|
+
end
|
147
|
+
|
148
|
+
# Checks equality by comparing each attribute.
|
149
|
+
# @param [Object] Object to be compared
|
150
|
+
def ==(o)
|
151
|
+
return true if self.equal?(o)
|
152
|
+
self.class == o.class &&
|
153
|
+
subscription_details == o.subscription_details &&
|
154
|
+
name == o.name &&
|
155
|
+
country_code == o.country_code &&
|
156
|
+
region == o.region &&
|
157
|
+
site == o.site &&
|
158
|
+
address == o.address &&
|
159
|
+
admin_user == o.admin_user &&
|
160
|
+
billing_profile_type == o.billing_profile_type
|
161
|
+
end
|
162
|
+
|
163
|
+
# @see the `==` method
|
164
|
+
# @param [Object] Object to be compared
|
165
|
+
def eql?(o)
|
166
|
+
self == o
|
167
|
+
end
|
168
|
+
|
169
|
+
# Calculates hash code according to all attributes.
|
170
|
+
# @return [Fixnum] Hash code
|
171
|
+
def hash
|
172
|
+
[subscription_details, name, country_code, region, site, address, admin_user, billing_profile_type].hash
|
173
|
+
end
|
174
|
+
|
175
|
+
# Builds the object from hash
|
176
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
177
|
+
# @return [Object] Returns the model itself
|
178
|
+
def build_from_hash(attributes)
|
179
|
+
return nil unless attributes.is_a?(Hash)
|
180
|
+
self.class.swagger_types.each_pair do |key, type|
|
181
|
+
if type =~ /\AArray<(.*)>/i
|
182
|
+
# check to ensure the input is an array given that the attribute
|
183
|
+
# is documented as an array but the input is not
|
184
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
185
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
186
|
+
end
|
187
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
188
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
189
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
190
|
+
end
|
191
|
+
|
192
|
+
self
|
193
|
+
end
|
194
|
+
|
195
|
+
# Deserializes the data based on type
|
196
|
+
# @param string type Data type
|
197
|
+
# @param string value Value to be deserialized
|
198
|
+
# @return [Object] Deserialized data
|
199
|
+
def _deserialize(type, value)
|
200
|
+
case type.to_sym
|
201
|
+
when :DateTime
|
202
|
+
DateTime.parse(value)
|
203
|
+
when :Date
|
204
|
+
Date.parse(value)
|
205
|
+
when :String
|
206
|
+
value.to_s
|
207
|
+
when :Integer
|
208
|
+
value.to_i
|
209
|
+
when :Float
|
210
|
+
value.to_f
|
211
|
+
when :BOOLEAN
|
212
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
213
|
+
true
|
214
|
+
else
|
215
|
+
false
|
216
|
+
end
|
217
|
+
when :Object
|
218
|
+
# generic object (usually a Hash), return directly
|
219
|
+
value
|
220
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
221
|
+
inner_type = Regexp.last_match[:inner_type]
|
222
|
+
value.map { |v| _deserialize(inner_type, v) }
|
223
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
224
|
+
k_type = Regexp.last_match[:k_type]
|
225
|
+
v_type = Regexp.last_match[:v_type]
|
226
|
+
{}.tap do |hash|
|
227
|
+
value.each do |k, v|
|
228
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
229
|
+
end
|
230
|
+
end
|
231
|
+
else # model
|
232
|
+
temp_model = DocuSign_Admin.const_get(type).new
|
233
|
+
temp_model.build_from_hash(value)
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
# Returns the string representation of the object
|
238
|
+
# @return [String] String presentation of the object
|
239
|
+
def to_s
|
240
|
+
to_hash.to_s
|
241
|
+
end
|
242
|
+
|
243
|
+
# to_body is an alias to to_hash (backward compatibility)
|
244
|
+
# @return [Hash] Returns the object in the form of hash
|
245
|
+
def to_body
|
246
|
+
to_hash
|
247
|
+
end
|
248
|
+
|
249
|
+
# Returns the object in the form of hash
|
250
|
+
# @return [Hash] Returns the object in the form of hash
|
251
|
+
def to_hash
|
252
|
+
hash = {}
|
253
|
+
self.class.attribute_map.each_pair do |attr, param|
|
254
|
+
value = self.send(attr)
|
255
|
+
next if value.nil?
|
256
|
+
hash[param] = _to_hash(value)
|
257
|
+
end
|
258
|
+
hash
|
259
|
+
end
|
260
|
+
|
261
|
+
# Outputs non-array value in the form of hash
|
262
|
+
# For object, use to_hash. Otherwise, just return the value
|
263
|
+
# @param [Object] value Any valid value
|
264
|
+
# @return [Hash] Returns the value in the form of hash
|
265
|
+
def _to_hash(value)
|
266
|
+
if value.is_a?(Array)
|
267
|
+
value.compact.map { |v| _to_hash(v) }
|
268
|
+
elsif value.is_a?(Hash)
|
269
|
+
{}.tap do |hash|
|
270
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
271
|
+
end
|
272
|
+
elsif value.respond_to? :to_hash
|
273
|
+
value.to_hash
|
274
|
+
else
|
275
|
+
value
|
276
|
+
end
|
277
|
+
end
|
278
|
+
|
279
|
+
end
|
280
|
+
end
|