signrequest_client 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +26 -7
  3. data/Rakefile +0 -1
  4. data/docs/ApiTokensApi.md +0 -164
  5. data/docs/Document.md +6 -0
  6. data/docs/DocumentAttachment.md +1 -1
  7. data/docs/DocumentAttachmentsApi.md +4 -4
  8. data/docs/DocumentSearch.md +5 -5
  9. data/docs/DocumentSigningLog.md +9 -0
  10. data/docs/DocumentSignrequest.md +28 -0
  11. data/docs/DocumentTeam.md +10 -0
  12. data/docs/DocumentsApi.md +11 -11
  13. data/docs/DocumentsSearchApi.md +8 -8
  14. data/docs/Event.md +1 -0
  15. data/docs/EventsApi.md +13 -13
  16. data/docs/FileFromSf.md +1 -0
  17. data/docs/InlineResponse201.md +1 -1
  18. data/docs/InlineSignRequest.md +3 -0
  19. data/docs/SignRequest.md +4 -1
  20. data/docs/SignRequestQuickCreate.md +5 -1
  21. data/docs/Signer.md +3 -0
  22. data/docs/SignrequestsApi.md +5 -5
  23. data/docs/Team.md +2 -0
  24. data/docs/TeamMember.md +1 -0
  25. data/docs/TeamMembersApi.md +7 -7
  26. data/docs/TeamsApi.md +57 -3
  27. data/docs/Template.md +1 -0
  28. data/docs/TemplatesApi.md +1 -1
  29. data/docs/WebhookSubscription.md +1 -0
  30. data/docs/WebhooksApi.md +4 -4
  31. data/lib/signrequest_client.rb +4 -1
  32. data/lib/signrequest_client/api/api_tokens_api.rb +5 -170
  33. data/lib/signrequest_client/api/document_attachments_api.rb +11 -14
  34. data/lib/signrequest_client/api/documents_api.rb +14 -18
  35. data/lib/signrequest_client/api/documents_search_api.rb +5 -6
  36. data/lib/signrequest_client/api/events_api.rb +8 -10
  37. data/lib/signrequest_client/api/signrequest_quick_create_api.rb +5 -6
  38. data/lib/signrequest_client/api/signrequests_api.rb +17 -22
  39. data/lib/signrequest_client/api/team_members_api.rb +8 -10
  40. data/lib/signrequest_client/api/teams_api.rb +69 -21
  41. data/lib/signrequest_client/api/templates_api.rb +8 -10
  42. data/lib/signrequest_client/api/webhooks_api.rb +20 -26
  43. data/lib/signrequest_client/api_client.rb +9 -9
  44. data/lib/signrequest_client/api_error.rb +1 -1
  45. data/lib/signrequest_client/configuration.rb +2 -2
  46. data/lib/signrequest_client/models/auth_token.rb +16 -23
  47. data/lib/signrequest_client/models/document.rb +113 -45
  48. data/lib/signrequest_client/models/document_attachment.rb +17 -25
  49. data/lib/signrequest_client/models/document_search.rb +111 -122
  50. data/lib/signrequest_client/models/document_signer_template_conf.rb +14 -21
  51. data/lib/signrequest_client/models/document_signing_log.rb +209 -0
  52. data/lib/signrequest_client/models/document_signrequest.rb +538 -0
  53. data/lib/signrequest_client/models/document_team.rb +240 -0
  54. data/lib/signrequest_client/models/event.rb +24 -20
  55. data/lib/signrequest_client/models/file_from_sf.rb +40 -21
  56. data/lib/signrequest_client/models/inline_document_signer_integration_data.rb +9 -13
  57. data/lib/signrequest_client/models/inline_integration_data.rb +9 -13
  58. data/lib/signrequest_client/models/inline_prefill_tags.rb +8 -13
  59. data/lib/signrequest_client/models/inline_response_200.rb +8 -13
  60. data/lib/signrequest_client/models/inline_response_200_1.rb +8 -13
  61. data/lib/signrequest_client/models/inline_response_200_2.rb +8 -13
  62. data/lib/signrequest_client/models/inline_response_200_3.rb +8 -13
  63. data/lib/signrequest_client/models/inline_response_200_4.rb +8 -13
  64. data/lib/signrequest_client/models/inline_response_200_5.rb +8 -13
  65. data/lib/signrequest_client/models/inline_response_200_6.rb +8 -13
  66. data/lib/signrequest_client/models/inline_response_200_7.rb +8 -13
  67. data/lib/signrequest_client/models/inline_response_200_8.rb +8 -13
  68. data/lib/signrequest_client/models/inline_response_200_9.rb +8 -13
  69. data/lib/signrequest_client/models/inline_response_201.rb +27 -31
  70. data/lib/signrequest_client/models/inline_response_201_1.rb +11 -15
  71. data/lib/signrequest_client/models/inline_sign_request.rb +69 -35
  72. data/lib/signrequest_client/models/inline_team.rb +12 -19
  73. data/lib/signrequest_client/models/inline_team_member.rb +8 -14
  74. data/lib/signrequest_client/models/invite_member.rb +10 -15
  75. data/lib/signrequest_client/models/placeholder.rb +15 -21
  76. data/lib/signrequest_client/models/required_attachment.rb +14 -20
  77. data/lib/signrequest_client/models/sign_request.rb +75 -40
  78. data/lib/signrequest_client/models/sign_request_quick_create.rb +124 -61
  79. data/lib/signrequest_client/models/signer.rb +103 -60
  80. data/lib/signrequest_client/models/signer_attachment.rb +10 -17
  81. data/lib/signrequest_client/models/signer_inputs.rb +14 -20
  82. data/lib/signrequest_client/models/signing_log.rb +8 -14
  83. data/lib/signrequest_client/models/team.rb +55 -34
  84. data/lib/signrequest_client/models/team_member.rb +18 -15
  85. data/lib/signrequest_client/models/template.rb +23 -20
  86. data/lib/signrequest_client/models/user.rb +18 -26
  87. data/lib/signrequest_client/models/webhook_subscription.rb +33 -30
  88. data/lib/signrequest_client/version.rb +2 -2
  89. data/signrequest_client-1.0.0.gem +0 -0
  90. data/signrequest_client.gemspec +4 -4
  91. data/spec/models/document_signing_log_spec.rb +47 -0
  92. data/spec/models/document_signrequest_spec.rb +165 -0
  93. data/spec/models/document_team_spec.rb +53 -0
  94. metadata +28 -42
