signrequest_client 0.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.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +69 -0
- data/LICENSE +21 -0
- data/README.md +122 -0
- data/Rakefile +9 -0
- data/docs/ApiTokensApi.md +226 -0
- data/docs/AuthToken.md +13 -0
- data/docs/Document.md +33 -0
- data/docs/DocumentAttachment.md +15 -0
- data/docs/DocumentAttachmentsApi.md +179 -0
- data/docs/DocumentSearch.md +22 -0
- data/docs/DocumentSignerTemplateConf.md +14 -0
- data/docs/DocumentsApi.md +301 -0
- data/docs/DocumentsSearchApi.md +119 -0
- data/docs/Event.md +17 -0
- data/docs/EventsApi.md +145 -0
- data/docs/FileFromSf.md +9 -0
- data/docs/InlineDocumentSignerIntegrationData.md +9 -0
- data/docs/InlineIntegrationData.md +9 -0
- data/docs/InlinePrefillTags.md +11 -0
- data/docs/InlineResponse200.md +11 -0
- data/docs/InlineResponse2001.md +11 -0
- data/docs/InlineResponse2002.md +11 -0
- data/docs/InlineResponse2003.md +11 -0
- data/docs/InlineResponse2004.md +11 -0
- data/docs/InlineResponse2005.md +11 -0
- data/docs/InlineResponse2006.md +11 -0
- data/docs/InlineResponse2007.md +11 -0
- data/docs/InlineResponse2008.md +11 -0
- data/docs/InlineResponse2009.md +11 -0
- data/docs/InlineSignRequest.md +25 -0
- data/docs/InlineTeam.md +10 -0
- data/docs/InlineTeamMember.md +13 -0
- data/docs/InviteMember.md +10 -0
- data/docs/Placeholder.md +15 -0
- data/docs/RequiredAttachment.md +9 -0
- data/docs/SignRequest.md +29 -0
- data/docs/SignRequestQuickCreate.md +42 -0
- data/docs/Signer.md +40 -0
- data/docs/SignerAttachment.md +11 -0
- data/docs/SignerInputs.md +14 -0
- data/docs/SigningLog.md +9 -0
- data/docs/SignrequestQuickCreateApi.md +62 -0
- data/docs/SignrequestsApi.md +291 -0
- data/docs/Team.md +15 -0
- data/docs/TeamMember.md +14 -0
- data/docs/TeamMembersApi.md +131 -0
- data/docs/TeamsApi.md +344 -0
- data/docs/Template.md +14 -0
- data/docs/TemplatesApi.md +119 -0
- data/docs/User.md +11 -0
- data/docs/WebhookSubscription.md +15 -0
- data/docs/WebhooksApi.md +340 -0
- data/git_push.sh +55 -0
- data/lib/signrequest_client/api/api_tokens_api.rb +242 -0
- data/lib/signrequest_client/api/document_attachments_api.rb +197 -0
- data/lib/signrequest_client/api/documents_api.rb +330 -0
- data/lib/signrequest_client/api/documents_search_api.rb +133 -0
- data/lib/signrequest_client/api/events_api.rb +172 -0
- data/lib/signrequest_client/api/signrequest_quick_create_api.rb +78 -0
- data/lib/signrequest_client/api/signrequests_api.rb +316 -0
- data/lib/signrequest_client/api/team_members_api.rb +151 -0
- data/lib/signrequest_client/api/teams_api.rb +371 -0
- data/lib/signrequest_client/api/templates_api.rb +133 -0
- data/lib/signrequest_client/api/webhooks_api.rb +364 -0
- data/lib/signrequest_client/api_client.rb +389 -0
- data/lib/signrequest_client/api_error.rb +38 -0
- data/lib/signrequest_client/configuration.rb +209 -0
- data/lib/signrequest_client/models/auth_token.rb +298 -0
- data/lib/signrequest_client/models/document.rb +605 -0
- data/lib/signrequest_client/models/document_attachment.rb +304 -0
- data/lib/signrequest_client/models/document_search.rb +519 -0
- data/lib/signrequest_client/models/document_signer_template_conf.rb +294 -0
- data/lib/signrequest_client/models/event.rb +330 -0
- data/lib/signrequest_client/models/file_from_sf.rb +245 -0
- data/lib/signrequest_client/models/inline_document_signer_integration_data.rb +230 -0
- data/lib/signrequest_client/models/inline_integration_data.rb +230 -0
- data/lib/signrequest_client/models/inline_prefill_tags.rb +231 -0
- data/lib/signrequest_client/models/inline_response_200.rb +227 -0
- data/lib/signrequest_client/models/inline_response_200_1.rb +227 -0
- data/lib/signrequest_client/models/inline_response_200_2.rb +227 -0
- data/lib/signrequest_client/models/inline_response_200_3.rb +227 -0
- data/lib/signrequest_client/models/inline_response_200_4.rb +227 -0
- data/lib/signrequest_client/models/inline_response_200_5.rb +227 -0
- data/lib/signrequest_client/models/inline_response_200_6.rb +227 -0
- data/lib/signrequest_client/models/inline_response_200_7.rb +227 -0
- data/lib/signrequest_client/models/inline_response_200_8.rb +227 -0
- data/lib/signrequest_client/models/inline_response_200_9.rb +227 -0
- data/lib/signrequest_client/models/inline_sign_request.rb +496 -0
- data/lib/signrequest_client/models/inline_team.rb +247 -0
- data/lib/signrequest_client/models/inline_team_member.rb +249 -0
- data/lib/signrequest_client/models/invite_member.rb +234 -0
- data/lib/signrequest_client/models/placeholder.rb +326 -0
- data/lib/signrequest_client/models/required_attachment.rb +246 -0
- data/lib/signrequest_client/models/sign_request.rb +543 -0
- data/lib/signrequest_client/models/sign_request_quick_create.rb +764 -0
- data/lib/signrequest_client/models/signer.rb +751 -0
- data/lib/signrequest_client/models/signer_attachment.rb +247 -0
- data/lib/signrequest_client/models/signer_inputs.rb +312 -0
- data/lib/signrequest_client/models/signing_log.rb +213 -0
- data/lib/signrequest_client/models/team.rb +367 -0
- data/lib/signrequest_client/models/team_member.rb +258 -0
- data/lib/signrequest_client/models/template.rb +309 -0
- data/lib/signrequest_client/models/user.rb +296 -0
- data/lib/signrequest_client/models/webhook_subscription.rb +366 -0
- data/lib/signrequest_client/version.rb +15 -0
- data/lib/signrequest_client.rb +87 -0
- data/pkg/signrequest_client-0.1.0.gem +0 -0
- data/signrequest_client.gemspec +45 -0
- data/signrequst_client/.git/HEAD +1 -0
- data/signrequst_client/.git/config +7 -0
- data/signrequst_client/.git/description +1 -0
- data/signrequst_client/.git/hooks/applypatch-msg.sample +15 -0
- data/signrequst_client/.git/hooks/commit-msg.sample +24 -0
- data/signrequst_client/.git/hooks/fsmonitor-watchman.sample +114 -0
- data/signrequst_client/.git/hooks/post-update.sample +8 -0
- data/signrequst_client/.git/hooks/pre-applypatch.sample +14 -0
- data/signrequst_client/.git/hooks/pre-commit.sample +49 -0
- data/signrequst_client/.git/hooks/pre-push.sample +53 -0
- data/signrequst_client/.git/hooks/pre-rebase.sample +169 -0
- data/signrequst_client/.git/hooks/pre-receive.sample +24 -0
- data/signrequst_client/.git/hooks/prepare-commit-msg.sample +42 -0
- data/signrequst_client/.git/hooks/update.sample +128 -0
- data/signrequst_client/.git/index +0 -0
- data/signrequst_client/.git/info/exclude +6 -0
- data/signrequst_client/.git/objects/30/68cc8a074ffc0c7b8891cb21d68b5d367cb8c4 +0 -0
- data/signrequst_client/.git/objects/32/c4b7e9f988621ed2ce28954f1aaf088f340848 +2 -0
- data/signrequst_client/.git/objects/3e/8c4c2f8d1d5334612f3072160124e985f27e8c +0 -0
- data/signrequst_client/.git/objects/43/022f711e20ed55baf2470278eb8e428a04856f +0 -0
- data/signrequst_client/.git/objects/6f/8caa83dfb6dc8a987a2829cbfefae18c8870c3 +0 -0
- data/signrequst_client/.git/objects/91/06b2a345b019a799c02e5069affa88370b35dd +0 -0
- data/signrequst_client/.git/objects/aa/58e53f733551ac2bde6f7a50b5a9f16ddbf110 +0 -0
- data/signrequst_client/.git/objects/dc/e67d860af47a4eb630117ce03624bae45dcf26 +3 -0
- data/signrequst_client/.git/objects/f1/c9171bed4c19fd22429ffd68d4cbb2c3ce2fce +0 -0
- data/signrequst_client/.git/objects/f8/e4c2573ebc57d5a365ebe14d5c18cc8d0716c4 +0 -0
- data/spec/api/api_tokens_api_spec.rb +84 -0
- data/spec/api/document_attachments_api_spec.rb +75 -0
- data/spec/api/documents_api_spec.rb +106 -0
- data/spec/api/documents_search_api_spec.rb +60 -0
- data/spec/api/events_api_spec.rb +73 -0
- data/spec/api/signrequest_quick_create_api_spec.rb +47 -0
- data/spec/api/signrequests_api_spec.rb +100 -0
- data/spec/api/team_members_api_spec.rb +66 -0
- data/spec/api/teams_api_spec.rb +111 -0
- data/spec/api/templates_api_spec.rb +60 -0
- data/spec/api/webhooks_api_spec.rb +110 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/auth_token_spec.rb +72 -0
- data/spec/models/document_attachment_spec.rb +84 -0
- data/spec/models/document_search_spec.rb +126 -0
- data/spec/models/document_signer_template_conf_spec.rb +78 -0
- data/spec/models/document_spec.rb +196 -0
- data/spec/models/event_spec.rb +104 -0
- data/spec/models/file_from_sf_spec.rb +48 -0
- data/spec/models/inline_document_signer_integration_data_spec.rb +52 -0
- data/spec/models/inline_integration_data_spec.rb +52 -0
- data/spec/models/inline_prefill_tags_spec.rb +60 -0
- data/spec/models/inline_response_200_1_spec.rb +60 -0
- data/spec/models/inline_response_200_2_spec.rb +60 -0
- data/spec/models/inline_response_200_3_spec.rb +60 -0
- data/spec/models/inline_response_200_4_spec.rb +60 -0
- data/spec/models/inline_response_200_5_spec.rb +60 -0
- data/spec/models/inline_response_200_6_spec.rb +60 -0
- data/spec/models/inline_response_200_7_spec.rb +60 -0
- data/spec/models/inline_response_200_8_spec.rb +60 -0
- data/spec/models/inline_response_200_9_spec.rb +60 -0
- data/spec/models/inline_response_200_spec.rb +60 -0
- data/spec/models/inline_sign_request_spec.rb +148 -0
- data/spec/models/inline_team_member_spec.rb +72 -0
- data/spec/models/inline_team_spec.rb +54 -0
- data/spec/models/invite_member_spec.rb +54 -0
- data/spec/models/placeholder_spec.rb +88 -0
- data/spec/models/required_attachment_spec.rb +48 -0
- data/spec/models/sign_request_quick_create_spec.rb +254 -0
- data/spec/models/sign_request_spec.rb +176 -0
- data/spec/models/signer_attachment_spec.rb +60 -0
- data/spec/models/signer_inputs_spec.rb +82 -0
- data/spec/models/signer_spec.rb +238 -0
- data/spec/models/signing_log_spec.rb +48 -0
- data/spec/models/team_member_spec.rb +78 -0
- data/spec/models/team_spec.rb +84 -0
- data/spec/models/template_spec.rb +82 -0
- data/spec/models/user_spec.rb +60 -0
- data/spec/models/webhook_subscription_spec.rb +92 -0
- data/spec/spec_helper.rb +111 -0
- metadata +461 -0
|
@@ -0,0 +1,296 @@
|
|
|
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 User
|
|
18
|
+
attr_accessor :email
|
|
19
|
+
|
|
20
|
+
attr_accessor :first_name
|
|
21
|
+
|
|
22
|
+
attr_accessor :last_name
|
|
23
|
+
|
|
24
|
+
attr_accessor :display_name
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
|
+
def self.attribute_map
|
|
29
|
+
{
|
|
30
|
+
:'email' => :'email',
|
|
31
|
+
:'first_name' => :'first_name',
|
|
32
|
+
:'last_name' => :'last_name',
|
|
33
|
+
:'display_name' => :'display_name'
|
|
34
|
+
}
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Attribute type mapping.
|
|
38
|
+
def self.swagger_types
|
|
39
|
+
{
|
|
40
|
+
:'email' => :'String',
|
|
41
|
+
:'first_name' => :'String',
|
|
42
|
+
:'last_name' => :'String',
|
|
43
|
+
:'display_name' => :'String'
|
|
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?(:'email')
|
|
56
|
+
self.email = attributes[:'email']
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
if attributes.has_key?(:'first_name')
|
|
60
|
+
self.first_name = attributes[:'first_name']
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
if attributes.has_key?(:'last_name')
|
|
64
|
+
self.last_name = attributes[:'last_name']
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
if attributes.has_key?(:'display_name')
|
|
68
|
+
self.display_name = attributes[:'display_name']
|
|
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 @email.nil?
|
|
78
|
+
invalid_properties.push("invalid value for 'email', email cannot be nil.")
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
if @email.to_s.length > 254
|
|
82
|
+
invalid_properties.push("invalid value for 'email', the character length must be smaller than or equal to 254.")
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
if @email.to_s.length < 1
|
|
86
|
+
invalid_properties.push("invalid value for 'email', the character length must be great than or equal to 1.")
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if !@first_name.nil? && @first_name.to_s.length > 255
|
|
90
|
+
invalid_properties.push("invalid value for 'first_name', the character length must be smaller than or equal to 255.")
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
if !@last_name.nil? && @last_name.to_s.length > 255
|
|
94
|
+
invalid_properties.push("invalid value for 'last_name', the character length must be smaller than or equal to 255.")
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
if !@display_name.nil? && @display_name.to_s.length < 1
|
|
98
|
+
invalid_properties.push("invalid value for 'display_name', the character length must be great than or equal to 1.")
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
return invalid_properties
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Check to see if the all the properties in the model are valid
|
|
105
|
+
# @return true if the model is valid
|
|
106
|
+
def valid?
|
|
107
|
+
return false if @email.nil?
|
|
108
|
+
return false if @email.to_s.length > 254
|
|
109
|
+
return false if @email.to_s.length < 1
|
|
110
|
+
return false if !@first_name.nil? && @first_name.to_s.length > 255
|
|
111
|
+
return false if !@last_name.nil? && @last_name.to_s.length > 255
|
|
112
|
+
return false if !@display_name.nil? && @display_name.to_s.length < 1
|
|
113
|
+
return true
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Custom attribute writer method with validation
|
|
117
|
+
# @param [Object] email Value to be assigned
|
|
118
|
+
def email=(email)
|
|
119
|
+
if email.nil?
|
|
120
|
+
fail ArgumentError, "email cannot be nil"
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
if email.to_s.length > 254
|
|
124
|
+
fail ArgumentError, "invalid value for 'email', the character length must be smaller than or equal to 254."
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if email.to_s.length < 1
|
|
128
|
+
fail ArgumentError, "invalid value for 'email', the character length must be great than or equal to 1."
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
@email = email
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Custom attribute writer method with validation
|
|
135
|
+
# @param [Object] first_name Value to be assigned
|
|
136
|
+
def first_name=(first_name)
|
|
137
|
+
|
|
138
|
+
if !first_name.nil? && first_name.to_s.length > 255
|
|
139
|
+
fail ArgumentError, "invalid value for 'first_name', the character length must be smaller than or equal to 255."
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
@first_name = first_name
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Custom attribute writer method with validation
|
|
146
|
+
# @param [Object] last_name Value to be assigned
|
|
147
|
+
def last_name=(last_name)
|
|
148
|
+
|
|
149
|
+
if !last_name.nil? && last_name.to_s.length > 255
|
|
150
|
+
fail ArgumentError, "invalid value for 'last_name', the character length must be smaller than or equal to 255."
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
@last_name = last_name
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Custom attribute writer method with validation
|
|
157
|
+
# @param [Object] display_name Value to be assigned
|
|
158
|
+
def display_name=(display_name)
|
|
159
|
+
|
|
160
|
+
if !display_name.nil? && display_name.to_s.length < 1
|
|
161
|
+
fail ArgumentError, "invalid value for 'display_name', the character length must be great than or equal to 1."
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
@display_name = display_name
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Checks equality by comparing each attribute.
|
|
168
|
+
# @param [Object] Object to be compared
|
|
169
|
+
def ==(o)
|
|
170
|
+
return true if self.equal?(o)
|
|
171
|
+
self.class == o.class &&
|
|
172
|
+
email == o.email &&
|
|
173
|
+
first_name == o.first_name &&
|
|
174
|
+
last_name == o.last_name &&
|
|
175
|
+
display_name == o.display_name
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# @see the `==` method
|
|
179
|
+
# @param [Object] Object to be compared
|
|
180
|
+
def eql?(o)
|
|
181
|
+
self == o
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Calculates hash code according to all attributes.
|
|
185
|
+
# @return [Fixnum] Hash code
|
|
186
|
+
def hash
|
|
187
|
+
[email, first_name, last_name, display_name].hash
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Builds the object from hash
|
|
191
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
192
|
+
# @return [Object] Returns the model itself
|
|
193
|
+
def build_from_hash(attributes)
|
|
194
|
+
return nil unless attributes.is_a?(Hash)
|
|
195
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
196
|
+
if type =~ /\AArray<(.*)>/i
|
|
197
|
+
# check to ensure the input is an array given that the the attribute
|
|
198
|
+
# is documented as an array but the input is not
|
|
199
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
200
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
|
201
|
+
end
|
|
202
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
203
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
204
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
self
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Deserializes the data based on type
|
|
211
|
+
# @param string type Data type
|
|
212
|
+
# @param string value Value to be deserialized
|
|
213
|
+
# @return [Object] Deserialized data
|
|
214
|
+
def _deserialize(type, value)
|
|
215
|
+
case type.to_sym
|
|
216
|
+
when :DateTime
|
|
217
|
+
DateTime.parse(value)
|
|
218
|
+
when :Date
|
|
219
|
+
Date.parse(value)
|
|
220
|
+
when :String
|
|
221
|
+
value.to_s
|
|
222
|
+
when :Integer
|
|
223
|
+
value.to_i
|
|
224
|
+
when :Float
|
|
225
|
+
value.to_f
|
|
226
|
+
when :BOOLEAN
|
|
227
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
228
|
+
true
|
|
229
|
+
else
|
|
230
|
+
false
|
|
231
|
+
end
|
|
232
|
+
when :Object
|
|
233
|
+
# generic object (usually a Hash), return directly
|
|
234
|
+
value
|
|
235
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
236
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
237
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
238
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
239
|
+
k_type = Regexp.last_match[:k_type]
|
|
240
|
+
v_type = Regexp.last_match[:v_type]
|
|
241
|
+
{}.tap do |hash|
|
|
242
|
+
value.each do |k, v|
|
|
243
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
244
|
+
end
|
|
245
|
+
end
|
|
246
|
+
else # model
|
|
247
|
+
temp_model = SignRequestClient.const_get(type).new
|
|
248
|
+
temp_model.build_from_hash(value)
|
|
249
|
+
end
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
# Returns the string representation of the object
|
|
253
|
+
# @return [String] String presentation of the object
|
|
254
|
+
def to_s
|
|
255
|
+
to_hash.to_s
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
259
|
+
# @return [Hash] Returns the object in the form of hash
|
|
260
|
+
def to_body
|
|
261
|
+
to_hash
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
# Returns the object in the form of hash
|
|
265
|
+
# @return [Hash] Returns the object in the form of hash
|
|
266
|
+
def to_hash
|
|
267
|
+
hash = {}
|
|
268
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
269
|
+
value = self.send(attr)
|
|
270
|
+
next if value.nil?
|
|
271
|
+
hash[param] = _to_hash(value)
|
|
272
|
+
end
|
|
273
|
+
hash
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
# Outputs non-array value in the form of hash
|
|
277
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
278
|
+
# @param [Object] value Any valid value
|
|
279
|
+
# @return [Hash] Returns the value in the form of hash
|
|
280
|
+
def _to_hash(value)
|
|
281
|
+
if value.is_a?(Array)
|
|
282
|
+
value.compact.map{ |v| _to_hash(v) }
|
|
283
|
+
elsif value.is_a?(Hash)
|
|
284
|
+
{}.tap do |hash|
|
|
285
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
286
|
+
end
|
|
287
|
+
elsif value.respond_to? :to_hash
|
|
288
|
+
value.to_hash
|
|
289
|
+
else
|
|
290
|
+
value
|
|
291
|
+
end
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
end
|
|
@@ -0,0 +1,366 @@
|
|
|
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 WebhookSubscription
|
|
18
|
+
attr_accessor :url
|
|
19
|
+
|
|
20
|
+
attr_accessor :uuid
|
|
21
|
+
|
|
22
|
+
attr_accessor :name
|
|
23
|
+
|
|
24
|
+
attr_accessor :event_type
|
|
25
|
+
|
|
26
|
+
attr_accessor :callback_url
|
|
27
|
+
|
|
28
|
+
attr_accessor :integration
|
|
29
|
+
|
|
30
|
+
attr_accessor :team
|
|
31
|
+
|
|
32
|
+
attr_accessor :created
|
|
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
|
+
:'url' => :'url',
|
|
60
|
+
:'uuid' => :'uuid',
|
|
61
|
+
:'name' => :'name',
|
|
62
|
+
:'event_type' => :'event_type',
|
|
63
|
+
:'callback_url' => :'callback_url',
|
|
64
|
+
:'integration' => :'integration',
|
|
65
|
+
:'team' => :'team',
|
|
66
|
+
:'created' => :'created'
|
|
67
|
+
}
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Attribute type mapping.
|
|
71
|
+
def self.swagger_types
|
|
72
|
+
{
|
|
73
|
+
:'url' => :'String',
|
|
74
|
+
:'uuid' => :'String',
|
|
75
|
+
:'name' => :'String',
|
|
76
|
+
:'event_type' => :'String',
|
|
77
|
+
:'callback_url' => :'String',
|
|
78
|
+
:'integration' => :'String',
|
|
79
|
+
:'team' => :'InlineTeam',
|
|
80
|
+
:'created' => :'DateTime'
|
|
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?(:'url')
|
|
93
|
+
self.url = attributes[:'url']
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if attributes.has_key?(:'uuid')
|
|
97
|
+
self.uuid = attributes[:'uuid']
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes.has_key?(:'name')
|
|
101
|
+
self.name = attributes[:'name']
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes.has_key?(:'event_type')
|
|
105
|
+
self.event_type = attributes[:'event_type']
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.has_key?(:'callback_url')
|
|
109
|
+
self.callback_url = attributes[:'callback_url']
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.has_key?(:'integration')
|
|
113
|
+
self.integration = attributes[:'integration']
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes.has_key?(:'team')
|
|
117
|
+
self.team = attributes[:'team']
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.has_key?(:'created')
|
|
121
|
+
self.created = attributes[:'created']
|
|
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 !@name.nil? && @name.to_s.length > 255
|
|
135
|
+
invalid_properties.push("invalid value for 'name', the character length must be smaller than or equal to 255.")
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if @event_type.nil?
|
|
139
|
+
invalid_properties.push("invalid value for 'event_type', event_type cannot be nil.")
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if @callback_url.nil?
|
|
143
|
+
invalid_properties.push("invalid value for 'callback_url', callback_url cannot be nil.")
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if @callback_url.to_s.length > 2100
|
|
147
|
+
invalid_properties.push("invalid value for 'callback_url', the character length must be smaller than or equal to 2100.")
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
if @callback_url.to_s.length < 1
|
|
151
|
+
invalid_properties.push("invalid value for 'callback_url', the character length must be great than or equal to 1.")
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
return invalid_properties
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Check to see if the all the properties in the model are valid
|
|
158
|
+
# @return true if the model is valid
|
|
159
|
+
def valid?
|
|
160
|
+
return false if !@uuid.nil? && @uuid.to_s.length < 1
|
|
161
|
+
return false if !@name.nil? && @name.to_s.length > 255
|
|
162
|
+
return false if @event_type.nil?
|
|
163
|
+
event_type_validator = EnumAttributeValidator.new('String', ["convert_error", "converted", "sending_error", "sent", "declined", "cancelled", "signed", "viewed", "downloaded", "signer_signed", "signer_email_bounced", "signer_viewed_email", "signer_viewed", "signer_forwarded", "signer_downloaded", "signrequest_received"])
|
|
164
|
+
return false unless event_type_validator.valid?(@event_type)
|
|
165
|
+
return false if @callback_url.nil?
|
|
166
|
+
return false if @callback_url.to_s.length > 2100
|
|
167
|
+
return false if @callback_url.to_s.length < 1
|
|
168
|
+
integration_validator = EnumAttributeValidator.new('String', ["mfiles", "salesforce", "formdesk", "zapier", "txhash"])
|
|
169
|
+
return false unless integration_validator.valid?(@integration)
|
|
170
|
+
return true
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Custom attribute writer method with validation
|
|
174
|
+
# @param [Object] uuid Value to be assigned
|
|
175
|
+
def uuid=(uuid)
|
|
176
|
+
|
|
177
|
+
if !uuid.nil? && uuid.to_s.length < 1
|
|
178
|
+
fail ArgumentError, "invalid value for 'uuid', the character length must be great than or equal to 1."
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
@uuid = uuid
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Custom attribute writer method with validation
|
|
185
|
+
# @param [Object] name Value to be assigned
|
|
186
|
+
def name=(name)
|
|
187
|
+
|
|
188
|
+
if !name.nil? && name.to_s.length > 255
|
|
189
|
+
fail ArgumentError, "invalid value for 'name', the character length must be smaller than or equal to 255."
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
@name = name
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
196
|
+
# @param [Object] event_type Object to be assigned
|
|
197
|
+
def event_type=(event_type)
|
|
198
|
+
validator = EnumAttributeValidator.new('String', ["convert_error", "converted", "sending_error", "sent", "declined", "cancelled", "signed", "viewed", "downloaded", "signer_signed", "signer_email_bounced", "signer_viewed_email", "signer_viewed", "signer_forwarded", "signer_downloaded", "signrequest_received"])
|
|
199
|
+
unless validator.valid?(event_type)
|
|
200
|
+
fail ArgumentError, "invalid value for 'event_type', must be one of #{validator.allowable_values}."
|
|
201
|
+
end
|
|
202
|
+
@event_type = event_type
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Custom attribute writer method with validation
|
|
206
|
+
# @param [Object] callback_url Value to be assigned
|
|
207
|
+
def callback_url=(callback_url)
|
|
208
|
+
if callback_url.nil?
|
|
209
|
+
fail ArgumentError, "callback_url cannot be nil"
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
if callback_url.to_s.length > 2100
|
|
213
|
+
fail ArgumentError, "invalid value for 'callback_url', the character length must be smaller than or equal to 2100."
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
if callback_url.to_s.length < 1
|
|
217
|
+
fail ArgumentError, "invalid value for 'callback_url', the character length must be great than or equal to 1."
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
@callback_url = callback_url
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
224
|
+
# @param [Object] integration Object to be assigned
|
|
225
|
+
def integration=(integration)
|
|
226
|
+
validator = EnumAttributeValidator.new('String', ["mfiles", "salesforce", "formdesk", "zapier", "txhash"])
|
|
227
|
+
unless validator.valid?(integration)
|
|
228
|
+
fail ArgumentError, "invalid value for 'integration', must be one of #{validator.allowable_values}."
|
|
229
|
+
end
|
|
230
|
+
@integration = integration
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
# Checks equality by comparing each attribute.
|
|
234
|
+
# @param [Object] Object to be compared
|
|
235
|
+
def ==(o)
|
|
236
|
+
return true if self.equal?(o)
|
|
237
|
+
self.class == o.class &&
|
|
238
|
+
url == o.url &&
|
|
239
|
+
uuid == o.uuid &&
|
|
240
|
+
name == o.name &&
|
|
241
|
+
event_type == o.event_type &&
|
|
242
|
+
callback_url == o.callback_url &&
|
|
243
|
+
integration == o.integration &&
|
|
244
|
+
team == o.team &&
|
|
245
|
+
created == o.created
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# @see the `==` method
|
|
249
|
+
# @param [Object] Object to be compared
|
|
250
|
+
def eql?(o)
|
|
251
|
+
self == o
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# Calculates hash code according to all attributes.
|
|
255
|
+
# @return [Fixnum] Hash code
|
|
256
|
+
def hash
|
|
257
|
+
[url, uuid, name, event_type, callback_url, integration, team, created].hash
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
# Builds the object from hash
|
|
261
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
262
|
+
# @return [Object] Returns the model itself
|
|
263
|
+
def build_from_hash(attributes)
|
|
264
|
+
return nil unless attributes.is_a?(Hash)
|
|
265
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
266
|
+
if type =~ /\AArray<(.*)>/i
|
|
267
|
+
# check to ensure the input is an array given that the the attribute
|
|
268
|
+
# is documented as an array but the input is not
|
|
269
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
270
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
|
271
|
+
end
|
|
272
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
273
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
274
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
self
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
# Deserializes the data based on type
|
|
281
|
+
# @param string type Data type
|
|
282
|
+
# @param string value Value to be deserialized
|
|
283
|
+
# @return [Object] Deserialized data
|
|
284
|
+
def _deserialize(type, value)
|
|
285
|
+
case type.to_sym
|
|
286
|
+
when :DateTime
|
|
287
|
+
DateTime.parse(value)
|
|
288
|
+
when :Date
|
|
289
|
+
Date.parse(value)
|
|
290
|
+
when :String
|
|
291
|
+
value.to_s
|
|
292
|
+
when :Integer
|
|
293
|
+
value.to_i
|
|
294
|
+
when :Float
|
|
295
|
+
value.to_f
|
|
296
|
+
when :BOOLEAN
|
|
297
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
298
|
+
true
|
|
299
|
+
else
|
|
300
|
+
false
|
|
301
|
+
end
|
|
302
|
+
when :Object
|
|
303
|
+
# generic object (usually a Hash), return directly
|
|
304
|
+
value
|
|
305
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
306
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
307
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
308
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
309
|
+
k_type = Regexp.last_match[:k_type]
|
|
310
|
+
v_type = Regexp.last_match[:v_type]
|
|
311
|
+
{}.tap do |hash|
|
|
312
|
+
value.each do |k, v|
|
|
313
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
314
|
+
end
|
|
315
|
+
end
|
|
316
|
+
else # model
|
|
317
|
+
temp_model = SignRequestClient.const_get(type).new
|
|
318
|
+
temp_model.build_from_hash(value)
|
|
319
|
+
end
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
# Returns the string representation of the object
|
|
323
|
+
# @return [String] String presentation of the object
|
|
324
|
+
def to_s
|
|
325
|
+
to_hash.to_s
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
329
|
+
# @return [Hash] Returns the object in the form of hash
|
|
330
|
+
def to_body
|
|
331
|
+
to_hash
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
# Returns the object in the form of hash
|
|
335
|
+
# @return [Hash] Returns the object in the form of hash
|
|
336
|
+
def to_hash
|
|
337
|
+
hash = {}
|
|
338
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
339
|
+
value = self.send(attr)
|
|
340
|
+
next if value.nil?
|
|
341
|
+
hash[param] = _to_hash(value)
|
|
342
|
+
end
|
|
343
|
+
hash
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
# Outputs non-array value in the form of hash
|
|
347
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
348
|
+
# @param [Object] value Any valid value
|
|
349
|
+
# @return [Hash] Returns the value in the form of hash
|
|
350
|
+
def _to_hash(value)
|
|
351
|
+
if value.is_a?(Array)
|
|
352
|
+
value.compact.map{ |v| _to_hash(v) }
|
|
353
|
+
elsif value.is_a?(Hash)
|
|
354
|
+
{}.tap do |hash|
|
|
355
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
356
|
+
end
|
|
357
|
+
elsif value.respond_to? :to_hash
|
|
358
|
+
value.to_hash
|
|
359
|
+
else
|
|
360
|
+
value
|
|
361
|
+
end
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
module SignRequestClient
|
|
14
|
+
VERSION = "0.1.0"
|
|
15
|
+
end
|