signrequest_client 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/Gemfile.lock +69 -0
  4. data/LICENSE +21 -0
  5. data/README.md +122 -0
  6. data/Rakefile +9 -0
  7. data/docs/ApiTokensApi.md +226 -0
  8. data/docs/AuthToken.md +13 -0
  9. data/docs/Document.md +33 -0
  10. data/docs/DocumentAttachment.md +15 -0
  11. data/docs/DocumentAttachmentsApi.md +179 -0
  12. data/docs/DocumentSearch.md +22 -0
  13. data/docs/DocumentSignerTemplateConf.md +14 -0
  14. data/docs/DocumentsApi.md +301 -0
  15. data/docs/DocumentsSearchApi.md +119 -0
  16. data/docs/Event.md +17 -0
  17. data/docs/EventsApi.md +145 -0
  18. data/docs/FileFromSf.md +9 -0
  19. data/docs/InlineDocumentSignerIntegrationData.md +9 -0
  20. data/docs/InlineIntegrationData.md +9 -0
  21. data/docs/InlinePrefillTags.md +11 -0
  22. data/docs/InlineResponse200.md +11 -0
  23. data/docs/InlineResponse2001.md +11 -0
  24. data/docs/InlineResponse2002.md +11 -0
  25. data/docs/InlineResponse2003.md +11 -0
  26. data/docs/InlineResponse2004.md +11 -0
  27. data/docs/InlineResponse2005.md +11 -0
  28. data/docs/InlineResponse2006.md +11 -0
  29. data/docs/InlineResponse2007.md +11 -0
  30. data/docs/InlineResponse2008.md +11 -0
  31. data/docs/InlineResponse2009.md +11 -0
  32. data/docs/InlineSignRequest.md +25 -0
  33. data/docs/InlineTeam.md +10 -0
  34. data/docs/InlineTeamMember.md +13 -0
  35. data/docs/InviteMember.md +10 -0
  36. data/docs/Placeholder.md +15 -0
  37. data/docs/RequiredAttachment.md +9 -0
  38. data/docs/SignRequest.md +29 -0
  39. data/docs/SignRequestQuickCreate.md +42 -0
  40. data/docs/Signer.md +40 -0
  41. data/docs/SignerAttachment.md +11 -0
  42. data/docs/SignerInputs.md +14 -0
  43. data/docs/SigningLog.md +9 -0
  44. data/docs/SignrequestQuickCreateApi.md +62 -0
  45. data/docs/SignrequestsApi.md +291 -0
  46. data/docs/Team.md +15 -0
  47. data/docs/TeamMember.md +14 -0
  48. data/docs/TeamMembersApi.md +131 -0
  49. data/docs/TeamsApi.md +344 -0
  50. data/docs/Template.md +14 -0
  51. data/docs/TemplatesApi.md +119 -0
  52. data/docs/User.md +11 -0
  53. data/docs/WebhookSubscription.md +15 -0
  54. data/docs/WebhooksApi.md +340 -0
  55. data/git_push.sh +55 -0
  56. data/lib/signrequest_client/api/api_tokens_api.rb +242 -0
  57. data/lib/signrequest_client/api/document_attachments_api.rb +197 -0
  58. data/lib/signrequest_client/api/documents_api.rb +330 -0
  59. data/lib/signrequest_client/api/documents_search_api.rb +133 -0
  60. data/lib/signrequest_client/api/events_api.rb +172 -0
  61. data/lib/signrequest_client/api/signrequest_quick_create_api.rb +78 -0
  62. data/lib/signrequest_client/api/signrequests_api.rb +316 -0
  63. data/lib/signrequest_client/api/team_members_api.rb +151 -0
  64. data/lib/signrequest_client/api/teams_api.rb +371 -0
  65. data/lib/signrequest_client/api/templates_api.rb +133 -0
  66. data/lib/signrequest_client/api/webhooks_api.rb +364 -0
  67. data/lib/signrequest_client/api_client.rb +389 -0
  68. data/lib/signrequest_client/api_error.rb +38 -0
  69. data/lib/signrequest_client/configuration.rb +209 -0
  70. data/lib/signrequest_client/models/auth_token.rb +298 -0
  71. data/lib/signrequest_client/models/document.rb +605 -0
  72. data/lib/signrequest_client/models/document_attachment.rb +304 -0
  73. data/lib/signrequest_client/models/document_search.rb +519 -0
  74. data/lib/signrequest_client/models/document_signer_template_conf.rb +294 -0
  75. data/lib/signrequest_client/models/event.rb +330 -0
  76. data/lib/signrequest_client/models/file_from_sf.rb +245 -0
  77. data/lib/signrequest_client/models/inline_document_signer_integration_data.rb +230 -0
  78. data/lib/signrequest_client/models/inline_integration_data.rb +230 -0
  79. data/lib/signrequest_client/models/inline_prefill_tags.rb +231 -0
  80. data/lib/signrequest_client/models/inline_response_200.rb +227 -0
  81. data/lib/signrequest_client/models/inline_response_200_1.rb +227 -0
  82. data/lib/signrequest_client/models/inline_response_200_2.rb +227 -0
  83. data/lib/signrequest_client/models/inline_response_200_3.rb +227 -0
  84. data/lib/signrequest_client/models/inline_response_200_4.rb +227 -0
  85. data/lib/signrequest_client/models/inline_response_200_5.rb +227 -0
  86. data/lib/signrequest_client/models/inline_response_200_6.rb +227 -0
  87. data/lib/signrequest_client/models/inline_response_200_7.rb +227 -0
  88. data/lib/signrequest_client/models/inline_response_200_8.rb +227 -0
  89. data/lib/signrequest_client/models/inline_response_200_9.rb +227 -0
  90. data/lib/signrequest_client/models/inline_sign_request.rb +496 -0
  91. data/lib/signrequest_client/models/inline_team.rb +247 -0
  92. data/lib/signrequest_client/models/inline_team_member.rb +249 -0
  93. data/lib/signrequest_client/models/invite_member.rb +234 -0
  94. data/lib/signrequest_client/models/placeholder.rb +326 -0
  95. data/lib/signrequest_client/models/required_attachment.rb +246 -0
  96. data/lib/signrequest_client/models/sign_request.rb +543 -0
  97. data/lib/signrequest_client/models/sign_request_quick_create.rb +764 -0
  98. data/lib/signrequest_client/models/signer.rb +751 -0
  99. data/lib/signrequest_client/models/signer_attachment.rb +247 -0
  100. data/lib/signrequest_client/models/signer_inputs.rb +312 -0
  101. data/lib/signrequest_client/models/signing_log.rb +213 -0
  102. data/lib/signrequest_client/models/team.rb +367 -0
  103. data/lib/signrequest_client/models/team_member.rb +258 -0
  104. data/lib/signrequest_client/models/template.rb +309 -0
  105. data/lib/signrequest_client/models/user.rb +296 -0
  106. data/lib/signrequest_client/models/webhook_subscription.rb +366 -0
  107. data/lib/signrequest_client/version.rb +15 -0
  108. data/lib/signrequest_client.rb +87 -0
  109. data/pkg/signrequest_client-0.1.0.gem +0 -0
  110. data/signrequest_client.gemspec +45 -0
  111. data/signrequst_client/.git/HEAD +1 -0
  112. data/signrequst_client/.git/config +7 -0
  113. data/signrequst_client/.git/description +1 -0
  114. data/signrequst_client/.git/hooks/applypatch-msg.sample +15 -0
  115. data/signrequst_client/.git/hooks/commit-msg.sample +24 -0
  116. data/signrequst_client/.git/hooks/fsmonitor-watchman.sample +114 -0
  117. data/signrequst_client/.git/hooks/post-update.sample +8 -0
  118. data/signrequst_client/.git/hooks/pre-applypatch.sample +14 -0
  119. data/signrequst_client/.git/hooks/pre-commit.sample +49 -0
  120. data/signrequst_client/.git/hooks/pre-push.sample +53 -0
  121. data/signrequst_client/.git/hooks/pre-rebase.sample +169 -0
  122. data/signrequst_client/.git/hooks/pre-receive.sample +24 -0
  123. data/signrequst_client/.git/hooks/prepare-commit-msg.sample +42 -0
  124. data/signrequst_client/.git/hooks/update.sample +128 -0
  125. data/signrequst_client/.git/index +0 -0
  126. data/signrequst_client/.git/info/exclude +6 -0
  127. data/signrequst_client/.git/objects/30/68cc8a074ffc0c7b8891cb21d68b5d367cb8c4 +0 -0
  128. data/signrequst_client/.git/objects/32/c4b7e9f988621ed2ce28954f1aaf088f340848 +2 -0
  129. data/signrequst_client/.git/objects/3e/8c4c2f8d1d5334612f3072160124e985f27e8c +0 -0
  130. data/signrequst_client/.git/objects/43/022f711e20ed55baf2470278eb8e428a04856f +0 -0
  131. data/signrequst_client/.git/objects/6f/8caa83dfb6dc8a987a2829cbfefae18c8870c3 +0 -0
  132. data/signrequst_client/.git/objects/91/06b2a345b019a799c02e5069affa88370b35dd +0 -0
  133. data/signrequst_client/.git/objects/aa/58e53f733551ac2bde6f7a50b5a9f16ddbf110 +0 -0
  134. data/signrequst_client/.git/objects/dc/e67d860af47a4eb630117ce03624bae45dcf26 +3 -0
  135. data/signrequst_client/.git/objects/f1/c9171bed4c19fd22429ffd68d4cbb2c3ce2fce +0 -0
  136. data/signrequst_client/.git/objects/f8/e4c2573ebc57d5a365ebe14d5c18cc8d0716c4 +0 -0
  137. data/spec/api/api_tokens_api_spec.rb +84 -0
  138. data/spec/api/document_attachments_api_spec.rb +75 -0
  139. data/spec/api/documents_api_spec.rb +106 -0
  140. data/spec/api/documents_search_api_spec.rb +60 -0
  141. data/spec/api/events_api_spec.rb +73 -0
  142. data/spec/api/signrequest_quick_create_api_spec.rb +47 -0
  143. data/spec/api/signrequests_api_spec.rb +100 -0
  144. data/spec/api/team_members_api_spec.rb +66 -0
  145. data/spec/api/teams_api_spec.rb +111 -0
  146. data/spec/api/templates_api_spec.rb +60 -0
  147. data/spec/api/webhooks_api_spec.rb +110 -0
  148. data/spec/api_client_spec.rb +226 -0
  149. data/spec/configuration_spec.rb +42 -0
  150. data/spec/models/auth_token_spec.rb +72 -0
  151. data/spec/models/document_attachment_spec.rb +84 -0
  152. data/spec/models/document_search_spec.rb +126 -0
  153. data/spec/models/document_signer_template_conf_spec.rb +78 -0
  154. data/spec/models/document_spec.rb +196 -0
  155. data/spec/models/event_spec.rb +104 -0
  156. data/spec/models/file_from_sf_spec.rb +48 -0
  157. data/spec/models/inline_document_signer_integration_data_spec.rb +52 -0
  158. data/spec/models/inline_integration_data_spec.rb +52 -0
  159. data/spec/models/inline_prefill_tags_spec.rb +60 -0
  160. data/spec/models/inline_response_200_1_spec.rb +60 -0
  161. data/spec/models/inline_response_200_2_spec.rb +60 -0
  162. data/spec/models/inline_response_200_3_spec.rb +60 -0
  163. data/spec/models/inline_response_200_4_spec.rb +60 -0
  164. data/spec/models/inline_response_200_5_spec.rb +60 -0
  165. data/spec/models/inline_response_200_6_spec.rb +60 -0
  166. data/spec/models/inline_response_200_7_spec.rb +60 -0
  167. data/spec/models/inline_response_200_8_spec.rb +60 -0
  168. data/spec/models/inline_response_200_9_spec.rb +60 -0
  169. data/spec/models/inline_response_200_spec.rb +60 -0
  170. data/spec/models/inline_sign_request_spec.rb +148 -0
  171. data/spec/models/inline_team_member_spec.rb +72 -0
  172. data/spec/models/inline_team_spec.rb +54 -0
  173. data/spec/models/invite_member_spec.rb +54 -0
  174. data/spec/models/placeholder_spec.rb +88 -0
  175. data/spec/models/required_attachment_spec.rb +48 -0
  176. data/spec/models/sign_request_quick_create_spec.rb +254 -0
  177. data/spec/models/sign_request_spec.rb +176 -0
  178. data/spec/models/signer_attachment_spec.rb +60 -0
  179. data/spec/models/signer_inputs_spec.rb +82 -0
  180. data/spec/models/signer_spec.rb +238 -0
  181. data/spec/models/signing_log_spec.rb +48 -0
  182. data/spec/models/team_member_spec.rb +78 -0
  183. data/spec/models/team_spec.rb +84 -0
  184. data/spec/models/template_spec.rb +82 -0
  185. data/spec/models/user_spec.rb +60 -0
  186. data/spec/models/webhook_subscription_spec.rb +92 -0
  187. data/spec/spec_helper.rb +111 -0
  188. metadata +461 -0
