docusign_esign 3.22.0 → 3.24.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/lib/docusign_esign/api/accounts_api.rb +519 -4
  4. data/lib/docusign_esign/api/billing_api.rb +2 -2
  5. data/lib/docusign_esign/api/envelopes_api.rb +2 -2
  6. data/lib/docusign_esign/client/api_client.rb +1 -1
  7. data/lib/docusign_esign/models/account_settings_information.rb +302 -2
  8. data/lib/docusign_esign/models/account_ui_settings.rb +21 -1
  9. data/lib/docusign_esign/models/authorization_user.rb +214 -0
  10. data/lib/docusign_esign/models/billing_charge.rb +1 -1
  11. data/lib/docusign_esign/models/bulk_send_batch_summary.rb +21 -1
  12. data/lib/docusign_esign/models/delayed_routing.rb +1 -1
  13. data/lib/docusign_esign/models/initial_here.rb +1 -1
  14. data/lib/docusign_esign/models/offline_attributes.rb +1 -1
  15. data/lib/docusign_esign/models/scheduled_sending.rb +1 -1
  16. data/lib/docusign_esign/models/user_authorization.rb +274 -0
  17. data/lib/docusign_esign/models/user_authorization_create_request.rb +214 -0
  18. data/lib/docusign_esign/models/user_authorization_create_request_with_id.rb +224 -0
  19. data/lib/docusign_esign/models/user_authorization_id_with_status.rb +204 -0
  20. data/lib/docusign_esign/models/user_authorization_update_request.rb +194 -0
  21. data/lib/docusign_esign/models/user_authorization_with_status.rb +204 -0
  22. data/lib/docusign_esign/models/user_authorizations.rb +246 -0
  23. data/lib/docusign_esign/models/user_authorizations_delete_request.rb +186 -0
  24. data/lib/docusign_esign/models/user_authorizations_delete_response.rb +186 -0
  25. data/lib/docusign_esign/models/user_authorizations_request.rb +186 -0
  26. data/lib/docusign_esign/models/user_authorizations_response.rb +186 -0
  27. data/lib/docusign_esign/version.rb +1 -1
  28. data/lib/docusign_esign.rb +12 -0
  29. metadata +14 -2
@@ -17,6 +17,12 @@ module DocuSign_eSign
17
17
  #
18
18
  attr_accessor :admin_message
19
19
 
20
+ #
21
+ attr_accessor :allow_users_to_edit_shared_access
22
+
23
+ #
24
+ attr_accessor :allow_users_to_edit_shared_access_metadata
25
+
20
26
  #
21
27
  attr_accessor :ask_an_admin
22
28
 
@@ -108,6 +114,8 @@ module DocuSign_eSign
108
114
  def self.attribute_map