@@ -6,14 +6,13 @@
6
6
  OpenAPI spec version: v1
7
7
  Contact: tech-support@signrequest.com
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.8
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
14
 
15
15
  module SignRequestClient
16
-
17
16
  class DocumentSignerTemplateConf
18
17
  attr_accessor :signer_index
19
18
 
@@ -29,7 +28,6 @@ module SignRequestClient
29
28
 
30
29
  attr_accessor :placeholders
31
30
 
32
-
33
31
  # Attribute mapping from ruby-style variable name to JSON key.
34
32
  def self.attribute_map
35
33
  {
@@ -62,7 +60,7 @@ module SignRequestClient
62
60
  return unless attributes.is_a?(Hash)
63
61
 
64
62
  # convert string to symbol for hash key
65
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
63
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
66
64
 
67
65
  if attributes.has_key?(:'signer_index')
68
66
  self.signer_index = attributes[:'signer_index']
@@ -93,7 +91,6 @@ module SignRequestClient
93
91
  self.placeholders = value
94
92
  end
95
93
  end
96
-
97
94
  end
98
95
 
99
96
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -101,22 +98,22 @@ module SignRequestClient
101
98
  def list_invalid_properties
102
99
  invalid_properties = Array.new
103
100
  if !@signer_index.nil? && @signer_index > 2147483647
104
- invalid_properties.push("invalid value for 'signer_index', must be smaller than or equal to 2147483647.")
101
+ invalid_properties.push('invalid value for "signer_index", must be smaller than or equal to 2147483647.')
105
102
  end
106
103
 
107
104
  if !@signer_index.nil? && @signer_index < -2147483648
108
- invalid_properties.push("invalid value for 'signer_index', must be greater than or equal to -2147483648.")
105
+ invalid_properties.push('invalid value for "signer_index", must be greater than or equal to -2147483648.')
109
106
  end
110
107
 
111
108
  if !@order.nil? && @order > 2147483647
112
- invalid_properties.push("invalid value for 'order', must be smaller than or equal to 2147483647.")
109
+ invalid_properties.push('invalid value for "order", must be smaller than or equal to 2147483647.')
113
110
  end
114
111
 
115
112
  if !@order.nil? && @order < 0
116
- invalid_properties.push("invalid value for 'order', must be greater than or equal to 0.")
113
+ invalid_properties.push('invalid value for "order", must be greater than or equal to 0.')
117
114
  end
118
115
 
119
- return invalid_properties
116
+ invalid_properties
120
117
  end
121
118
 
122
119
  # Check to see if the all the properties in the model are valid
@@ -126,19 +123,18 @@ module SignRequestClient
126
123
  return false if !@signer_index.nil? && @signer_index < -2147483648
127
124
  return false if !@order.nil? && @order > 2147483647
128
125
  return false if !@order.nil? && @order < 0
129
- return true
126
+ true
130
127
  end
131
128
 
132
129
  # Custom attribute writer method with validation
133
130
  # @param [Object] signer_index Value to be assigned
134
131
  def signer_index=(signer_index)
135
-
136
132
  if !signer_index.nil? && signer_index > 2147483647
137
- fail ArgumentError, "invalid value for 'signer_index', must be smaller than or equal to 2147483647."
133
+ fail ArgumentError, 'invalid value for "signer_index", must be smaller than or equal to 2147483647.'
138
134
  end
139
135
 
140
136
  if !signer_index.nil? && signer_index < -2147483648
141
- fail ArgumentError, "invalid value for 'signer_index', must be greater than or equal to -2147483648."
137
+ fail ArgumentError, 'invalid value for "signer_index", must be greater than or equal to -2147483648.'
142
138
  end
143
139
 
144
140
  @signer_index = signer_index
@@ -147,13 +143,12 @@ module SignRequestClient
147
143
  # Custom attribute writer method with validation
148
144
  # @param [Object] order Value to be assigned
149
145
  def order=(order)
150
-
151
146
  if !order.nil? && order > 2147483647
152
- fail ArgumentError, "invalid value for 'order', must be smaller than or equal to 2147483647."
147
+ fail ArgumentError, 'invalid value for "order", must be smaller than or equal to 2147483647.'
153
148
  end
154
149
 
155
150
  if !order.nil? && order < 0
156
- fail ArgumentError, "invalid value for 'order', must be greater than or equal to 0."
151
+ fail ArgumentError, 'invalid value for "order", must be greater than or equal to 0.'
157
152
  end
158
153
 
159
154
  @order = order
@@ -195,7 +190,7 @@ module SignRequestClient
195
190
  # check to ensure the input is an array given that the the attribute
196
191
  # is documented as an array but the input is not
197
192
  if attributes[self.class.attribute_map[key]].is_a?(Array)
198
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
193
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
199
194
  end
200
195
  elsif !attributes[self.class.attribute_map[key]].nil?
201
196
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
@@ -277,7 +272,7 @@ module SignRequestClient
277
272
  # @return [Hash] Returns the value in the form of hash
278
273
  def _to_hash(value)
279
274
  if value.is_a?(Array)
280
- value.compact.map{ |v| _to_hash(v) }
275
+ value.compact.map { |v| _to_hash(v) }
281
276
  elsif value.is_a?(Hash)
282
277
  {}.tap do |hash|
283
278
  value.each { |k, v| hash[k] = _to_hash(v) }
@@ -288,7 +283,5 @@ module SignRequestClient
288
283
  value
289
284
  end
290
285
  end
291
-
292
286
  end
293
-
294
287
  end
@@ -0,0 +1,209 @@
1
+ =begin
2
+ #SignRequest API
3
+
4
+ #API for SignRequest.com
5
+
6
+ OpenAPI spec version: v1
7
+ Contact: tech-support@signrequest.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.8
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module SignRequestClient
16
+ class DocumentSigningLog
17
+ # Temporary URL to signing log, expires in five minutes
18
+ attr_accessor :pdf
19
+
20
+ # SHA256 hash of PDF contents
21
+ attr_accessor :security_hash
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'pdf' => :'pdf',
27
+ :'security_hash' => :'security_hash'
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.swagger_types
33
+ {
34
+ :'pdf' => :'String',
35
+ :'security_hash' => :'String'
36
+ }
37
+ end
38
+
39
+ # Initializes the object
40
+ # @param [Hash] attributes Model attributes in the form of hash
41
+ def initialize(attributes = {})
42
+ return unless attributes.is_a?(Hash)
43
+
44
+ # convert string to symbol for hash key
45
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
46
+
47
+ if attributes.has_key?(:'pdf')
48
+ self.pdf = attributes[:'pdf']
49
+ end
50
+
51
+ if attributes.has_key?(:'security_hash')
52
+ self.security_hash = attributes[:'security_hash']
53
+ end
54
+ end
55
+
56
+ # Show invalid properties with the reasons. Usually used together with valid?
57
+ # @return Array for valid properties with the reasons
58
+ def list_invalid_properties
59
+ invalid_properties = Array.new
60
+ if !@security_hash.nil? && @security_hash.to_s.length < 1
61
+ invalid_properties.push('invalid value for "security_hash", the character length must be great than or equal to 1.')
62
+ end
63
+
64
+ invalid_properties
65
+ end
66
+
67
+ # Check to see if the all the properties in the model are valid
68
+ # @return true if the model is valid
69
+ def valid?
70
+ return false if !@security_hash.nil? && @security_hash.to_s.length < 1
71
+ true
72
+ end
73
+
74
+ # Custom attribute writer method with validation
75
+ # @param [Object] security_hash Value to be assigned
76
+ def security_hash=(security_hash)
77
+ if !security_hash.nil? && security_hash.to_s.length < 1
78
+ fail ArgumentError, 'invalid value for "security_hash", the character length must be great than or equal to 1.'
79
+ end
80
+
81
+ @security_hash = security_hash
82
+ end
83
+
84
+ # Checks equality by comparing each attribute.
85
+ # @param [Object] Object to be compared
86
+ def ==(o)
87
+ return true if self.equal?(o)
88
+ self.class == o.class &&
89
+ pdf == o.pdf &&
90
+ security_hash == o.security_hash
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
+ [pdf, security_hash].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 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 = SignRequestClient.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
+ end
209
+ end
@@ -0,0 +1,538 @@
1
+ =begin
2
+ #SignRequest API
3
+
4
+ #API for SignRequest.com
5
+
6
+ OpenAPI spec version: v1
7
+ Contact: tech-support@signrequest.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.8
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module SignRequestClient
16
+ class DocumentSignrequest
17
+ # Email of user sending the SignRequest (must be a validated email)
18
+ attr_accessor :from_email
19
+
20
+ # Name to be used in the `From` email header, e.g. `{from_email_name} <no-reply@signrequest.com>`
21
+ attr_accessor :from_email_name
22
+
23
+ # Have the sender of a SignRequest prepare the document before sending the request out, see: [prepare using the web interface](#section/Preparing-a-document/Prepare-using-the-web-interface)
24
+ attr_accessor :is_being_prepared
25
+
26
+ attr_accessor :prepare_url
27
+
28
+ # URL at which SignRequest will redirect to when a document is signed
29
+ attr_accessor :redirect_url
30
+
31
+ # URL at which SignRequest will redirect to when a document is declined
32
+ attr_accessor :redirect_url_declined
33
+
34
+ attr_accessor :required_attachments
35
+
36
+ # Disable uploading/adding of attachments
37
+ attr_accessor :disable_attachments
38
+
39
+ # Disable usage of signatures generated by typing (text)
40
+ attr_accessor :disable_text_signatures
41
+
42
+ # Disable adding of text
43
+ attr_accessor :disable_text
44
+
45
+ # Disable adding of dates
46
+ attr_accessor :disable_date
47
+
48
+ # Disable all SignRequest status emails as well as the email that contains the signed documents
49
+ attr_accessor :disable_emails
50
+
51
+ # Disable usage of uploaded signatures (images)
52
+ attr_accessor :disable_upload_signatures
53
+
54
+ # Disables storing timestamp proof hashes in blockchain integrations.
55
+ attr_accessor :disable_blockchain_proof
56
+
57
+ # When true a text message verification is needed before the signer can see the document
58
+ attr_accessor :text_message_verification_locked
59
+
60
+ # Subject of SignRequest email
61
+ attr_accessor :subject
62
+
63
+ # Message to include in SignRequest email, may contain the following html tags: `a`, `abbr`, `acronym`, `b`, `blockquote`, `code`, `em`, `i`, `ul`, `li`, `ol`, and `strong`
64
+ attr_accessor :message
65
+
66
+ # `m`: only me, `mo`: me and others, `o`: only others
67
+ attr_accessor :who
68
+
69
+ # Automatically remind signers to sign a document
70
+ attr_accessor :send_reminders
71
+
72
+ attr_accessor :signers
73
+
74
+ attr_accessor :uuid
75
+
76
+ class EnumAttributeValidator
77
+ attr_reader :datatype
78
+ attr_reader :allowable_values
79
+
80
+ def initialize(datatype, allowable_values)
81
+ @allowable_values = allowable_values.map do |value|
82
+ case datatype.to_s
83
+ when /Integer/i
84
+ value.to_i
85
+ when /Float/i
86
+ value.to_f
87
+ else
88
+ value
89
+ end
90
+ end
91
+ end
92
+
93
+ def valid?(value)
94
+ !value || allowable_values.include?(value)
95
+ end
96
+ end
97
+
98
+ # Attribute mapping from ruby-style variable name to JSON key.
99
+ def self.attribute_map
100
+ {
101
+ :'from_email' => :'from_email',
102
+ :'from_email_name' => :'from_email_name',
103
+ :'is_being_prepared' => :'is_being_prepared',
104
+ :'prepare_url' => :'prepare_url',
105
+ :'redirect_url' => :'redirect_url',
106
+ :'redirect_url_declined' => :'redirect_url_declined',
107
+ :'required_attachments' => :'required_attachments',
108
+ :'disable_attachments' => :'disable_attachments',
109
+ :'disable_text_signatures' => :'disable_text_signatures',
110
+ :'disable_text' => :'disable_text',
111
+ :'disable_date' => :'disable_date',
112
+ :'disable_emails' => :'disable_emails',
113
+ :'disable_upload_signatures' => :'disable_upload_signatures',
114
+ :'disable_blockchain_proof' => :'disable_blockchain_proof',
115
+ :'text_message_verification_locked' => :'text_message_verification_locked',
116
+ :'subject' => :'subject',
117
+ :'message' => :'message',
118
+ :'who' => :'who',
119
+ :'send_reminders' => :'send_reminders',
120
+ :'signers' => :'signers',
121
+ :'uuid' => :'uuid'
122
+ }
123
+ end
124
+
125
+ # Attribute type mapping.
126
+ def self.swagger_types
127
+ {
128
+ :'from_email' => :'String',
129
+ :'from_email_name' => :'String',
130
+ :'is_being_prepared' => :'BOOLEAN',
131
+ :'prepare_url' => :'String',
132
+ :'redirect_url' => :'String',
133
+ :'redirect_url_declined' => :'String',
134
+ :'required_attachments' => :'Array<RequiredAttachment>',
135
+ :'disable_attachments' => :'BOOLEAN',
136
+ :'disable_text_signatures' => :'BOOLEAN',
137
+ :'disable_text' => :'BOOLEAN',
138
+ :'disable_date' => :'BOOLEAN',
139
+ :'disable_emails' => :'BOOLEAN',
140
+ :'disable_upload_signatures' => :'BOOLEAN',
141
+ :'disable_blockchain_proof' => :'BOOLEAN',
142
+ :'text_message_verification_locked' => :'BOOLEAN',
143
+ :'subject' => :'String',
144
+ :'message' => :'String',
145
+ :'who' => :'String',
146
+ :'send_reminders' => :'BOOLEAN',
147
+ :'signers' => :'Array<Signer>',
148
+ :'uuid' => :'String'
149
+ }
150
+ end
151
+
152
+ # Initializes the object
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ def initialize(attributes = {})
155
+ return unless attributes.is_a?(Hash)
156
+
157
+ # convert string to symbol for hash key
158
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
159
+
160
+ if attributes.has_key?(:'from_email')
161
+ self.from_email = attributes[:'from_email']
162
+ end
163
+
164
+ if attributes.has_key?(:'from_email_name')
165
+ self.from_email_name = attributes[:'from_email_name']
166
+ end
167
+
168
+ if attributes.has_key?(:'is_being_prepared')
169
+ self.is_being_prepared = attributes[:'is_being_prepared']
170
+ end
171
+
172
+ if attributes.has_key?(:'prepare_url')
173
+ self.prepare_url = attributes[:'prepare_url']
174
+ end
175
+
176
+ if attributes.has_key?(:'redirect_url')
177
+ self.redirect_url = attributes[:'redirect_url']
178
+ end
179
+
180
+ if attributes.has_key?(:'redirect_url_declined')
181
+ self.redirect_url_declined = attributes[:'redirect_url_declined']
182
+ end
183
+
184
+ if attributes.has_key?(:'required_attachments')
185
+ if (value = attributes[:'required_attachments']).is_a?(Array)
186
+ self.required_attachments = value
187
+ end
188
+ end
189
+
190
+ if attributes.has_key?(:'disable_attachments')
191
+ self.disable_attachments = attributes[:'disable_attachments']
192
+ end
193
+
194
+ if attributes.has_key?(:'disable_text_signatures')
195
+ self.disable_text_signatures = attributes[:'disable_text_signatures']
196
+ end
197
+
198
+ if attributes.has_key?(:'disable_text')
199
+ self.disable_text = attributes[:'disable_text']
200
+ end
201
+
202
+ if attributes.has_key?(:'disable_date')
203
+ self.disable_date = attributes[:'disable_date']
204
+ end
205
+
206
+ if attributes.has_key?(:'disable_emails')
207
+ self.disable_emails = attributes[:'disable_emails']
208
+ end
209
+
210
+ if attributes.has_key?(:'disable_upload_signatures')
211
+ self.disable_upload_signatures = attributes[:'disable_upload_signatures']
212
+ end
213
+
214
+ if attributes.has_key?(:'disable_blockchain_proof')
215
+ self.disable_blockchain_proof = attributes[:'disable_blockchain_proof']
216
+ end
217
+
218
+ if attributes.has_key?(:'text_message_verification_locked')
219
+ self.text_message_verification_locked = attributes[:'text_message_verification_locked']
220
+ end
221
+
222
+ if attributes.has_key?(:'subject')
223
+ self.subject = attributes[:'subject']
224
+ end
225
+
226
+ if attributes.has_key?(:'message')
227
+ self.message = attributes[:'message']
228
+ end
229
+
230
+ if attributes.has_key?(:'who')
231
+ self.who = attributes[:'who']
232
+ end
233
+
234
+ if attributes.has_key?(:'send_reminders')
235
+ self.send_reminders = attributes[:'send_reminders']
236
+ end
237
+
238
+ if attributes.has_key?(:'signers')
239
+ if (value = attributes[:'signers']).is_a?(Array)
240
+ self.signers = value
241
+ end
242
+ end
243
+
244
+ if attributes.has_key?(:'uuid')
245
+ self.uuid = attributes[:'uuid']
246
+ end
247
+ end
248
+
249
+ # Show invalid properties with the reasons. Usually used together with valid?
250
+ # @return Array for valid properties with the reasons
251
+ def list_invalid_properties
252
+ invalid_properties = Array.new
253
+ if !@from_email.nil? && @from_email.to_s.length < 1
254
+ invalid_properties.push('invalid value for "from_email", the character length must be great than or equal to 1.')
255
+ end
256
+
257
+ if !@from_email_name.nil? && @from_email_name.to_s.length < 1
258
+ invalid_properties.push('invalid value for "from_email_name", the character length must be great than or equal to 1.')
259
+ end
260
+
261
+ if !@prepare_url.nil? && @prepare_url.to_s.length < 1
262
+ invalid_properties.push('invalid value for "prepare_url", the character length must be great than or equal to 1.')
263
+ end
264
+
265
+ if !@redirect_url.nil? && @redirect_url.to_s.length < 1
266
+ invalid_properties.push('invalid value for "redirect_url", the character length must be great than or equal to 1.')
267
+ end
268
+
269
+ if !@redirect_url_declined.nil? && @redirect_url_declined.to_s.length < 1
270
+ invalid_properties.push('invalid value for "redirect_url_declined", the character length must be great than or equal to 1.')
271
+ end
272
+
273
+ if !@subject.nil? && @subject.to_s.length < 1
274
+ invalid_properties.push('invalid value for "subject", the character length must be great than or equal to 1.')
275
+ end
276
+
277
+ if !@message.nil? && @message.to_s.length < 1
278
+ invalid_properties.push('invalid value for "message", the character length must be great than or equal to 1.')
279
+ end
280
+
281
+ if !@uuid.nil? && @uuid.to_s.length < 1
282
+ invalid_properties.push('invalid value for "uuid", the character length must be great than or equal to 1.')
283
+ end
284
+
285
+ invalid_properties
286
+ end
287
+
288
+ # Check to see if the all the properties in the model are valid
289
+ # @return true if the model is valid
290
+ def valid?
291
+ return false if !@from_email.nil? && @from_email.to_s.length < 1
292
+ return false if !@from_email_name.nil? && @from_email_name.to_s.length < 1
293
+ return false if !@prepare_url.nil? && @prepare_url.to_s.length < 1
294
+ return false if !@redirect_url.nil? && @redirect_url.to_s.length < 1
295
+ return false if !@redirect_url_declined.nil? && @redirect_url_declined.to_s.length < 1
296
+ return false if !@subject.nil? && @subject.to_s.length < 1
297
+ return false if !@message.nil? && @message.to_s.length < 1
298
+ who_validator = EnumAttributeValidator.new('String', ['m', 'mo', 'o'])
299
+ return false unless who_validator.valid?(@who)
300
+ return false if !@uuid.nil? && @uuid.to_s.length < 1
301
+ true
302
+ end
303
+
304
+ # Custom attribute writer method with validation
305
+ # @param [Object] from_email Value to be assigned
306
+ def from_email=(from_email)
307
+ if !from_email.nil? && from_email.to_s.length < 1
308
+ fail ArgumentError, 'invalid value for "from_email", the character length must be great than or equal to 1.'
309
+ end
310
+
311
+ @from_email = from_email
312
+ end
313
+
314
+ # Custom attribute writer method with validation
315
+ # @param [Object] from_email_name Value to be assigned
316
+ def from_email_name=(from_email_name)
317
+ if !from_email_name.nil? && from_email_name.to_s.length < 1
318
+ fail ArgumentError, 'invalid value for "from_email_name", the character length must be great than or equal to 1.'
319
+ end
320
+
321
+ @from_email_name = from_email_name
322
+ end
323
+
324
+ # Custom attribute writer method with validation
325
+ # @param [Object] prepare_url Value to be assigned
326
+ def prepare_url=(prepare_url)
327
+ if !prepare_url.nil? && prepare_url.to_s.length < 1
328
+ fail ArgumentError, 'invalid value for "prepare_url", the character length must be great than or equal to 1.'
329
+ end
330
+
331
+ @prepare_url = prepare_url
332
+ end
333
+
334
+ # Custom attribute writer method with validation
335
+ # @param [Object] redirect_url Value to be assigned
336
+ def redirect_url=(redirect_url)
337
+ if !redirect_url.nil? && redirect_url.to_s.length < 1
338
+ fail ArgumentError, 'invalid value for "redirect_url", the character length must be great than or equal to 1.'
339
+ end
340
+
341
+ @redirect_url = redirect_url
342
+ end
343
+
344
+ # Custom attribute writer method with validation
345
+ # @param [Object] redirect_url_declined Value to be assigned
346
+ def redirect_url_declined=(redirect_url_declined)
347
+ if !redirect_url_declined.nil? && redirect_url_declined.to_s.length < 1
348
+ fail ArgumentError, 'invalid value for "redirect_url_declined", the character length must be great than or equal to 1.'
349
+ end
350
+
351
+ @redirect_url_declined = redirect_url_declined
352
+ end
353
+
354
+ # Custom attribute writer method with validation
355
+ # @param [Object] subject Value to be assigned
356
+ def subject=(subject)
357
+ if !subject.nil? && subject.to_s.length < 1
358
+ fail ArgumentError, 'invalid value for "subject", the character length must be great than or equal to 1.'
359
+ end
360
+
361
+ @subject = subject
362
+ end
363
+
364
+ # Custom attribute writer method with validation
365
+ # @param [Object] message Value to be assigned
366
+ def message=(message)
367
+ if !message.nil? && message.to_s.length < 1
368
+ fail ArgumentError, 'invalid value for "message", the character length must be great than or equal to 1.'
369
+ end
370
+
371
+ @message = message
372
+ end
373
+
374
+ # Custom attribute writer method checking allowed values (enum).
375
+ # @param [Object] who Object to be assigned
376
+ def who=(who)
377
+ validator = EnumAttributeValidator.new('String', ['m', 'mo', 'o'])
378
+ unless validator.valid?(who)
379
+ fail ArgumentError, 'invalid value for "who", must be one of #{validator.allowable_values}.'
380
+ end
381
+ @who = who
382
+ end
383
+
384
+ # Custom attribute writer method with validation
385
+ # @param [Object] uuid Value to be assigned
386
+ def uuid=(uuid)
387
+ if !uuid.nil? && uuid.to_s.length < 1
388
+ fail ArgumentError, 'invalid value for "uuid", the character length must be great than or equal to 1.'
389
+ end
390
+
391
+ @uuid = uuid
392
+ end
393
+
394
+ # Checks equality by comparing each attribute.
395
+ # @param [Object] Object to be compared
396
+ def ==(o)
397
+ return true if self.equal?(o)
398
+ self.class == o.class &&
399
+ from_email == o.from_email &&
400
+ from_email_name == o.from_email_name &&
401
+ is_being_prepared == o.is_being_prepared &&
402
+ prepare_url == o.prepare_url &&
403
+ redirect_url == o.redirect_url &&
404
+ redirect_url_declined == o.redirect_url_declined &&
405
+ required_attachments == o.required_attachments &&
406
+ disable_attachments == o.disable_attachments &&
407
+ disable_text_signatures == o.disable_text_signatures &&
408
+ disable_text == o.disable_text &&
409
+ disable_date == o.disable_date &&
410
+ disable_emails == o.disable_emails &&
411
+ disable_upload_signatures == o.disable_upload_signatures &&
412
+ disable_blockchain_proof == o.disable_blockchain_proof &&
413
+ text_message_verification_locked == o.text_message_verification_locked &&
414
+ subject == o.subject &&
415
+ message == o.message &&
416
+ who == o.who &&
417
+ send_reminders == o.send_reminders &&
418
+ signers == o.signers &&
419
+ uuid == o.uuid
420
+ end
421
+
422
+ # @see the `==` method
423
+ # @param [Object] Object to be compared
424
+ def eql?(o)
425
+ self == o
426
+ end
427
+
428
+ # Calculates hash code according to all attributes.
429
+ # @return [Fixnum] Hash code
430
+ def hash
431
+ [from_email, from_email_name, is_being_prepared, prepare_url, redirect_url, redirect_url_declined, required_attachments, disable_attachments, disable_text_signatures, disable_text, disable_date, disable_emails, disable_upload_signatures, disable_blockchain_proof, text_message_verification_locked, subject, message, who, send_reminders, signers, uuid].hash
432
+ end
433
+
434
+ # Builds the object from hash
435
+ # @param [Hash] attributes Model attributes in the form of hash
436
+ # @return [Object] Returns the model itself
437
+ def build_from_hash(attributes)
438
+ return nil unless attributes.is_a?(Hash)
439
+ self.class.swagger_types.each_pair do |key, type|
440
+ if type =~ /\AArray<(.*)>/i
441
+ # check to ensure the input is an array given that the the attribute
442
+ # is documented as an array but the input is not
443
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
444
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
445
+ end
446
+ elsif !attributes[self.class.attribute_map[key]].nil?
447
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
448
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
449
+ end
450
+
451
+ self
452
+ end
453
+
454
+ # Deserializes the data based on type
455
+ # @param string type Data type
456
+ # @param string value Value to be deserialized
457
+ # @return [Object] Deserialized data
458
+ def _deserialize(type, value)
459
+ case type.to_sym
460
+ when :DateTime
461
+ DateTime.parse(value)
462
+ when :Date
463
+ Date.parse(value)
464
+ when :String
465
+ value.to_s
466
+ when :Integer
467
+ value.to_i
468
+ when :Float
469
+ value.to_f
470
+ when :BOOLEAN
471
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
472
+ true
473
+ else
474
+ false
475
+ end
476
+ when :Object
477
+ # generic object (usually a Hash), return directly
478
+ value
479
+ when /\AArray<(?<inner_type>.+)>\z/
480
+ inner_type = Regexp.last_match[:inner_type]
481
+ value.map { |v| _deserialize(inner_type, v) }
482
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
483
+ k_type = Regexp.last_match[:k_type]
484
+ v_type = Regexp.last_match[:v_type]
485
+ {}.tap do |hash|
486
+ value.each do |k, v|
487
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
488
+ end
489
+ end
490
+ else # model
491
+ temp_model = SignRequestClient.const_get(type).new
492
+ temp_model.build_from_hash(value)
493
+ end
494
+ end
495
+
496
+ # Returns the string representation of the object
497
+ # @return [String] String presentation of the object
498
+ def to_s
499
+ to_hash.to_s
500
+ end
501
+
502
+ # to_body is an alias to to_hash (backward compatibility)
503
+ # @return [Hash] Returns the object in the form of hash
504
+ def to_body
505
+ to_hash
506
+ end
507
+
508
+ # Returns the object in the form of hash
509
+ # @return [Hash] Returns the object in the form of hash
510
+ def to_hash
511
+ hash = {}
512
+ self.class.attribute_map.each_pair do |attr, param|
513
+ value = self.send(attr)
514
+ next if value.nil?
515
+ hash[param] = _to_hash(value)
516
+ end
517
+ hash
518
+ end
519
+
520
+ # Outputs non-array value in the form of hash
521
+ # For object, use to_hash. Otherwise, just return the value
522
+ # @param [Object] value Any valid value
523
+ # @return [Hash] Returns the value in the form of hash
524
+ def _to_hash(value)
525
+ if value.is_a?(Array)
526
+ value.compact.map { |v| _to_hash(v) }
527
+ elsif value.is_a?(Hash)
528
+ {}.tap do |hash|
529
+ value.each { |k, v| hash[k] = _to_hash(v) }
530
+ end
531
+ elsif value.respond_to? :to_hash
532
+ value.to_hash
533
+ else
534
+ value
535
+ end
536
+ end
537
+ end
538
+ end