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,234 @@
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 InviteMember
18
+ attr_accessor :email
19
+
20
+ attr_accessor :is_admin
21
+
22
+ attr_accessor :is_owner
23
+
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'email' => :'email',
29
+ :'is_admin' => :'is_admin',
30
+ :'is_owner' => :'is_owner'
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.swagger_types
36
+ {
37
+ :'email' => :'String',
38
+ :'is_admin' => :'BOOLEAN',
39
+ :'is_owner' => :'BOOLEAN'
40
+ }
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ return unless attributes.is_a?(Hash)
47
+
48
+ # convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
50
+
51
+ if attributes.has_key?(:'email')
52
+ self.email = attributes[:'email']
53
+ end
54
+
55
+ if attributes.has_key?(:'is_admin')
56
+ self.is_admin = attributes[:'is_admin']
57
+ else
58
+ self.is_admin = false
59
+ end
60
+
61
+ if attributes.has_key?(:'is_owner')
62
+ self.is_owner = attributes[:'is_owner']
63
+ else
64
+ self.is_owner = false
65
+ end
66
+
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = Array.new
73
+ if @email.nil?
74
+ invalid_properties.push("invalid value for 'email', email cannot be nil.")
75
+ end
76
+
77
+ if @email.to_s.length < 1
78
+ invalid_properties.push("invalid value for 'email', the character length must be great than or equal to 1.")
79
+ end
80
+
81
+ return invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ return false if @email.nil?
88
+ return false if @email.to_s.length < 1
89
+ return true
90
+ end
91
+
92
+ # Custom attribute writer method with validation
93
+ # @param [Object] email Value to be assigned
94
+ def email=(email)
95
+ if email.nil?
96
+ fail ArgumentError, "email cannot be nil"
97
+ end
98
+
99
+ if email.to_s.length < 1
100
+ fail ArgumentError, "invalid value for 'email', the character length must be great than or equal to 1."
101
+ end
102
+
103
+ @email = email
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ email == o.email &&
112
+ is_admin == o.is_admin &&
113
+ is_owner == o.is_owner
114
+ end
115
+
116
+ # @see the `==` method
117
+ # @param [Object] Object to be compared
118
+ def eql?(o)
119
+ self == o
120
+ end
121
+
122
+ # Calculates hash code according to all attributes.
123
+ # @return [Fixnum] Hash code
124
+ def hash
125
+ [email, is_admin, is_owner].hash
126
+ end
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ def build_from_hash(attributes)
132
+ return nil unless attributes.is_a?(Hash)
133
+ self.class.swagger_types.each_pair do |key, type|
134
+ if type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
138
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
139
+ end
140
+ elsif !attributes[self.class.attribute_map[key]].nil?
141
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
142
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
143
+ end
144
+
145
+ self
146
+ end
147
+
148
+ # Deserializes the data based on type
149
+ # @param string type Data type
150
+ # @param string value Value to be deserialized
151
+ # @return [Object] Deserialized data
152
+ def _deserialize(type, value)
153
+ case type.to_sym
154
+ when :DateTime
155
+ DateTime.parse(value)
156
+ when :Date
157
+ Date.parse(value)
158
+ when :String
159
+ value.to_s
160
+ when :Integer
161
+ value.to_i
162
+ when :Float
163
+ value.to_f
164
+ when :BOOLEAN
165
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166
+ true
167
+ else
168
+ false
169
+ end
170
+ when :Object
171
+ # generic object (usually a Hash), return directly
172
+ value
173
+ when /\AArray<(?<inner_type>.+)>\z/
174
+ inner_type = Regexp.last_match[:inner_type]
175
+ value.map { |v| _deserialize(inner_type, v) }
176
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177
+ k_type = Regexp.last_match[:k_type]
178
+ v_type = Regexp.last_match[:v_type]
179
+ {}.tap do |hash|
180
+ value.each do |k, v|
181
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182
+ end
183
+ end
184
+ else # model
185
+ temp_model = SignRequestClient.const_get(type).new
186
+ temp_model.build_from_hash(value)
187
+ end
188
+ end
189
+
190
+ # Returns the string representation of the object
191
+ # @return [String] String presentation of the object
192
+ def to_s
193
+ to_hash.to_s
194
+ end
195
+
196
+ # to_body is an alias to to_hash (backward compatibility)
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_body
199
+ to_hash
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ self.class.attribute_map.each_pair do |attr, param|
207
+ value = self.send(attr)
208
+ next if value.nil?
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ # Outputs non-array value in the form of hash
215
+ # For object, use to_hash. Otherwise, just return the value
216
+ # @param [Object] value Any valid value
217
+ # @return [Hash] Returns the value in the form of hash
218
+ def _to_hash(value)
219
+ if value.is_a?(Array)
220
+ value.compact.map{ |v| _to_hash(v) }
221
+ elsif value.is_a?(Hash)
222
+ {}.tap do |hash|
223
+ value.each { |k, v| hash[k] = _to_hash(v) }
224
+ end
225
+ elsif value.respond_to? :to_hash
226
+ value.to_hash
227
+ else
228
+ value
229
+ end
230
+ end
231
+
232
+ end
233
+
234
+ end
@@ -0,0 +1,326 @@
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 Placeholder
18
+ attr_accessor :uuid
19
+
20
+ attr_accessor :type
21
+
22
+ attr_accessor :page_index
23
+
24
+ attr_accessor :prefill
25
+
26
+ attr_accessor :text
27
+
28
+ attr_accessor :checkbox_value
29
+
30
+ attr_accessor :date_value
31
+
32
+ attr_accessor :external_id
33
+
34
+ class EnumAttributeValidator
35
+ attr_reader :datatype
36
+ attr_reader :allowable_values
37
+
38
+ def initialize(datatype, allowable_values)
39
+ @allowable_values = allowable_values.map do |value|
40
+ case datatype.to_s
41
+ when /Integer/i
42
+ value.to_i
43
+ when /Float/i
44
+ value.to_f
45
+ else
46
+ value
47
+ end
48
+ end
49
+ end
50
+
51
+ def valid?(value)
52
+ !value || allowable_values.include?(value)
53
+ end
54
+ end
55
+
56
+ # Attribute mapping from ruby-style variable name to JSON key.
57
+ def self.attribute_map
58
+ {
59
+ :'uuid' => :'uuid',
60
+ :'type' => :'type',
61
+ :'page_index' => :'page_index',
62
+ :'prefill' => :'prefill',
63
+ :'text' => :'text',
64
+ :'checkbox_value' => :'checkbox_value',
65
+ :'date_value' => :'date_value',
66
+ :'external_id' => :'external_id'
67
+ }
68
+ end
69
+
70
+ # Attribute type mapping.
71
+ def self.swagger_types
72
+ {
73
+ :'uuid' => :'String',
74
+ :'type' => :'String',
75
+ :'page_index' => :'Integer',
76
+ :'prefill' => :'BOOLEAN',
77
+ :'text' => :'String',
78
+ :'checkbox_value' => :'BOOLEAN',
79
+ :'date_value' => :'Date',
80
+ :'external_id' => :'String'
81
+ }
82
+ end
83
+
84
+ # Initializes the object
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ def initialize(attributes = {})
87
+ return unless attributes.is_a?(Hash)
88
+
89
+ # convert string to symbol for hash key
90
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
91
+
92
+ if attributes.has_key?(:'uuid')
93
+ self.uuid = attributes[:'uuid']
94
+ end
95
+
96
+ if attributes.has_key?(:'type')
97
+ self.type = attributes[:'type']
98
+ end
99
+
100
+ if attributes.has_key?(:'page_index')
101
+ self.page_index = attributes[:'page_index']
102
+ end
103
+
104
+ if attributes.has_key?(:'prefill')
105
+ self.prefill = attributes[:'prefill']
106
+ end
107
+
108
+ if attributes.has_key?(:'text')
109
+ self.text = attributes[:'text']
110
+ end
111
+
112
+ if attributes.has_key?(:'checkbox_value')
113
+ self.checkbox_value = attributes[:'checkbox_value']
114
+ end
115
+
116
+ if attributes.has_key?(:'date_value')
117
+ self.date_value = attributes[:'date_value']
118
+ end
119
+
120
+ if attributes.has_key?(:'external_id')
121
+ self.external_id = attributes[:'external_id']
122
+ end
123
+
124
+ end
125
+
126
+ # Show invalid properties with the reasons. Usually used together with valid?
127
+ # @return Array for valid properties with the reasons
128
+ def list_invalid_properties
129
+ invalid_properties = Array.new
130
+ if !@uuid.nil? && @uuid.to_s.length < 1
131
+ invalid_properties.push("invalid value for 'uuid', the character length must be great than or equal to 1.")
132
+ end
133
+
134
+ if @page_index.nil?
135
+ invalid_properties.push("invalid value for 'page_index', page_index cannot be nil.")
136
+ end
137
+
138
+ if @prefill.nil?
139
+ invalid_properties.push("invalid value for 'prefill', prefill cannot be nil.")
140
+ end
141
+
142
+ if !@external_id.nil? && @external_id.to_s.length > 255
143
+ invalid_properties.push("invalid value for 'external_id', the character length must be smaller than or equal to 255.")
144
+ end
145
+
146
+ return invalid_properties
147
+ end
148
+
149
+ # Check to see if the all the properties in the model are valid
150
+ # @return true if the model is valid
151
+ def valid?
152
+ return false if !@uuid.nil? && @uuid.to_s.length < 1
153
+ type_validator = EnumAttributeValidator.new('String', ["s", "i", "n", "d", "t", "c"])
154
+ return false unless type_validator.valid?(@type)
155
+ return false if @page_index.nil?
156
+ return false if @prefill.nil?
157
+ return false if !@external_id.nil? && @external_id.to_s.length > 255
158
+ return true
159
+ end
160
+
161
+ # Custom attribute writer method with validation
162
+ # @param [Object] uuid Value to be assigned
163
+ def uuid=(uuid)
164
+
165
+ if !uuid.nil? && uuid.to_s.length < 1
166
+ fail ArgumentError, "invalid value for 'uuid', the character length must be great than or equal to 1."
167
+ end
168
+
169
+ @uuid = uuid
170
+ end
171
+
172
+ # Custom attribute writer method checking allowed values (enum).
173
+ # @param [Object] type Object to be assigned
174
+ def type=(type)
175
+ validator = EnumAttributeValidator.new('String', ["s", "i", "n", "d", "t", "c"])
176
+ unless validator.valid?(type)
177
+ fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
178
+ end
179
+ @type = type
180
+ end
181
+
182
+ # Custom attribute writer method with validation
183
+ # @param [Object] external_id Value to be assigned
184
+ def external_id=(external_id)
185
+
186
+ if !external_id.nil? && external_id.to_s.length > 255
187
+ fail ArgumentError, "invalid value for 'external_id', the character length must be smaller than or equal to 255."
188
+ end
189
+
190
+ @external_id = external_id
191
+ end
192
+
193
+ # Checks equality by comparing each attribute.
194
+ # @param [Object] Object to be compared
195
+ def ==(o)
196
+ return true if self.equal?(o)
197
+ self.class == o.class &&
198
+ uuid == o.uuid &&
199
+ type == o.type &&
200
+ page_index == o.page_index &&
201
+ prefill == o.prefill &&
202
+ text == o.text &&
203
+ checkbox_value == o.checkbox_value &&
204
+ date_value == o.date_value &&
205
+ external_id == o.external_id
206
+ end
207
+
208
+ # @see the `==` method
209
+ # @param [Object] Object to be compared
210
+ def eql?(o)
211
+ self == o
212
+ end
213
+
214
+ # Calculates hash code according to all attributes.
215
+ # @return [Fixnum] Hash code
216
+ def hash
217
+ [uuid, type, page_index, prefill, text, checkbox_value, date_value, external_id].hash
218
+ end
219
+
220
+ # Builds the object from hash
221
+ # @param [Hash] attributes Model attributes in the form of hash
222
+ # @return [Object] Returns the model itself
223
+ def build_from_hash(attributes)
224
+ return nil unless attributes.is_a?(Hash)
225
+ self.class.swagger_types.each_pair do |key, type|
226
+ if type =~ /\AArray<(.*)>/i
227
+ # check to ensure the input is an array given that the the attribute
228
+ # is documented as an array but the input is not
229
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
230
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
231
+ end
232
+ elsif !attributes[self.class.attribute_map[key]].nil?
233
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
234
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
235
+ end
236
+
237
+ self
238
+ end
239
+
240
+ # Deserializes the data based on type
241
+ # @param string type Data type
242
+ # @param string value Value to be deserialized
243
+ # @return [Object] Deserialized data
244
+ def _deserialize(type, value)
245
+ case type.to_sym
246
+ when :DateTime
247
+ DateTime.parse(value)
248
+ when :Date
249
+ Date.parse(value)
250
+ when :String
251
+ value.to_s
252
+ when :Integer
253
+ value.to_i
254
+ when :Float
255
+ value.to_f
256
+ when :BOOLEAN
257
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
258
+ true
259
+ else
260
+ false
261
+ end
262
+ when :Object
263
+ # generic object (usually a Hash), return directly
264
+ value
265
+ when /\AArray<(?<inner_type>.+)>\z/
266
+ inner_type = Regexp.last_match[:inner_type]
267
+ value.map { |v| _deserialize(inner_type, v) }
268
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
269
+ k_type = Regexp.last_match[:k_type]
270
+ v_type = Regexp.last_match[:v_type]
271
+ {}.tap do |hash|
272
+ value.each do |k, v|
273
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
274
+ end
275
+ end
276
+ else # model
277
+ temp_model = SignRequestClient.const_get(type).new
278
+ temp_model.build_from_hash(value)
279
+ end
280
+ end
281
+
282
+ # Returns the string representation of the object
283
+ # @return [String] String presentation of the object
284
+ def to_s
285
+ to_hash.to_s
286
+ end
287
+
288
+ # to_body is an alias to to_hash (backward compatibility)
289
+ # @return [Hash] Returns the object in the form of hash
290
+ def to_body
291
+ to_hash
292
+ end
293
+
294
+ # Returns the object in the form of hash
295
+ # @return [Hash] Returns the object in the form of hash
296
+ def to_hash
297
+ hash = {}
298
+ self.class.attribute_map.each_pair do |attr, param|
299
+ value = self.send(attr)
300
+ next if value.nil?
301
+ hash[param] = _to_hash(value)
302
+ end
303
+ hash
304
+ end
305
+
306
+ # Outputs non-array value in the form of hash
307
+ # For object, use to_hash. Otherwise, just return the value
308
+ # @param [Object] value Any valid value
309
+ # @return [Hash] Returns the value in the form of hash
310
+ def _to_hash(value)
311
+ if value.is_a?(Array)
312
+ value.compact.map{ |v| _to_hash(v) }
313
+ elsif value.is_a?(Hash)
314
+ {}.tap do |hash|
315
+ value.each { |k, v| hash[k] = _to_hash(v) }
316
+ end
317
+ elsif value.respond_to? :to_hash
318
+ value.to_hash
319
+ else
320
+ value
321
+ end
322
+ end
323
+
324
+ end
325
+
326
+ end