109
115
  {
110
116
  :'admin_message' => :'adminMessage',
117
+ :'allow_users_to_edit_shared_access' => :'allowUsersToEditSharedAccess',
118
+ :'allow_users_to_edit_shared_access_metadata' => :'allowUsersToEditSharedAccessMetadata',
111
119
  :'ask_an_admin' => :'askAnAdmin',
112
120
  :'clickwrap_schema_version' => :'clickwrapSchemaVersion',
113
121
  :'clickwrap_schema_version_metadata' => :'clickwrapSchemaVersionMetadata',
@@ -144,6 +152,8 @@ module DocuSign_eSign
144
152
  def self.swagger_types
145
153
  {
146
154
  :'admin_message' => :'AdminMessage',
155
+ :'allow_users_to_edit_shared_access' => :'String',
156
+ :'allow_users_to_edit_shared_access_metadata' => :'SettingsMetadata',
147
157
  :'ask_an_admin' => :'AskAnAdmin',
148
158
  :'clickwrap_schema_version' => :'String',
149
159
  :'clickwrap_schema_version_metadata' => :'SettingsMetadata',
@@ -188,6 +198,14 @@ module DocuSign_eSign
188
198
  self.admin_message = attributes[:'adminMessage']
189
199
  end
190
200
 
201
+ if attributes.has_key?(:'allowUsersToEditSharedAccess')
202
+ self.allow_users_to_edit_shared_access = attributes[:'allowUsersToEditSharedAccess']
203
+ end
204
+
205
+ if attributes.has_key?(:'allowUsersToEditSharedAccessMetadata')
206
+ self.allow_users_to_edit_shared_access_metadata = attributes[:'allowUsersToEditSharedAccessMetadata']
207
+ end
208
+
191
209
  if attributes.has_key?(:'askAnAdmin')
192
210
  self.ask_an_admin = attributes[:'askAnAdmin']
193
211
  end
@@ -324,6 +342,8 @@ module DocuSign_eSign
324
342
  return true if self.equal?(o)
325
343
  self.class == o.class &&
326
344
  admin_message == o.admin_message &&
345
+ allow_users_to_edit_shared_access == o.allow_users_to_edit_shared_access &&
346
+ allow_users_to_edit_shared_access_metadata == o.allow_users_to_edit_shared_access_metadata &&
327
347
  ask_an_admin == o.ask_an_admin &&
328
348
  clickwrap_schema_version == o.clickwrap_schema_version &&
329
349
  clickwrap_schema_version_metadata == o.clickwrap_schema_version_metadata &&
@@ -364,7 +384,7 @@ module DocuSign_eSign
364
384
  # Calculates hash code according to all attributes.
365
385
  # @return [Fixnum] Hash code
366
386
  def hash
367
- [admin_message, ask_an_admin, clickwrap_schema_version, clickwrap_schema_version_metadata, enable_admin_message, enable_admin_message_metadata, enable_easy_sign_can_use_multi_template_apply, enable_easy_sign_can_use_multi_template_apply_metadata, enable_easy_sign_template_upload, enable_easy_sign_template_upload_metadata, enable_envelope_copy_with_data, enable_envelope_copy_with_data_metadata, enable_legacy_sendflow_link, enable_legacy_sendflow_link_metadata, has_external_linked_accounts, has_external_linked_accounts_metadata, hide_send_an_envelope, hide_send_an_envelope_metadata, hide_use_a_template, hide_use_a_template_in_prepare, hide_use_a_template_in_prepare_metadata, hide_use_a_template_metadata, order_based_recipient_id_generation, order_based_recipient_id_generation_metadata, remove_envelope_forwarding, remove_envelope_forwarding_metadata, should_redact_access_code, should_redact_access_code_metadata, upload_new_image_to_sign_or_initial, upload_new_image_to_sign_or_initial_metadata].hash
387
+ [admin_message, allow_users_to_edit_shared_access, allow_users_to_edit_shared_access_metadata, ask_an_admin, clickwrap_schema_version, clickwrap_schema_version_metadata, enable_admin_message, enable_admin_message_metadata, enable_easy_sign_can_use_multi_template_apply, enable_easy_sign_can_use_multi_template_apply_metadata, enable_easy_sign_template_upload, enable_easy_sign_template_upload_metadata, enable_envelope_copy_with_data, enable_envelope_copy_with_data_metadata, enable_legacy_sendflow_link, enable_legacy_sendflow_link_metadata, has_external_linked_accounts, has_external_linked_accounts_metadata, hide_send_an_envelope, hide_send_an_envelope_metadata, hide_use_a_template, hide_use_a_template_in_prepare, hide_use_a_template_in_prepare_metadata, hide_use_a_template_metadata, order_based_recipient_id_generation, order_based_recipient_id_generation_metadata, remove_envelope_forwarding, remove_envelope_forwarding_metadata, should_redact_access_code, should_redact_access_code_metadata, upload_new_image_to_sign_or_initial, upload_new_image_to_sign_or_initial_metadata].hash
368
388
  end
369
389
 
370
390
  # Builds the object from hash
@@ -0,0 +1,214 @@
1
+ =begin
2
+ #DocuSign REST API
3
+
4
+ #The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
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_eSign
15
+ class AuthorizationUser
16
+ # The account ID associated with the envelope.
17
+ attr_accessor :account_id
18
+
19
+ #
20
+ attr_accessor :email
21
+
22
+ #
23
+ attr_accessor :name
24
+
25
+ #
26
+ attr_accessor :user_id
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'account_id' => :'accountId',
32
+ :'email' => :'email',
33
+ :'name' => :'name',
34
+ :'user_id' => :'userId'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+ :'account_id' => :'String',
42
+ :'email' => :'String',
43
+ :'name' => :'String',
44
+ :'user_id' => :'String'
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?(:'accountId')
57
+ self.account_id = attributes[:'accountId']
58
+ end
59
+
60
+ if attributes.has_key?(:'email')
61
+ self.email = attributes[:'email']
62
+ end
63
+
64
+ if attributes.has_key?(:'name')
65
+ self.name = attributes[:'name']
66
+ end
67
+
68
+ if attributes.has_key?(:'userId')
69
+ self.user_id = attributes[:'userId']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ account_id == o.account_id &&
92
+ email == o.email &&
93
+ name == o.name &&
94
+ user_id == o.user_id
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param [Object] Object to be compared
99
+ def eql?(o)
100
+ self == o
101
+ end
102
+
103
+ # Calculates hash code according to all attributes.
104
+ # @return [Fixnum] Hash code
105
+ def hash
106
+ [account_id, email, name, user_id].hash
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+ self.class.swagger_types.each_pair do |key, type|
115
+ if type =~ /\AArray<(.*)>/i
116
+ # check to ensure the input is an array given that the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :DateTime
136
+ DateTime.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :BOOLEAN
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ temp_model = DocuSign_eSign.const_get(type).new
167
+ temp_model.build_from_hash(value)
168
+ end
169
+ end
170
+
171
+ # Returns the string representation of the object
172
+ # @return [String] String presentation of the object
173
+ def to_s
174
+ to_hash.to_s
175
+ end
176
+
177
+ # to_body is an alias to to_hash (backward compatibility)
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_body
180
+ to_hash
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ next if value.nil?
190
+ hash[param] = _to_hash(value)
191
+ end
192
+ hash
193
+ end
194
+
195
+ # Outputs non-array value in the form of hash
196
+ # For object, use to_hash. Otherwise, just return the value
197
+ # @param [Object] value Any valid value
198
+ # @return [Hash] Returns the value in the form of hash
199
+ def _to_hash(value)
200
+ if value.is_a?(Array)
201
+ value.compact.map { |v| _to_hash(v) }
202
+ elsif value.is_a?(Hash)
203
+ {}.tap do |hash|
204
+ value.each { |k, v| hash[k] = _to_hash(v) }
205
+ end
206
+ elsif value.respond_to? :to_hash
207
+ value.to_hash
208
+ else
209
+ value
210
+ end
211
+ end
212
+
213
+ end
214
+ end
@@ -20,7 +20,7 @@ module DocuSign_eSign
20
20
  # Reserved: TBD
21
21
  attr_accessor :blocked
22
22
 
23
- # Provides information on what services the charge item is for. The following table provides a description of the different chargeName values available at this time. | chargeName | Description | | --- | --- | | id_check | IDÂ Check Charge | | in_person_signing | In Person Signing charge | | envelopes Included | Sent Envelopes for the account | | age_verify | Age verification check | | ofac | OFAC Check | | id_confirm | ID confirmation check | | student_authentication | STAN PIN authentication check | | wet_sign_fax | Pages for returning signed documents by fax | | attachment_fax | Pages for returning attachments by fax | | phone_authentication | Phone authentication charge | | powerforms | PowerForm envelopes sent | | signer_payments | Payment processing charge | | outbound_fax | Send by fax charge | | bulk_recipient_envelopes | Bulk Recipient Envelopes sent | | sms_authentications | SMS authentication charge | | saml_authentications | SAML authentication charge | | express_signer_certificate | DocuSign Express Certificate charge | | personal_signer_certificate | Personal Signer Certificate charge | | safe_certificate | SAFE BioPharma Signer Certificate charge | | seats | Included active seats charge | | open_trust_certificate | OpenTrust Signer Certificate charge |
23
+ # Provides information on what services the charge item is for. The following table provides a description of the different chargeName values available at this time. | chargeName | Description | | --- | --- | | id_check | ID Check Charge | | in_person_signing | In Person Signing charge | | envelopes Included | Sent Envelopes for the account | | age_verify | Age verification check | | ofac | OFAC Check | | id_confirm | ID confirmation check | | student_authentication | STAN PIN authentication check | | wet_sign_fax | Pages for returning signed documents by fax | | attachment_fax | Pages for returning attachments by fax | | phone_authentication | Phone authentication charge | | powerforms | PowerForm envelopes sent | | signer_payments | Payment processing charge | | outbound_fax | Send by fax charge | | bulk_recipient_envelopes | Bulk Recipient Envelopes sent | | sms_authentications | SMS authentication charge | | saml_authentications | SAML authentication charge | | express_signer_certificate | DocuSign Express Certificate charge | | personal_signer_certificate | Personal Signer Certificate charge | | safe_certificate | SAFE BioPharma Signer Certificate charge | | seats | Included active seats charge | | open_trust_certificate | OpenTrust Signer Certificate charge |
24
24
  attr_accessor :charge_name
25
25
 
26
26
  # Reserved: TBD
@@ -14,6 +14,12 @@ require 'date'
14
14
  module DocuSign_eSign
15
15
  # Summary status of a single batch.
16
16
  class BulkSendBatchSummary
17
+ #
18
+ attr_accessor :action
19
+
20
+ #
21
+ attr_accessor :action_status
22
+
17
23
  #
18
24
  attr_accessor :batch_id
19
25
 
@@ -41,6 +47,8 @@ module DocuSign_eSign
41
47
  # Attribute mapping from ruby-style variable name to JSON key.
42
48
  def self.attribute_map
43
49
  {
50
+ :'action' => :'action',
51
+ :'action_status' => :'actionStatus',
44
52
  :'batch_id' => :'batchId',
45
53
  :'batch_name' => :'batchName',
46
54
  :'batch_size' => :'batchSize',
@@ -55,6 +63,8 @@ module DocuSign_eSign
55
63
  # Attribute type mapping.
56
64
  def self.swagger_types
57
65
  {
66
+ :'action' => :'String',
67
+ :'action_status' => :'String',
58
68
  :'batch_id' => :'String',
59
69
  :'batch_name' => :'String',
60
70
  :'batch_size' => :'String',
@@ -74,6 +84,14 @@ module DocuSign_eSign
74
84
  # convert string to symbol for hash key
75
85
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
76
86
 
87
+ if attributes.has_key?(:'action')
88
+ self.action = attributes[:'action']
89
+ end
90
+
91
+ if attributes.has_key?(:'actionStatus')
92
+ self.action_status = attributes[:'actionStatus']
93
+ end
94
+
77
95
  if attributes.has_key?(:'batchId')
78
96
  self.batch_id = attributes[:'batchId']
79
97
  end
@@ -125,6 +143,8 @@ module DocuSign_eSign
125
143
  def ==(o)
126
144
  return true if self.equal?(o)
127
145
  self.class == o.class &&
146
+ action == o.action &&
147
+ action_status == o.action_status &&
128
148
  batch_id == o.batch_id &&
129
149
  batch_name == o.batch_name &&
130
150
  batch_size == o.batch_size &&
@@ -144,7 +164,7 @@ module DocuSign_eSign
144
164
  # Calculates hash code according to all attributes.
145
165
  # @return [Fixnum] Hash code
146
166
  def hash
147
- [batch_id, batch_name, batch_size, batch_uri, failed, queued, sent, submitted_date].hash
167
+ [action, action_status, batch_id, batch_name, batch_size, batch_uri, failed, queued, sent, submitted_date].hash
148
168
  end
149
169
 
150
170
  # Builds the object from hash
@@ -19,7 +19,7 @@ module DocuSign_eSign
19
19
  # A list of envelope delay rules specified by the user indicating how and when the envelope should be sent in the future for the current workflow step and its associated recipients. Currently only 1 rule may be specified.
20
20
  attr_accessor :rules
21
21
 
22
- # Indicates the envelope status. Valid values are: * sent - The envelope is sent to the recipients. * created - The envelope is saved as a draft and can be modified and sent later.
22
+ # \\\"pending\\\" if the current workflow step has not been reached and the delay has not yet started. \\\"started\\\" if the delay is in progress. \\\"completed\\\" if the delay has elapsed and the envelope has been sent to the current workflow step's recipients.
23
23
  attr_accessor :status
24
24
 
25
25
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -170,7 +170,7 @@ module DocuSign_eSign
170
170
  # Metadata that indicates whether the `recipientId` property is editable.
171
171
  attr_accessor :recipient_id_metadata
172
172
 
173
- # Sets the size for the InitialHere tab. It can be value from 0.5 to 1.0, where 1.0 represents full size and 0.5 is 50% size.
173
+ # Sets the size for the InitialHere tab. It can be value from 0.5 to 1.0, where 1.0 represents full size and 0.5 is 50% size.
174
174
  attr_accessor :scale_value
175
175
 
176
176
  # Metadata that indicates whether the `scaleValue` property is editable.
@@ -12,7 +12,7 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git
12
12
  require 'date'
13
13
 
14
14
  module DocuSign_eSign
15
- # Reserved for DocuSign use.
15
+ # DocuSign internal use, but it is needed for swagger tools (go lang, Elixir/OTP) to generate client library.
16
16
  class OfflineAttributes
17
17
  # A GUID identifying the account associated with the consumer disclosure
18
18
  attr_accessor :account_esign_id
@@ -22,7 +22,7 @@ module DocuSign_eSign
22
22
  # A list of envelope delay rules specified by the user indicating how and when the envelope should be scheduled for sending in the future. Currently only 1 rule may be specified.
23
23
  attr_accessor :rules
24
24
 
25
- # Indicates the envelope status. Valid values are: * sent - The envelope is sent to the recipients. * created - The envelope is saved as a draft and can be modified and sent later.
25
+ # \\\"pending\\\" if the envelope has not yet been sent and the scheduled sending delay has not iniaited. \\\"started\\\" if the scheduled sending delay is in progress. \\\"completed\\\" if the scheduled sending delay has elapsed and the envelope has been sent.
26
26
  attr_accessor :status
27
27
 
28
28
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -0,0 +1,274 @@
1
+ =begin
2
+ #DocuSign REST API
3
+
4
+ #The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
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_eSign
15
+ class UserAuthorization
16
+ #
17
+ attr_accessor :agent_user
18
+
19
+ #
20
+ attr_accessor :authorization_id
21
+
22
+ #
23
+ attr_accessor :created
24
+
25
+ #
26
+ attr_accessor :created_by
27
+
28
+ #
29
+ attr_accessor :end_date
30
+
31
+ #
32
+ attr_accessor :modified
33
+
34
+ #
35
+ attr_accessor :modified_by
36
+
37
+ #
38
+ attr_accessor :permission
39
+
40
+ #
41
+ attr_accessor :principal_user
42
+
43
+ #
44
+ attr_accessor :start_date
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'agent_user' => :'agentUser',
50
+ :'authorization_id' => :'authorizationId',
51
+ :'created' => :'created',
52
+ :'created_by' => :'createdBy',
53
+ :'end_date' => :'endDate',
54
+ :'modified' => :'modified',
55
+ :'modified_by' => :'modifiedBy',
56
+ :'permission' => :'permission',
57
+ :'principal_user' => :'principalUser',
58
+ :'start_date' => :'startDate'
59
+ }
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.swagger_types
64
+ {
65
+ :'agent_user' => :'AuthorizationUser',
66
+ :'authorization_id' => :'String',
67
+ :'created' => :'String',
68
+ :'created_by' => :'String',
69
+ :'end_date' => :'String',
70
+ :'modified' => :'String',
71
+ :'modified_by' => :'String',
72
+ :'permission' => :'String',
73
+ :'principal_user' => :'AuthorizationUser',
74
+ :'start_date' => :'String'
75
+ }
76
+ end
77
+
78
+ # Initializes the object
79
+ # @param [Hash] attributes Model attributes in the form of hash
80
+ def initialize(attributes = {})
81
+ return unless attributes.is_a?(Hash)
82
+
83
+ # convert string to symbol for hash key
84
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
85
+
86
+ if attributes.has_key?(:'agentUser')
87
+ self.agent_user = attributes[:'agentUser']
88
+ end
89
+
90
+ if attributes.has_key?(:'authorizationId')
91
+ self.authorization_id = attributes[:'authorizationId']
92
+ end
93
+
94
+ if attributes.has_key?(:'created')
95
+ self.created = attributes[:'created']
96
+ end
97
+
98
+ if attributes.has_key?(:'createdBy')
99
+ self.created_by = attributes[:'createdBy']
100
+ end
101
+
102
+ if attributes.has_key?(:'endDate')
103
+ self.end_date = attributes[:'endDate']
104
+ end
105
+
106
+ if attributes.has_key?(:'modified')
107
+ self.modified = attributes[:'modified']
108
+ end
109
+
110
+ if attributes.has_key?(:'modifiedBy')
111
+ self.modified_by = attributes[:'modifiedBy']
112
+ end
113
+
114
+ if attributes.has_key?(:'permission')
115
+ self.permission = attributes[:'permission']
116
+ end
117
+
118
+ if attributes.has_key?(:'principalUser')
119
+ self.principal_user = attributes[:'principalUser']
120
+ end
121
+
122
+ if attributes.has_key?(:'startDate')
123
+ self.start_date = attributes[:'startDate']
124
+ end
125
+ end
126
+
127
+ # Show invalid properties with the reasons. Usually used together with valid?
128
+ # @return Array for valid properties with the reasons
129
+ def list_invalid_properties
130
+ invalid_properties = Array.new
131
+ invalid_properties
132
+ end
133
+
134
+ # Check to see if the all the properties in the model are valid
135
+ # @return true if the model is valid
136
+ def valid?
137
+ true
138
+ end
139
+
140
+ # Checks equality by comparing each attribute.
141
+ # @param [Object] Object to be compared
142
+ def ==(o)
143
+ return true if self.equal?(o)
144
+ self.class == o.class &&
145
+ agent_user == o.agent_user &&
146
+ authorization_id == o.authorization_id &&
147
+ created == o.created &&
148
+ created_by == o.created_by &&
149
+ end_date == o.end_date &&
150
+ modified == o.modified &&
151
+ modified_by == o.modified_by &&
152
+ permission == o.permission &&
153
+ principal_user == o.principal_user &&
154
+ start_date == o.start_date
155
+ end
156
+
157
+ # @see the `==` method
158
+ # @param [Object] Object to be compared
159
+ def eql?(o)
160
+ self == o
161
+ end
162
+
163
+ # Calculates hash code according to all attributes.
164
+ # @return [Fixnum] Hash code
165
+ def hash
166
+ [agent_user, authorization_id, created, created_by, end_date, modified, modified_by, permission, principal_user, start_date].hash
167
+ end
168
+
169
+ # Builds the object from hash
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ # @return [Object] Returns the model itself
172
+ def build_from_hash(attributes)
173
+ return nil unless attributes.is_a?(Hash)
174
+ self.class.swagger_types.each_pair do |key, type|
175
+ if type =~ /\AArray<(.*)>/i
176
+ # check to ensure the input is an array given that the attribute
177
+ # is documented as an array but the input is not
178
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
179
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
180
+ end
181
+ elsif !attributes[self.class.attribute_map[key]].nil?
182
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
183
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
184
+ end
185
+
186
+ self
187
+ end
188
+
189
+ # Deserializes the data based on type
190
+ # @param string type Data type
191
+ # @param string value Value to be deserialized
192
+ # @return [Object] Deserialized data
193
+ def _deserialize(type, value)
194
+ case type.to_sym
195
+ when :DateTime
196
+ DateTime.parse(value)
197
+ when :Date
198
+ Date.parse(value)
199
+ when :String
200
+ value.to_s
201
+ when :Integer
202
+ value.to_i
203
+ when :Float
204
+ value.to_f
205
+ when :BOOLEAN
206
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
207
+ true
208
+ else
209
+ false
210
+ end
211
+ when :Object
212
+ # generic object (usually a Hash), return directly
213
+ value
214
+ when /\AArray<(?<inner_type>.+)>\z/
215
+ inner_type = Regexp.last_match[:inner_type]
216
+ value.map { |v| _deserialize(inner_type, v) }
217
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
218
+ k_type = Regexp.last_match[:k_type]
219
+ v_type = Regexp.last_match[:v_type]
220
+ {}.tap do |hash|
221
+ value.each do |k, v|
222
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
223
+ end
224
+ end
225
+ else # model
226
+ temp_model = DocuSign_eSign.const_get(type).new
227
+ temp_model.build_from_hash(value)
228
+ end
229
+ end
230
+
231
+ # Returns the string representation of the object
232
+ # @return [String] String presentation of the object
233
+ def to_s
234
+ to_hash.to_s
235
+ end
236
+
237
+ # to_body is an alias to to_hash (backward compatibility)
238
+ # @return [Hash] Returns the object in the form of hash
239
+ def to_body
240
+ to_hash
241
+ end
242
+
243
+ # Returns the object in the form of hash
244
+ # @return [Hash] Returns the object in the form of hash
245
+ def to_hash
246
+ hash = {}
247
+ self.class.attribute_map.each_pair do |attr, param|
248
+ value = self.send(attr)
249
+ next if value.nil?
250
+ hash[param] = _to_hash(value)
251
+ end
252
+ hash
253
+ end
254
+
255
+ # Outputs non-array value in the form of hash
256
+ # For object, use to_hash. Otherwise, just return the value
257
+ # @param [Object] value Any valid value
258
+ # @return [Hash] Returns the value in the form of hash
259
+ def _to_hash(value)
260
+ if value.is_a?(Array)
261
+ value.compact.map { |v| _to_hash(v) }
262
+ elsif value.is_a?(Hash)
263
+ {}.tap do |hash|
264
+ value.each { |k, v| hash[k] = _to_hash(v) }
265
+ end
266
+ elsif value.respond_to? :to_hash
267
+ value.to_hash
268
+ else
269
+ value
270
+ end
271
+ end
272
+
273
+ end
274
+ end