docusign_admin 1.0.0.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/LICENSE +21 -0
  4. data/README.md +51 -0
  5. data/Rakefile +8 -0
  6. data/docusign_admin.gemspec +45 -0
  7. data/git_push.sh +55 -0
  8. data/lib/docusign_admin/.DS_Store +0 -0
  9. data/lib/docusign_admin/api/accounts_api.rb +213 -0
  10. data/lib/docusign_admin/api/bulk_exports_api.rb +456 -0
  11. data/lib/docusign_admin/api/bulk_imports_api.rb +785 -0
  12. data/lib/docusign_admin/api/ds_groups_api.rb +472 -0
  13. data/lib/docusign_admin/api/identity_providers_api.rb +75 -0
  14. data/lib/docusign_admin/api/product_permission_profiles_api.rb +201 -0
  15. data/lib/docusign_admin/api/reserved_domains_api.rb +75 -0
  16. data/lib/docusign_admin/api/users_api.rb +650 -0
  17. data/lib/docusign_admin/client/.DS_Store +0 -0
  18. data/lib/docusign_admin/client/api_client.rb +597 -0
  19. data/lib/docusign_admin/client/api_error.rb +37 -0
  20. data/lib/docusign_admin/client/auth/oauth.rb +1061 -0
  21. data/lib/docusign_admin/configuration.rb +202 -0
  22. data/lib/docusign_admin/models/add_ds_group_and_users_response.rb +192 -0
  23. data/lib/docusign_admin/models/add_ds_group_users_response.rb +203 -0
  24. data/lib/docusign_admin/models/add_user_response.rb +257 -0
  25. data/lib/docusign_admin/models/add_user_response_account_properties.rb +232 -0
  26. data/lib/docusign_admin/models/certificate_response.rb +230 -0
  27. data/lib/docusign_admin/models/delete_membership_request.rb +188 -0
  28. data/lib/docusign_admin/models/delete_membership_response.rb +192 -0
  29. data/lib/docusign_admin/models/delete_memberships_request.rb +190 -0
  30. data/lib/docusign_admin/models/delete_memberships_response.rb +194 -0
  31. data/lib/docusign_admin/models/delete_response.rb +194 -0
  32. data/lib/docusign_admin/models/delete_user_identity_request.rb +190 -0
  33. data/lib/docusign_admin/models/domain_response.rb +241 -0
  34. data/lib/docusign_admin/models/domains_response.rb +185 -0
  35. data/lib/docusign_admin/models/ds_group_add_request.rb +197 -0
  36. data/lib/docusign_admin/models/ds_group_and_users_response.rb +192 -0
  37. data/lib/docusign_admin/models/ds_group_list_response.rb +221 -0
  38. data/lib/docusign_admin/models/ds_group_request.rb +188 -0
  39. data/lib/docusign_admin/models/ds_group_response.rb +273 -0
  40. data/lib/docusign_admin/models/ds_group_user_response.rb +246 -0
  41. data/lib/docusign_admin/models/ds_group_users_add_request.rb +190 -0
  42. data/lib/docusign_admin/models/ds_group_users_remove_request.rb +190 -0
  43. data/lib/docusign_admin/models/ds_group_users_response.rb +212 -0
  44. data/lib/docusign_admin/models/error_details.rb +192 -0
  45. data/lib/docusign_admin/models/force_activate_membership_request.rb +188 -0
  46. data/lib/docusign_admin/models/group_request.rb +206 -0
  47. data/lib/docusign_admin/models/identity_provider_response.rb +230 -0
  48. data/lib/docusign_admin/models/identity_providers_response.rb +185 -0
  49. data/lib/docusign_admin/models/link_response.rb +192 -0
  50. data/lib/docusign_admin/models/member_group_response.rb +201 -0
  51. data/lib/docusign_admin/models/member_groups_response.rb +194 -0
  52. data/lib/docusign_admin/models/membership_response.rb +266 -0
  53. data/lib/docusign_admin/models/new_account_user_request.rb +289 -0
  54. data/lib/docusign_admin/models/new_multi_product_user_add_request.rb +287 -0
  55. data/lib/docusign_admin/models/new_user_request.rb +285 -0
  56. data/lib/docusign_admin/models/new_user_request_account_properties.rb +226 -0
  57. data/lib/docusign_admin/models/new_user_response.rb +257 -0
  58. data/lib/docusign_admin/models/new_user_response_account_properties.rb +230 -0
  59. data/lib/docusign_admin/models/oasirr_error_details.rb +192 -0
  60. data/lib/docusign_admin/models/oasirr_organization_account_settings_error_data_response.rb +219 -0
  61. data/lib/docusign_admin/models/oetr_error_details.rb +192 -0
  62. data/lib/docusign_admin/models/org_export_selected_account.rb +183 -0
  63. data/lib/docusign_admin/models/org_export_selected_domain.rb +183 -0
  64. data/lib/docusign_admin/models/org_report_configuration_response.rb +203 -0
  65. data/lib/docusign_admin/models/org_report_create_response.rb +183 -0
  66. data/lib/docusign_admin/models/org_report_list_response.rb +185 -0
  67. data/lib/docusign_admin/models/org_report_list_response_org_report.rb +282 -0
  68. data/lib/docusign_admin/models/org_report_list_response_requestor.rb +192 -0
  69. data/lib/docusign_admin/models/org_report_request.rb +221 -0
  70. data/lib/docusign_admin/models/organization_account_request.rb +188 -0
  71. data/lib/docusign_admin/models/organization_account_response.rb +210 -0
  72. data/lib/docusign_admin/models/organization_account_settings_import_requestor_response.rb +210 -0
  73. data/lib/docusign_admin/models/organization_account_settings_import_response.rb +313 -0
  74. data/lib/docusign_admin/models/organization_account_settings_import_result_response.rb +239 -0
  75. data/lib/docusign_admin/models/organization_accounts_request.rb +185 -0
  76. data/lib/docusign_admin/models/organization_export_account.rb +183 -0
  77. data/lib/docusign_admin/models/organization_export_domain.rb +183 -0
  78. data/lib/docusign_admin/models/organization_export_request.rb +205 -0
  79. data/lib/docusign_admin/models/organization_export_requestor_response.rb +210 -0
  80. data/lib/docusign_admin/models/organization_export_response.rb +324 -0
  81. data/lib/docusign_admin/models/organization_export_task_response.rb +228 -0
  82. data/lib/docusign_admin/models/organization_exports_response.rb +185 -0
  83. data/lib/docusign_admin/models/organization_import_response.rb +414 -0
  84. data/lib/docusign_admin/models/organization_import_response_error_rollup.rb +192 -0
  85. data/lib/docusign_admin/models/organization_import_response_requestor.rb +210 -0
  86. data/lib/docusign_admin/models/organization_import_response_warning_rollup.rb +192 -0
  87. data/lib/docusign_admin/models/organization_imports_response.rb +185 -0
  88. data/lib/docusign_admin/models/organization_response.rb +310 -0
  89. data/lib/docusign_admin/models/organization_salesforce_account_managers_response.rb +228 -0
  90. data/lib/docusign_admin/models/organization_simple_id_object.rb +183 -0
  91. data/lib/docusign_admin/models/organization_user_response.rb +275 -0
  92. data/lib/docusign_admin/models/organization_users_response.rb +194 -0
  93. data/lib/docusign_admin/models/organizations_response.rb +185 -0
  94. data/lib/docusign_admin/models/osamr_contact.rb +201 -0
  95. data/lib/docusign_admin/models/paging_response_properties.rb +228 -0
  96. data/lib/docusign_admin/models/permission_profile_request.rb +197 -0
  97. data/lib/docusign_admin/models/permission_profile_response.rb +192 -0
  98. data/lib/docusign_admin/models/permission_profile_response2_1.rb +192 -0
  99. data/lib/docusign_admin/models/permissions_response.rb +185 -0
  100. data/lib/docusign_admin/models/product_permission_profile_request.rb +202 -0
  101. data/lib/docusign_admin/models/product_permission_profile_response.rb +212 -0
  102. data/lib/docusign_admin/models/product_permission_profiles_request.rb +190 -0
  103. data/lib/docusign_admin/models/product_permission_profiles_response.rb +185 -0
  104. data/lib/docusign_admin/models/remove_ds_group_users_response.rb +194 -0
  105. data/lib/docusign_admin/models/required_attribute_mapping_response.rb +210 -0
  106. data/lib/docusign_admin/models/saml2_identity_provider_response.rb +216 -0
  107. data/lib/docusign_admin/models/setting_response.rb +201 -0
  108. data/lib/docusign_admin/models/update_membership_request.rb +244 -0
  109. data/lib/docusign_admin/models/update_response.rb +183 -0
  110. data/lib/docusign_admin/models/update_user_email_request.rb +216 -0
  111. data/lib/docusign_admin/models/update_user_request.rb +303 -0
  112. data/lib/docusign_admin/models/update_users_email_request.rb +185 -0
  113. data/lib/docusign_admin/models/update_users_request.rb +185 -0
  114. data/lib/docusign_admin/models/user_drilldown_response.rb +340 -0
  115. data/lib/docusign_admin/models/user_identity_request.rb +183 -0
  116. data/lib/docusign_admin/models/user_identity_response.rb +219 -0
  117. data/lib/docusign_admin/models/user_product_permission_profiles_response.rb +203 -0
  118. data/lib/docusign_admin/models/user_update_response.rb +210 -0
  119. data/lib/docusign_admin/models/users_drilldown_response.rb +185 -0
  120. data/lib/docusign_admin/models/users_update_response.rb +194 -0
  121. data/lib/docusign_admin/version.rb +14 -0
  122. data/lib/docusign_admin.rb +148 -0
  123. data/tests/.DS_Store +0 -0
  124. data/tests/Gemfile +5 -0
  125. data/tests/docs/Test.pdf +0 -0
  126. data/tests/docs/organization_user_import.csv +2 -0
  127. data/tests/spec/unit_tests_using_jwt_spec.rb +231 -0
  128. metadata +370 -0