@@ -0,0 +1,543 @@
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.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module SignRequestClient
16
+
17
+ class SignRequest
18
+ attr_accessor :from_email
19
+
20
+ attr_accessor :from_email_name
21
+
22
+ attr_accessor :is_being_prepared
23
+
24
+ attr_accessor :prepare_url
25
+
26
+ attr_accessor :redirect_url
27
+
28
+ attr_accessor :required_attachments
29
+
30
+ attr_accessor :disable_attachments
31
+
32
+ attr_accessor :disable_text_signatures
33
+
34
+ attr_accessor :disable_text
35
+
36
+ attr_accessor :disable_date
37
+
38
+ attr_accessor :disable_emails
39
+
40
+ attr_accessor :disable_upload_signatures
41
+
42
+ attr_accessor :subject
43
+
44
+ attr_accessor :message
45
+
46
+ attr_accessor :who
47
+
48
+ attr_accessor :send_reminders
49
+
50
+ attr_accessor :signers
51
+
52
+ attr_accessor :uuid
53
+
54
+ attr_accessor :url
55
+
56
+ attr_accessor :document
57
+
58
+ attr_accessor :integration
59
+
60
+ attr_accessor :integration_data
61
+
62
+ class EnumAttributeValidator
63
+ attr_reader :datatype
64
+ attr_reader :allowable_values
65
+
66
+ def initialize(datatype, allowable_values)
67
+ @allowable_values = allowable_values.map do |value|
68
+ case datatype.to_s
69
+ when /Integer/i
70
+ value.to_i
71
+ when /Float/i
72
+ value.to_f
73
+ else
74
+ value
75
+ end
76
+ end
77
+ end
78
+
79
+ def valid?(value)
80
+ !value || allowable_values.include?(value)
81
+ end
82
+ end
83
+
84
+ # Attribute mapping from ruby-style variable name to JSON key.
85
+ def self.attribute_map
86
+ {
87
+ :'from_email' => :'from_email',
88
+ :'from_email_name' => :'from_email_name',
89
+ :'is_being_prepared' => :'is_being_prepared',
90
+ :'prepare_url' => :'prepare_url',
91
+ :'redirect_url' => :'redirect_url',
92
+ :'required_attachments' => :'required_attachments',
93
+ :'disable_attachments' => :'disable_attachments',
94
+ :'disable_text_signatures' => :'disable_text_signatures',
95
+ :'disable_text' => :'disable_text',
96
+ :'disable_date' => :'disable_date',
97
+ :'disable_emails' => :'disable_emails',
98
+ :'disable_upload_signatures' => :'disable_upload_signatures',
99
+ :'subject' => :'subject',
100
+ :'message' => :'message',
101
+ :'who' => :'who',
102
+ :'send_reminders' => :'send_reminders',
103
+ :'signers' => :'signers',
104
+ :'uuid' => :'uuid',
105
+ :'url' => :'url',
106
+ :'document' => :'document',
107
+ :'integration' => :'integration',
108
+ :'integration_data' => :'integration_data'
109
+ }
110
+ end
111
+
112
+ # Attribute type mapping.
113
+ def self.swagger_types
114
+ {
115
+ :'from_email' => :'String',
116
+ :'from_email_name' => :'String',
117
+ :'is_being_prepared' => :'BOOLEAN',
118
+ :'prepare_url' => :'String',
119
+ :'redirect_url' => :'String',
120
+ :'required_attachments' => :'Array<RequiredAttachment>',
121
+ :'disable_attachments' => :'BOOLEAN',
122
+ :'disable_text_signatures' => :'BOOLEAN',
123
+ :'disable_text' => :'BOOLEAN',
124
+ :'disable_date' => :'BOOLEAN',
125
+ :'disable_emails' => :'BOOLEAN',
126
+ :'disable_upload_signatures' => :'BOOLEAN',
127
+ :'subject' => :'String',
128
+ :'message' => :'String',
129
+ :'who' => :'String',
130
+ :'send_reminders' => :'BOOLEAN',
131
+ :'signers' => :'Array<Signer>',
132
+ :'uuid' => :'String',
133
+ :'url' => :'String',
134
+ :'document' => :'String',
135
+ :'integration' => :'String',
136
+ :'integration_data' => :'String'
137
+ }
138
+ end
139
+
140
+ # Initializes the object
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ def initialize(attributes = {})
143
+ return unless attributes.is_a?(Hash)
144
+
145
+ # convert string to symbol for hash key
146
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
147
+
148
+ if attributes.has_key?(:'from_email')
149
+ self.from_email = attributes[:'from_email']
150
+ end
151
+
152
+ if attributes.has_key?(:'from_email_name')
153
+ self.from_email_name = attributes[:'from_email_name']
154
+ end
155
+
156
+ if attributes.has_key?(:'is_being_prepared')
157
+ self.is_being_prepared = attributes[:'is_being_prepared']
158
+ end
159
+
160
+ if attributes.has_key?(:'prepare_url')
161
+ self.prepare_url = attributes[:'prepare_url']
162
+ end
163
+
164
+ if attributes.has_key?(:'redirect_url')
165
+ self.redirect_url = attributes[:'redirect_url']
166
+ end
167
+
168
+ if attributes.has_key?(:'required_attachments')
169
+ if (value = attributes[:'required_attachments']).is_a?(Array)
170
+ self.required_attachments = value
171
+ end
172
+ end
173
+
174
+ if attributes.has_key?(:'disable_attachments')
175
+ self.disable_attachments = attributes[:'disable_attachments']
176
+ end
177
+
178
+ if attributes.has_key?(:'disable_text_signatures')
179
+ self.disable_text_signatures = attributes[:'disable_text_signatures']
180
+ end
181
+
182
+ if attributes.has_key?(:'disable_text')
183
+ self.disable_text = attributes[:'disable_text']
184
+ end
185
+
186
+ if attributes.has_key?(:'disable_date')
187
+ self.disable_date = attributes[:'disable_date']
188
+ end
189
+
190
+ if attributes.has_key?(:'disable_emails')
191
+ self.disable_emails = attributes[:'disable_emails']
192
+ end
193
+
194
+ if attributes.has_key?(:'disable_upload_signatures')
195
+ self.disable_upload_signatures = attributes[:'disable_upload_signatures']
196
+ end
197
+
198
+ if attributes.has_key?(:'subject')
199
+ self.subject = attributes[:'subject']
200
+ end
201
+
202
+ if attributes.has_key?(:'message')
203
+ self.message = attributes[:'message']
204
+ end
205
+
206
+ if attributes.has_key?(:'who')
207
+ self.who = attributes[:'who']
208
+ else
209
+ self.who = "o"
210
+ end
211
+
212
+ if attributes.has_key?(:'send_reminders')
213
+ self.send_reminders = attributes[:'send_reminders']
214
+ end
215
+
216
+ if attributes.has_key?(:'signers')
217
+ if (value = attributes[:'signers']).is_a?(Array)
218
+ self.signers = value
219
+ end
220
+ end
221
+
222
+ if attributes.has_key?(:'uuid')
223
+ self.uuid = attributes[:'uuid']
224
+ end
225
+
226
+ if attributes.has_key?(:'url')
227
+ self.url = attributes[:'url']
228
+ end
229
+
230
+ if attributes.has_key?(:'document')
231
+ self.document = attributes[:'document']
232
+ end
233
+
234
+ if attributes.has_key?(:'integration')
235
+ self.integration = attributes[:'integration']
236
+ end
237
+
238
+ if attributes.has_key?(:'integration_data')
239
+ self.integration_data = attributes[:'integration_data']
240
+ end
241
+
242
+ end
243
+
244
+ # Show invalid properties with the reasons. Usually used together with valid?
245
+ # @return Array for valid properties with the reasons
246
+ def list_invalid_properties
247
+ invalid_properties = Array.new
248
+ if !@from_email.nil? && @from_email.to_s.length > 255
249
+ invalid_properties.push("invalid value for 'from_email', the character length must be smaller than or equal to 255.")
250
+ end
251
+
252
+ if !@from_email.nil? && @from_email.to_s.length < 1
253
+ invalid_properties.push("invalid value for 'from_email', the character length must be great than or equal to 1.")
254
+ end
255
+
256
+ if !@from_email_name.nil? && @from_email_name.to_s.length > 255
257
+ invalid_properties.push("invalid value for 'from_email_name', the character length must be smaller than or equal to 255.")
258
+ end
259
+
260
+ if !@prepare_url.nil? && @prepare_url.to_s.length < 1
261
+ invalid_properties.push("invalid value for 'prepare_url', the character length must be great than or equal to 1.")
262
+ end
263
+
264
+ if !@redirect_url.nil? && @redirect_url.to_s.length > 2100
265
+ invalid_properties.push("invalid value for 'redirect_url', the character length must be smaller than or equal to 2100.")
266
+ end
267
+
268
+ if !@subject.nil? && @subject.to_s.length > 512
269
+ invalid_properties.push("invalid value for 'subject', the character length must be smaller than or equal to 512.")
270
+ end
271
+
272
+ if @signers.nil?
273
+ invalid_properties.push("invalid value for 'signers', signers cannot be nil.")
274
+ end
275
+
276
+ if !@uuid.nil? && @uuid.to_s.length < 1
277
+ invalid_properties.push("invalid value for 'uuid', the character length must be great than or equal to 1.")
278
+ end
279
+
280
+ if @document.nil?
281
+ invalid_properties.push("invalid value for 'document', document cannot be nil.")
282
+ end
283
+
284
+ return invalid_properties
285
+ end
286
+
287
+ # Check to see if the all the properties in the model are valid
288
+ # @return true if the model is valid
289
+ def valid?
290
+ return false if !@from_email.nil? && @from_email.to_s.length > 255
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 > 255
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 > 2100
295
+ return false if !@subject.nil? && @subject.to_s.length > 512
296
+ who_validator = EnumAttributeValidator.new('String', ["m", "mo", "o"])
297
+ return false unless who_validator.valid?(@who)
298
+ return false if @signers.nil?
299
+ return false if !@uuid.nil? && @uuid.to_s.length < 1
300
+ return false if @document.nil?
301
+ integration_validator = EnumAttributeValidator.new('String', ["mfiles", "salesforce", "formdesk", "zapier", "txhash"])
302
+ return false unless integration_validator.valid?(@integration)
303
+ return true
304
+ end
305
+
306
+ # Custom attribute writer method with validation
307
+ # @param [Object] from_email Value to be assigned
308
+ def from_email=(from_email)
309
+
310
+ if !from_email.nil? && from_email.to_s.length > 255
311
+ fail ArgumentError, "invalid value for 'from_email', the character length must be smaller than or equal to 255."
312
+ end
313
+
314
+ if !from_email.nil? && from_email.to_s.length < 1
315
+ fail ArgumentError, "invalid value for 'from_email', the character length must be great than or equal to 1."
316
+ end
317
+
318
+ @from_email = from_email
319
+ end
320
+
321
+ # Custom attribute writer method with validation
322
+ # @param [Object] from_email_name Value to be assigned
323
+ def from_email_name=(from_email_name)
324
+
325
+ if !from_email_name.nil? && from_email_name.to_s.length > 255
326
+ fail ArgumentError, "invalid value for 'from_email_name', the character length must be smaller than or equal to 255."
327
+ end
328
+
329
+ @from_email_name = from_email_name
330
+ end
331
+
332
+ # Custom attribute writer method with validation
333
+ # @param [Object] prepare_url Value to be assigned
334
+ def prepare_url=(prepare_url)
335
+
336
+ if !prepare_url.nil? && prepare_url.to_s.length < 1
337
+ fail ArgumentError, "invalid value for 'prepare_url', the character length must be great than or equal to 1."
338
+ end
339
+
340
+ @prepare_url = prepare_url
341
+ end
342
+
343
+ # Custom attribute writer method with validation
344
+ # @param [Object] redirect_url Value to be assigned
345
+ def redirect_url=(redirect_url)
346
+
347
+ if !redirect_url.nil? && redirect_url.to_s.length > 2100
348
+ fail ArgumentError, "invalid value for 'redirect_url', the character length must be smaller than or equal to 2100."
349
+ end
350
+
351
+ @redirect_url = redirect_url
352
+ end
353
+
354
+ # Custom attribute writer method with validation
355
+ # @param [Object] subject Value to be assigned
356
+ def subject=(subject)
357
+
358
+ if !subject.nil? && subject.to_s.length > 512
359
+ fail ArgumentError, "invalid value for 'subject', the character length must be smaller than or equal to 512."
360
+ end
361
+
362
+ @subject = subject
363
+ end
364
+
365
+ # Custom attribute writer method checking allowed values (enum).
366
+ # @param [Object] who Object to be assigned
367
+ def who=(who)
368
+ validator = EnumAttributeValidator.new('String', ["m", "mo", "o"])
369
+ unless validator.valid?(who)
370
+ fail ArgumentError, "invalid value for 'who', must be one of #{validator.allowable_values}."
371
+ end
372
+ @who = who
373
+ end
374
+
375
+ # Custom attribute writer method with validation
376
+ # @param [Object] uuid Value to be assigned
377
+ def uuid=(uuid)
378
+
379
+ if !uuid.nil? && uuid.to_s.length < 1
380
+ fail ArgumentError, "invalid value for 'uuid', the character length must be great than or equal to 1."
381
+ end
382
+
383
+ @uuid = uuid
384
+ end
385
+
386
+ # Custom attribute writer method checking allowed values (enum).
387
+ # @param [Object] integration Object to be assigned
388
+ def integration=(integration)
389
+ validator = EnumAttributeValidator.new('String', ["mfiles", "salesforce", "formdesk", "zapier", "txhash"])
390
+ unless validator.valid?(integration)
391
+ fail ArgumentError, "invalid value for 'integration', must be one of #{validator.allowable_values}."
392
+ end
393
+ @integration = integration
394
+ end
395
+
396
+ # Checks equality by comparing each attribute.
397
+ # @param [Object] Object to be compared
398
+ def ==(o)
399
+ return true if self.equal?(o)
400
+ self.class == o.class &&
401
+ from_email == o.from_email &&
402
+ from_email_name == o.from_email_name &&
403
+ is_being_prepared == o.is_being_prepared &&
404
+ prepare_url == o.prepare_url &&
405
+ redirect_url == o.redirect_url &&
406
+ required_attachments == o.required_attachments &&
407
+ disable_attachments == o.disable_attachments &&
408
+ disable_text_signatures == o.disable_text_signatures &&
409
+ disable_text == o.disable_text &&
410
+ disable_date == o.disable_date &&
411
+ disable_emails == o.disable_emails &&
412
+ disable_upload_signatures == o.disable_upload_signatures &&
413
+ subject == o.subject &&
414
+ message == o.message &&
415
+ who == o.who &&
416
+ send_reminders == o.send_reminders &&
417
+ signers == o.signers &&
418
+ uuid == o.uuid &&
419
+ url == o.url &&
420
+ document == o.document &&
421
+ integration == o.integration &&
422
+ integration_data == o.integration_data
423
+ end
424
+
425
+ # @see the `==` method
426
+ # @param [Object] Object to be compared
427
+ def eql?(o)
428
+ self == o
429
+ end
430
+
431
+ # Calculates hash code according to all attributes.
432
+ # @return [Fixnum] Hash code
433
+ def hash
434
+ [from_email, from_email_name, is_being_prepared, prepare_url, redirect_url, required_attachments, disable_attachments, disable_text_signatures, disable_text, disable_date, disable_emails, disable_upload_signatures, subject, message, who, send_reminders, signers, uuid, url, document, integration, integration_data].hash
435
+ end
436
+
437
+ # Builds the object from hash
438
+ # @param [Hash] attributes Model attributes in the form of hash
439
+ # @return [Object] Returns the model itself
440
+ def build_from_hash(attributes)
441
+ return nil unless attributes.is_a?(Hash)
442
+ self.class.swagger_types.each_pair do |key, type|
443
+ if type =~ /\AArray<(.*)>/i
444
+ # check to ensure the input is an array given that the the attribute
445
+ # is documented as an array but the input is not
446
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
447
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
448
+ end
449
+ elsif !attributes[self.class.attribute_map[key]].nil?
450
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
451
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
452
+ end
453
+
454
+ self
455
+ end
456
+
457
+ # Deserializes the data based on type
458
+ # @param string type Data type
459
+ # @param string value Value to be deserialized
460
+ # @return [Object] Deserialized data
461
+ def _deserialize(type, value)
462
+ case type.to_sym
463
+ when :DateTime
464
+ DateTime.parse(value)
465
+ when :Date
466
+ Date.parse(value)
467
+ when :String
468
+ value.to_s
469
+ when :Integer
470
+ value.to_i
471
+ when :Float
472
+ value.to_f
473
+ when :BOOLEAN
474
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
475
+ true
476
+ else
477
+ false
478
+ end
479
+ when :Object
480
+ # generic object (usually a Hash), return directly
481
+ value
482
+ when /\AArray<(?<inner_type>.+)>\z/
483
+ inner_type = Regexp.last_match[:inner_type]
484
+ value.map { |v| _deserialize(inner_type, v) }
485
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
486
+ k_type = Regexp.last_match[:k_type]
487
+ v_type = Regexp.last_match[:v_type]
488
+ {}.tap do |hash|
489
+ value.each do |k, v|
490
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
491
+ end
492
+ end
493
+ else # model
494
+ temp_model = SignRequestClient.const_get(type).new
495
+ temp_model.build_from_hash(value)
496
+ end
497
+ end
498
+
499
+ # Returns the string representation of the object
500
+ # @return [String] String presentation of the object
501
+ def to_s
502
+ to_hash.to_s
503
+ end
504
+
505
+ # to_body is an alias to to_hash (backward compatibility)
506
+ # @return [Hash] Returns the object in the form of hash
507
+ def to_body
508
+ to_hash
509
+ end
510
+
511
+ # Returns the object in the form of hash
512
+ # @return [Hash] Returns the object in the form of hash
513
+ def to_hash
514
+ hash = {}
515
+ self.class.attribute_map.each_pair do |attr, param|
516
+ value = self.send(attr)
517
+ next if value.nil?
518
+ hash[param] = _to_hash(value)
519
+ end
520
+ hash
521
+ end
522
+
523
+ # Outputs non-array value in the form of hash
524
+ # For object, use to_hash. Otherwise, just return the value
525
+ # @param [Object] value Any valid value
526
+ # @return [Hash] Returns the value in the form of hash
527
+ def _to_hash(value)
528
+ if value.is_a?(Array)
529
+ value.compact.map{ |v| _to_hash(v) }
530
+ elsif value.is_a?(Hash)
531
+ {}.tap do |hash|
532
+ value.each { |k, v| hash[k] = _to_hash(v) }
533
+ end
534
+ elsif value.respond_to? :to_hash
535
+ value.to_hash
536
+ else
537
+ value
538
+ end
539
+ end
540
+
541
+ end
542
+
543
+ end