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,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
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 OrgReportConfigurationResponse
16
+ attr_accessor :is_account_limit_disabled
17
+
18
+ attr_accessor :custom_dates_enabled
19
+
20
+ attr_accessor :enabled_report_types
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'is_account_limit_disabled' => :'is_account_limit_disabled',
26
+ :'custom_dates_enabled' => :'custom_dates_enabled',
27
+ :'enabled_report_types' => :'enabled_report_types'
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.swagger_types
33
+ {
34
+ :'is_account_limit_disabled' => :'BOOLEAN',
35
+ :'custom_dates_enabled' => :'BOOLEAN',
36
+ :'enabled_report_types' => :'Array<Integer>'
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?(:'is_account_limit_disabled')
49
+ self.is_account_limit_disabled = attributes[:'is_account_limit_disabled']
50
+ end
51
+
52
+ if attributes.has_key?(:'custom_dates_enabled')
53
+ self.custom_dates_enabled = attributes[:'custom_dates_enabled']
54
+ end
55
+
56
+ if attributes.has_key?(:'enabled_report_types')
57
+ if (value = attributes[:'enabled_report_types']).is_a?(Array)
58
+ self.enabled_report_types = 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
+ is_account_limit_disabled == o.is_account_limit_disabled &&
82
+ custom_dates_enabled == o.custom_dates_enabled &&
83
+ enabled_report_types == o.enabled_report_types
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
+ [is_account_limit_disabled, custom_dates_enabled, enabled_report_types].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,183 @@
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 OrgReportCreateResponse
16
+ attr_accessor :report_correlation_id
17
+
18
+ # Attribute mapping from ruby-style variable name to JSON key.
19
+ def self.attribute_map
20
+ {
21
+ :'report_correlation_id' => :'report_correlation_id'
22
+ }
23
+ end
24
+
25
+ # Attribute type mapping.
26
+ def self.swagger_types
27
+ {
28
+ :'report_correlation_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?(:'report_correlation_id')
41
+ self.report_correlation_id = attributes[:'report_correlation_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
+ invalid_properties
50
+ end
51
+
52
+ # Check to see if the all the properties in the model are valid
53
+ # @return true if the model is valid
54
+ def valid?
55
+ true
56
+ end
57
+
58
+ # Checks equality by comparing each attribute.
59
+ # @param [Object] Object to be compared
60
+ def ==(o)
61
+ return true if self.equal?(o)
62
+ self.class == o.class &&
63
+ report_correlation_id == o.report_correlation_id
64
+ end
65
+
66
+ # @see the `==` method
67
+ # @param [Object] Object to be compared
68
+ def eql?(o)
69
+ self == o
70
+ end
71
+
72
+ # Calculates hash code according to all attributes.
73
+ # @return [Fixnum] Hash code
74
+ def hash
75
+ [report_correlation_id].hash
76
+ end
77
+
78
+ # Builds the object from hash
79
+ # @param [Hash] attributes Model attributes in the form of hash
80
+ # @return [Object] Returns the model itself
81
+ def build_from_hash(attributes)
82
+ return nil unless attributes.is_a?(Hash)
83
+ self.class.swagger_types.each_pair do |key, type|
84
+ if type =~ /\AArray<(.*)>/i
85
+ # check to ensure the input is an array given that the attribute
86
+ # is documented as an array but the input is not
87
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
88
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
89
+ end
90
+ elsif !attributes[self.class.attribute_map[key]].nil?
91
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
92
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
93
+ end
94
+
95
+ self
96
+ end
97
+
98
+ # Deserializes the data based on type
99
+ # @param string type Data type
100
+ # @param string value Value to be deserialized
101
+ # @return [Object] Deserialized data
102
+ def _deserialize(type, value)
103
+ case type.to_sym
104
+ when :DateTime
105
+ DateTime.parse(value)
106
+ when :Date
107
+ Date.parse(value)
108
+ when :String
109
+ value.to_s
110
+ when :Integer
111
+ value.to_i
112
+ when :Float
113
+ value.to_f
114
+ when :BOOLEAN
115
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
116
+ true
117
+ else
118
+ false
119
+ end
120
+ when :Object
121
+ # generic object (usually a Hash), return directly
122
+ value
123
+ when /\AArray<(?<inner_type>.+)>\z/
124
+ inner_type = Regexp.last_match[:inner_type]
125
+ value.map { |v| _deserialize(inner_type, v) }
126
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
127
+ k_type = Regexp.last_match[:k_type]
128
+ v_type = Regexp.last_match[:v_type]
129
+ {}.tap do |hash|
130
+ value.each do |k, v|
131
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
132
+ end
133
+ end
134
+ else # model
135
+ temp_model = DocuSign_Admin.const_get(type).new
136
+ temp_model.build_from_hash(value)
137
+ end
138
+ end
139
+
140
+ # Returns the string representation of the object
141
+ # @return [String] String presentation of the object
142
+ def to_s
143
+ to_hash.to_s
144
+ end
145
+
146
+ # to_body is an alias to to_hash (backward compatibility)
147
+ # @return [Hash] Returns the object in the form of hash
148
+ def to_body
149
+ to_hash
150
+ end
151
+
152
+ # Returns the object in the form of hash
153
+ # @return [Hash] Returns the object in the form of hash
154
+ def to_hash
155
+ hash = {}
156
+ self.class.attribute_map.each_pair do |attr, param|
157
+ value = self.send(attr)
158
+ next if value.nil?
159
+ hash[param] = _to_hash(value)
160
+ end
161
+ hash
162
+ end
163
+
164
+ # Outputs non-array value in the form of hash
165
+ # For object, use to_hash. Otherwise, just return the value
166
+ # @param [Object] value Any valid value
167
+ # @return [Hash] Returns the value in the form of hash
168
+ def _to_hash(value)
169
+ if value.is_a?(Array)
170
+ value.compact.map { |v| _to_hash(v) }
171
+ elsif value.is_a?(Hash)
172
+ {}.tap do |hash|
173
+ value.each { |k, v| hash[k] = _to_hash(v) }
174
+ end
175
+ elsif value.respond_to? :to_hash
176
+ value.to_hash
177
+ else
178
+ value
179
+ end
180
+ end
181
+
182
+ end
183
+ end
@@ -0,0 +1,185 @@
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 OrgReportListResponse
16
+ attr_accessor :reports
17
+
18
+ # Attribute mapping from ruby-style variable name to JSON key.
19
+ def self.attribute_map
20
+ {
21
+ :'reports' => :'reports'
22
+ }
23
+ end
24
+
25
+ # Attribute type mapping.
26
+ def self.swagger_types
27
+ {
28
+ :'reports' => :'Array<OrgReportListResponseOrgReport>'
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?(:'reports')
41
+ if (value = attributes[:'reports']).is_a?(Array)
42
+ self.reports = value
43
+ end
44
+ end
45
+ end
46
+
47
+ # Show invalid properties with the reasons. Usually used together with valid?
48
+ # @return Array for valid properties with the reasons
49
+ def list_invalid_properties
50
+ invalid_properties = Array.new
51
+ invalid_properties
52
+ end
53
+
54
+ # Check to see if the all the properties in the model are valid
55
+ # @return true if the model is valid
56
+ def valid?
57
+ true
58
+ end
59
+
60
+ # Checks equality by comparing each attribute.
61
+ # @param [Object] Object to be compared
62
+ def ==(o)
63
+ return true if self.equal?(o)
64
+ self.class == o.class &&
65
+ reports == o.reports
66
+ end
67
+
68
+ # @see the `==` method
69
+ # @param [Object] Object to be compared
70
+ def eql?(o)
71
+ self == o
72
+ end
73
+
74
+ # Calculates hash code according to all attributes.
75
+ # @return [Fixnum] Hash code
76
+ def hash
77
+ [reports].hash
78
+ end
79
+
80
+ # Builds the object from hash
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ # @return [Object] Returns the model itself
83
+ def build_from_hash(attributes)
84
+ return nil unless attributes.is_a?(Hash)
85
+ self.class.swagger_types.each_pair do |key, type|
86
+ if type =~ /\AArray<(.*)>/i
87
+ # check to ensure the input is an array given that the attribute
88
+ # is documented as an array but the input is not
89
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
90
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
91
+ end
92
+ elsif !attributes[self.class.attribute_map[key]].nil?
93
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
94
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
95
+ end
96
+
97
+ self
98
+ end
99
+
100
+ # Deserializes the data based on type
101
+ # @param string type Data type
102
+ # @param string value Value to be deserialized
103
+ # @return [Object] Deserialized data
104
+ def _deserialize(type, value)
105
+ case type.to_sym
106
+ when :DateTime
107
+ DateTime.parse(value)
108
+ when :Date
109
+ Date.parse(value)
110
+ when :String
111
+ value.to_s
112
+ when :Integer
113
+ value.to_i
114
+ when :Float
115
+ value.to_f
116
+ when :BOOLEAN
117
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
118
+ true
119
+ else
120
+ false
121
+ end
122
+ when :Object
123
+ # generic object (usually a Hash), return directly
124
+ value
125
+ when /\AArray<(?<inner_type>.+)>\z/
126
+ inner_type = Regexp.last_match[:inner_type]
127
+ value.map { |v| _deserialize(inner_type, v) }
128
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
129
+ k_type = Regexp.last_match[:k_type]
130
+ v_type = Regexp.last_match[:v_type]
131
+ {}.tap do |hash|
132
+ value.each do |k, v|
133
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
134
+ end
135
+ end
136
+ else # model
137
+ temp_model = DocuSign_Admin.const_get(type).new
138
+ temp_model.build_from_hash(value)
139
+ end
140
+ end
141
+
142
+ # Returns the string representation of the object
143
+ # @return [String] String presentation of the object
144
+ def to_s
145
+ to_hash.to_s
146
+ end
147
+
148
+ # to_body is an alias to to_hash (backward compatibility)
149
+ # @return [Hash] Returns the object in the form of hash
150
+ def to_body
151
+ to_hash
152
+ end
153
+
154
+ # Returns the object in the form of hash
155
+ # @return [Hash] Returns the object in the form of hash
156
+ def to_hash
157
+ hash = {}
158
+ self.class.attribute_map.each_pair do |attr, param|
159
+ value = self.send(attr)
160
+ next if value.nil?
161
+ hash[param] = _to_hash(value)
162
+ end
163
+ hash
164
+ end
165
+
166
+ # Outputs non-array value in the form of hash
167
+ # For object, use to_hash. Otherwise, just return the value
168
+ # @param [Object] value Any valid value
169
+ # @return [Hash] Returns the value in the form of hash
170
+ def _to_hash(value)
171
+ if value.is_a?(Array)
172
+ value.compact.map { |v| _to_hash(v) }
173
+ elsif value.is_a?(Hash)
174
+ {}.tap do |hash|
175
+ value.each { |k, v| hash[k] = _to_hash(v) }
176
+ end
177
+ elsif value.respond_to? :to_hash
178
+ value.to_hash
179
+ else
180
+ value
181
+ end
182
+ end
183
+
184
+ end
185
+ end