@@ -0,0 +1,221 @@
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
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 OrgReportRequest
16
+ attr_accessor :report_type
17
+
18
+ attr_accessor :report_date_range
19
+
20
+ attr_accessor :account_ids
21
+
22
+ attr_accessor :custom_start_date
23
+
24
+ attr_accessor :custom_end_date
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'report_type' => :'report_type',
30
+ :'report_date_range' => :'report_date_range',
31
+ :'account_ids' => :'account_ids',
32
+ :'custom_start_date' => :'custom_start_date',
33
+ :'custom_end_date' => :'custom_end_date'
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.swagger_types
39
+ {
40
+ :'report_type' => :'String',
41
+ :'report_date_range' => :'String',
42
+ :'account_ids' => :'Array<String>',
43
+ :'custom_start_date' => :'DateTime',
44
+ :'custom_end_date' => :'DateTime'
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?(:'report_type')
57
+ self.report_type = attributes[:'report_type']
58
+ end
59
+
60
+ if attributes.has_key?(:'report_date_range')
61
+ self.report_date_range = attributes[:'report_date_range']
62
+ end
63
+
64
+ if attributes.has_key?(:'account_ids')
65
+ if (value = attributes[:'account_ids']).is_a?(Array)
66
+ self.account_ids = value
67
+ end
68
+ end
69
+
70
+ if attributes.has_key?(:'custom_start_date')
71
+ self.custom_start_date = attributes[:'custom_start_date']
72
+ end
73
+
74
+ if attributes.has_key?(:'custom_end_date')
75
+ self.custom_end_date = attributes[:'custom_end_date']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ true
90
+ end
91
+
92
+ # Checks equality by comparing each attribute.
93
+ # @param [Object] Object to be compared
94
+ def ==(o)
95
+ return true if self.equal?(o)
96
+ self.class == o.class &&
97
+ report_type == o.report_type &&
98
+ report_date_range == o.report_date_range &&
99
+ account_ids == o.account_ids &&
100
+ custom_start_date == o.custom_start_date &&
101
+ custom_end_date == o.custom_end_date
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Fixnum] Hash code
112
+ def hash
113
+ [report_type, report_date_range, account_ids, custom_start_date, custom_end_date].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ self.class.swagger_types.each_pair do |key, type|
122
+ if type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the attribute
124
+ # is documented as an array but the input is not
125
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
126
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
127
+ end
128
+ elsif !attributes[self.class.attribute_map[key]].nil?
129
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
130
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
131
+ end
132
+
133
+ self
134
+ end
135
+
136
+ # Deserializes the data based on type
137
+ # @param string type Data type
138
+ # @param string value Value to be deserialized
139
+ # @return [Object] Deserialized data
140
+ def _deserialize(type, value)
141
+ case type.to_sym
142
+ when :DateTime
143
+ DateTime.parse(value)
144
+ when :Date
145
+ Date.parse(value)
146
+ when :String
147
+ value.to_s
148
+ when :Integer
149
+ value.to_i
150
+ when :Float
151
+ value.to_f
152
+ when :BOOLEAN
153
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
154
+ true
155
+ else
156
+ false
157
+ end
158
+ when :Object
159
+ # generic object (usually a Hash), return directly
160
+ value
161
+ when /\AArray<(?<inner_type>.+)>\z/
162
+ inner_type = Regexp.last_match[:inner_type]
163
+ value.map { |v| _deserialize(inner_type, v) }
164
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
165
+ k_type = Regexp.last_match[:k_type]
166
+ v_type = Regexp.last_match[:v_type]
167
+ {}.tap do |hash|
168
+ value.each do |k, v|
169
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
170
+ end
171
+ end
172
+ else # model
173
+ temp_model = DocuSign_Admin.const_get(type).new
174
+ temp_model.build_from_hash(value)
175
+ end
176
+ end
177
+
178
+ # Returns the string representation of the object
179
+ # @return [String] String presentation of the object
180
+ def to_s
181
+ to_hash.to_s
182
+ end
183
+
184
+ # to_body is an alias to to_hash (backward compatibility)
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_body
187
+ to_hash
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = self.send(attr)
196
+ next if value.nil?
197
+ hash[param] = _to_hash(value)
198
+ end
199
+ hash
200
+ end
201
+
202
+ # Outputs non-array value in the form of hash
203
+ # For object, use to_hash. Otherwise, just return the value
204
+ # @param [Object] value Any valid value
205
+ # @return [Hash] Returns the value in the form of hash
206
+ def _to_hash(value)
207
+ if value.is_a?(Array)
208
+ value.compact.map { |v| _to_hash(v) }
209
+ elsif value.is_a?(Hash)
210
+ {}.tap do |hash|
211
+ value.each { |k, v| hash[k] = _to_hash(v) }
212
+ end
213
+ elsif value.respond_to? :to_hash
214
+ value.to_hash
215
+ else
216
+ value
217
+ end
218
+ end
219
+
220
+ end
221
+ end
@@ -0,0 +1,188 @@
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
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 OrganizationAccountRequest
16
+ attr_accessor :account_id
17
+
18
+ # Attribute mapping from ruby-style variable name to JSON key.
19
+ def self.attribute_map
20
+ {
21
+ :'account_id' => :'account_id'
22
+ }
23
+ end
24
+
25
+ # Attribute type mapping.
26
+ def self.swagger_types
27
+ {
28
+ :'account_id' => :'String'
29
+ }
30
+ end
31
+
32
+ # Initializes the object
33
+ # @param [Hash] attributes Model attributes in the form of hash
34
+ def initialize(attributes = {})
35
+ return unless attributes.is_a?(Hash)
36
+
37
+ # convert string to symbol for hash key
38
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
39
+
40
+ if attributes.has_key?(:'account_id')
41
+ self.account_id = attributes[:'account_id']
42
+ end
43
+ end
44
+
45
+ # Show invalid properties with the reasons. Usually used together with valid?
46
+ # @return Array for valid properties with the reasons
47
+ def list_invalid_properties
48
+ invalid_properties = Array.new
49
+ if @account_id.nil?
50
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
51
+ end
52
+
53
+ invalid_properties
54
+ end
55
+
56
+ # Check to see if the all the properties in the model are valid
57
+ # @return true if the model is valid
58
+ def valid?
59
+ return false if @account_id.nil?
60
+ true
61
+ end
62
+
63
+ # Checks equality by comparing each attribute.
64
+ # @param [Object] Object to be compared
65
+ def ==(o)
66
+ return true if self.equal?(o)
67
+ self.class == o.class &&
68
+ account_id == o.account_id
69
+ end
70
+
71
+ # @see the `==` method
72
+ # @param [Object] Object to be compared
73
+ def eql?(o)
74
+ self == o
75
+ end
76
+
77
+ # Calculates hash code according to all attributes.
78
+ # @return [Fixnum] Hash code
79
+ def hash
80
+ [account_id].hash
81
+ end
82
+
83
+ # Builds the object from hash
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ # @return [Object] Returns the model itself
86
+ def build_from_hash(attributes)
87
+ return nil unless attributes.is_a?(Hash)
88
+ self.class.swagger_types.each_pair do |key, type|
89
+ if type =~ /\AArray<(.*)>/i
90
+ # check to ensure the input is an array given that the attribute
91
+ # is documented as an array but the input is not
92
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
93
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
94
+ end
95
+ elsif !attributes[self.class.attribute_map[key]].nil?
96
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
97
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
98
+ end
99
+
100
+ self
101
+ end
102
+
103
+ # Deserializes the data based on type
104
+ # @param string type Data type
105
+ # @param string value Value to be deserialized
106
+ # @return [Object] Deserialized data
107
+ def _deserialize(type, value)
108
+ case type.to_sym
109
+ when :DateTime
110
+ DateTime.parse(value)
111
+ when :Date
112
+ Date.parse(value)
113
+ when :String
114
+ value.to_s
115
+ when :Integer
116
+ value.to_i
117
+ when :Float
118
+ value.to_f
119
+ when :BOOLEAN
120
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
121
+ true
122
+ else
123
+ false
124
+ end
125
+ when :Object
126
+ # generic object (usually a Hash), return directly
127
+ value
128
+ when /\AArray<(?<inner_type>.+)>\z/
129
+ inner_type = Regexp.last_match[:inner_type]
130
+ value.map { |v| _deserialize(inner_type, v) }
131
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
132
+ k_type = Regexp.last_match[:k_type]
133
+ v_type = Regexp.last_match[:v_type]
134
+ {}.tap do |hash|
135
+ value.each do |k, v|
136
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
137
+ end
138
+ end
139
+ else # model
140
+ temp_model = DocuSign_Admin.const_get(type).new
141
+ temp_model.build_from_hash(value)
142
+ end
143
+ end
144
+
145
+ # Returns the string representation of the object
146
+ # @return [String] String presentation of the object
147
+ def to_s
148
+ to_hash.to_s
149
+ end
150
+
151
+ # to_body is an alias to to_hash (backward compatibility)
152
+ # @return [Hash] Returns the object in the form of hash
153
+ def to_body
154
+ to_hash
155
+ end
156
+
157
+ # Returns the object in the form of hash
158
+ # @return [Hash] Returns the object in the form of hash
159
+ def to_hash
160
+ hash = {}
161
+ self.class.attribute_map.each_pair do |attr, param|
162
+ value = self.send(attr)
163
+ next if value.nil?
164
+ hash[param] = _to_hash(value)
165
+ end
166
+ hash
167
+ end
168
+
169
+ # Outputs non-array value in the form of hash
170
+ # For object, use to_hash. Otherwise, just return the value
171
+ # @param [Object] value Any valid value
172
+ # @return [Hash] Returns the value in the form of hash
173
+ def _to_hash(value)
174
+ if value.is_a?(Array)
175
+ value.compact.map { |v| _to_hash(v) }
176
+ elsif value.is_a?(Hash)
177
+ {}.tap do |hash|
178
+ value.each { |k, v| hash[k] = _to_hash(v) }
179
+ end
180
+ elsif value.respond_to? :to_hash
181
+ value.to_hash
182
+ else
183
+ value
184
+ end
185
+ end
186
+
187
+ end
188
+ end
@@ -0,0 +1,210 @@
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
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 OrganizationAccountResponse
16
+ attr_accessor :id
17
+
18
+ attr_accessor :name
19
+
20
+ attr_accessor :external_account_id
21
+
22
+ attr_accessor :site_id
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'id' => :'id',
28
+ :'name' => :'name',
29
+ :'external_account_id' => :'external_account_id',
30
+ :'site_id' => :'site_id'
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.swagger_types
36
+ {
37
+ :'id' => :'String',
38
+ :'name' => :'String',
39
+ :'external_account_id' => :'Integer',
40
+ :'site_id' => :'Integer'
41
+ }
42
+ end
43
+
44
+ # Initializes the object
45
+ # @param [Hash] attributes Model attributes in the form of hash
46
+ def initialize(attributes = {})
47
+ return unless attributes.is_a?(Hash)
48
+
49
+ # convert string to symbol for hash key
50
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
51
+
52
+ if attributes.has_key?(:'id')
53
+ self.id = attributes[:'id']
54
+ end
55
+
56
+ if attributes.has_key?(:'name')
57
+ self.name = attributes[:'name']
58
+ end
59
+
60
+ if attributes.has_key?(:'external_account_id')
61
+ self.external_account_id = attributes[:'external_account_id']
62
+ end
63
+
64
+ if attributes.has_key?(:'site_id')
65
+ self.site_id = attributes[:'site_id']
66
+ end
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = Array.new
73
+ invalid_properties
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ true
80
+ end
81
+
82
+ # Checks equality by comparing each attribute.
83
+ # @param [Object] Object to be compared
84
+ def ==(o)
85
+ return true if self.equal?(o)
86
+ self.class == o.class &&
87
+ id == o.id &&
88
+ name == o.name &&
89
+ external_account_id == o.external_account_id &&
90
+ site_id == o.site_id
91
+ end
92
+
93
+ # @see the `==` method
94
+ # @param [Object] Object to be compared
95
+ def eql?(o)
96
+ self == o
97
+ end
98
+
99
+ # Calculates hash code according to all attributes.
100
+ # @return [Fixnum] Hash code
101
+ def hash
102
+ [id, name, external_account_id, site_id].hash
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ self.class.swagger_types.each_pair do |key, type|
111
+ if type =~ /\AArray<(.*)>/i
112
+ # check to ensure the input is an array given that the attribute
113
+ # is documented as an array but the input is not
114
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
115
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
116
+ end
117
+ elsif !attributes[self.class.attribute_map[key]].nil?
118
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
119
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
120
+ end
121
+
122
+ self
123
+ end
124
+
125
+ # Deserializes the data based on type
126
+ # @param string type Data type
127
+ # @param string value Value to be deserialized
128
+ # @return [Object] Deserialized data
129
+ def _deserialize(type, value)
130
+ case type.to_sym
131
+ when :DateTime
132
+ DateTime.parse(value)
133
+ when :Date
134
+ Date.parse(value)
135
+ when :String
136
+ value.to_s
137
+ when :Integer
138
+ value.to_i
139
+ when :Float
140
+ value.to_f
141
+ when :BOOLEAN
142
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
143
+ true
144
+ else
145
+ false
146
+ end
147
+ when :Object
148
+ # generic object (usually a Hash), return directly
149
+ value
150
+ when /\AArray<(?<inner_type>.+)>\z/
151
+ inner_type = Regexp.last_match[:inner_type]
152
+ value.map { |v| _deserialize(inner_type, v) }
153
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
154
+ k_type = Regexp.last_match[:k_type]
155
+ v_type = Regexp.last_match[:v_type]
156
+ {}.tap do |hash|
157
+ value.each do |k, v|
158
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
159
+ end
160
+ end
161
+ else # model
162
+ temp_model = DocuSign_Admin.const_get(type).new
163
+ temp_model.build_from_hash(value)
164
+ end
165
+ end
166
+
167
+ # Returns the string representation of the object
168
+ # @return [String] String presentation of the object
169
+ def to_s
170
+ to_hash.to_s
171
+ end
172
+
173
+ # to_body is an alias to to_hash (backward compatibility)
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_body
176
+ to_hash
177
+ end
178
+
179
+ # Returns the object in the form of hash
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_hash
182
+ hash = {}
183
+ self.class.attribute_map.each_pair do |attr, param|
184
+ value = self.send(attr)
185
+ next if value.nil?
186
+ hash[param] = _to_hash(value)
187
+ end
188
+ hash
189
+ end
190
+
191
+ # Outputs non-array value in the form of hash
192
+ # For object, use to_hash. Otherwise, just return the value
193
+ # @param [Object] value Any valid value
194
+ # @return [Hash] Returns the value in the form of hash
195
+ def _to_hash(value)
196
+ if value.is_a?(Array)
197
+ value.compact.map { |v| _to_hash(v) }
198
+ elsif value.is_a?(Hash)
199
+ {}.tap do |hash|
200
+ value.each { |k, v| hash[k] = _to_hash(v) }
201
+ end
202
+ elsif value.respond_to? :to_hash
203
+ value.to_hash
204
+ else
205
+ value
206
+ end
207
+ end
208
+
209
+ end
210
+ end