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