docusign_webforms 1.0.2.rc12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +34 -0
- data/Gemfile +7 -0
- data/README.md +131 -0
- data/Rakefile +8 -0
- data/docusign_webforms.gemspec +48 -0
- data/lib/docusign_webforms/api/form_instance_management_api.rb +272 -0
- data/lib/docusign_webforms/api/form_management_api.rb +192 -0
- data/lib/docusign_webforms/client/api_client.rb +600 -0
- data/lib/docusign_webforms/client/api_error.rb +37 -0
- data/lib/docusign_webforms/client/auth/oauth.rb +1061 -0
- data/lib/docusign_webforms/configuration.rb +203 -0
- data/lib/docusign_webforms/models/account_id.rb +175 -0
- data/lib/docusign_webforms/models/assertion_id.rb +175 -0
- data/lib/docusign_webforms/models/authentication_instant.rb +175 -0
- data/lib/docusign_webforms/models/authentication_method.rb +175 -0
- data/lib/docusign_webforms/models/brand_id.rb +175 -0
- data/lib/docusign_webforms/models/client_user_id.rb +175 -0
- data/lib/docusign_webforms/models/component_key.rb +174 -0
- data/lib/docusign_webforms/models/count.rb +175 -0
- data/lib/docusign_webforms/models/create_instance_request_body.rb +264 -0
- data/lib/docusign_webforms/models/created_date_time.rb +175 -0
- data/lib/docusign_webforms/models/date_time.rb +174 -0
- data/lib/docusign_webforms/models/envelope_id.rb +175 -0
- data/lib/docusign_webforms/models/expiration_date_time.rb +175 -0
- data/lib/docusign_webforms/models/expiration_offset.rb +175 -0
- data/lib/docusign_webforms/models/form_sort_by.rb +175 -0
- data/lib/docusign_webforms/models/form_url.rb +175 -0
- data/lib/docusign_webforms/models/guid.rb +174 -0
- data/lib/docusign_webforms/models/http_error.rb +195 -0
- data/lib/docusign_webforms/models/http_success.rb +184 -0
- data/lib/docusign_webforms/models/instance_id.rb +175 -0
- data/lib/docusign_webforms/models/instance_source.rb +31 -0
- data/lib/docusign_webforms/models/instance_status.rb +31 -0
- data/lib/docusign_webforms/models/instance_token.rb +175 -0
- data/lib/docusign_webforms/models/is_private_access.rb +175 -0
- data/lib/docusign_webforms/models/is_published.rb +175 -0
- data/lib/docusign_webforms/models/is_standalone.rb +175 -0
- data/lib/docusign_webforms/models/last_modified_date_time.rb +175 -0
- data/lib/docusign_webforms/models/return_url.rb +175 -0
- data/lib/docusign_webforms/models/search_text.rb +175 -0
- data/lib/docusign_webforms/models/security_domain.rb +175 -0
- data/lib/docusign_webforms/models/source.rb +31 -0
- data/lib/docusign_webforms/models/start_position.rb +175 -0
- data/lib/docusign_webforms/models/tags.rb +175 -0
- data/lib/docusign_webforms/models/template_properties.rb +217 -0
- data/lib/docusign_webforms/models/token_expiration_date_time.rb +175 -0
- data/lib/docusign_webforms/models/update_instance_request_body.rb +184 -0
- data/lib/docusign_webforms/models/user_filter.rb +30 -0
- data/lib/docusign_webforms/models/user_id.rb +175 -0
- data/lib/docusign_webforms/models/web_form.rb +268 -0
- data/lib/docusign_webforms/models/web_form_adm_type.rb +39 -0
- data/lib/docusign_webforms/models/web_form_component.rb +248 -0
- data/lib/docusign_webforms/models/web_form_component_type.rb +34 -0
- data/lib/docusign_webforms/models/web_form_components_map.rb +175 -0
- data/lib/docusign_webforms/models/web_form_content.rb +217 -0
- data/lib/docusign_webforms/models/web_form_id.rb +175 -0
- data/lib/docusign_webforms/models/web_form_instance.rb +295 -0
- data/lib/docusign_webforms/models/web_form_instance_envelopes.rb +183 -0
- data/lib/docusign_webforms/models/web_form_instance_list.rb +187 -0
- data/lib/docusign_webforms/models/web_form_instance_metadata.rb +237 -0
- data/lib/docusign_webforms/models/web_form_metadata.rb +377 -0
- data/lib/docusign_webforms/models/web_form_name.rb +175 -0
- data/lib/docusign_webforms/models/web_form_properties.rb +193 -0
- data/lib/docusign_webforms/models/web_form_published_names.rb +175 -0
- data/lib/docusign_webforms/models/web_form_source.rb +29 -0
- data/lib/docusign_webforms/models/web_form_state.rb +29 -0
- data/lib/docusign_webforms/models/web_form_summary.rb +250 -0
- data/lib/docusign_webforms/models/web_form_summary_list.rb +247 -0
- data/lib/docusign_webforms/models/web_form_user_info.rb +209 -0
- data/lib/docusign_webforms/models/web_form_values.rb +175 -0
- data/lib/docusign_webforms/models/web_form_version_id.rb +175 -0
- data/lib/docusign_webforms/version.rb +14 -0
- data/lib/docusign_webforms.rb +64 -0
- data/runLinter.sh +1 -0
- data/tests/Gemfile +5 -0
- data/tests/spec/unit_tests_using_jwt_spec.rb +38 -0
- metadata +382 -0
@@ -0,0 +1,175 @@
|
|
1
|
+
=begin
|
2
|
+
#Web Forms API version 1.1
|
3
|
+
|
4
|
+
#The Web Forms API facilitates generating semantic HTML forms around everyday contracts.
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.1.0
|
7
|
+
Contact: devcenter@docusign.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
=end
|
11
|
+
|
12
|
+
require 'date'
|
13
|
+
|
14
|
+
module DocuSign_WebForms
|
15
|
+
# User friendly Form name. This can be set via UI and/or API.
|
16
|
+
class WebFormName
|
17
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
18
|
+
def self.attribute_map
|
19
|
+
{
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
# Attribute type mapping.
|
24
|
+
def self.swagger_types
|
25
|
+
{
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
# Initializes the object
|
30
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
31
|
+
def initialize(attributes = {})
|
32
|
+
return unless attributes.is_a?(Hash)
|
33
|
+
|
34
|
+
# convert string to symbol for hash key
|
35
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
36
|
+
end
|
37
|
+
|
38
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
39
|
+
# @return Array for valid properties with the reasons
|
40
|
+
def list_invalid_properties
|
41
|
+
invalid_properties = Array.new
|
42
|
+
invalid_properties
|
43
|
+
end
|
44
|
+
|
45
|
+
# Check to see if the all the properties in the model are valid
|
46
|
+
# @return true if the model is valid
|
47
|
+
def valid?
|
48
|
+
true
|
49
|
+
end
|
50
|
+
|
51
|
+
# Checks equality by comparing each attribute.
|
52
|
+
# @param [Object] Object to be compared
|
53
|
+
def ==(o)
|
54
|
+
return true if self.equal?(o)
|
55
|
+
self.class == o.class
|
56
|
+
end
|
57
|
+
|
58
|
+
# @see the `==` method
|
59
|
+
# @param [Object] Object to be compared
|
60
|
+
def eql?(o)
|
61
|
+
self == o
|
62
|
+
end
|
63
|
+
|
64
|
+
# Calculates hash code according to all attributes.
|
65
|
+
# @return [Fixnum] Hash code
|
66
|
+
def hash
|
67
|
+
[].hash
|
68
|
+
end
|
69
|
+
|
70
|
+
# Builds the object from hash
|
71
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
72
|
+
# @return [Object] Returns the model itself
|
73
|
+
def build_from_hash(attributes)
|
74
|
+
return nil unless attributes.is_a?(Hash)
|
75
|
+
self.class.swagger_types.each_pair do |key, type|
|
76
|
+
if type =~ /\AArray<(.*)>/i
|
77
|
+
# check to ensure the input is an array given that the attribute
|
78
|
+
# is documented as an array but the input is not
|
79
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
80
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
81
|
+
end
|
82
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
83
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
84
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
85
|
+
end
|
86
|
+
|
87
|
+
self
|
88
|
+
end
|
89
|
+
|
90
|
+
# Deserializes the data based on type
|
91
|
+
# @param string type Data type
|
92
|
+
# @param string value Value to be deserialized
|
93
|
+
# @return [Object] Deserialized data
|
94
|
+
def _deserialize(type, value)
|
95
|
+
case type.to_sym
|
96
|
+
when :DateTime
|
97
|
+
DateTime.parse(value)
|
98
|
+
when :Date
|
99
|
+
Date.parse(value)
|
100
|
+
when :String
|
101
|
+
value.to_s
|
102
|
+
when :Integer
|
103
|
+
value.to_i
|
104
|
+
when :Float
|
105
|
+
value.to_f
|
106
|
+
when :BOOLEAN
|
107
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
108
|
+
true
|
109
|
+
else
|
110
|
+
false
|
111
|
+
end
|
112
|
+
when :Object
|
113
|
+
# generic object (usually a Hash), return directly
|
114
|
+
value
|
115
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
116
|
+
inner_type = Regexp.last_match[:inner_type]
|
117
|
+
value.map { |v| _deserialize(inner_type, v) }
|
118
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
119
|
+
k_type = Regexp.last_match[:k_type]
|
120
|
+
v_type = Regexp.last_match[:v_type]
|
121
|
+
{}.tap do |hash|
|
122
|
+
value.each do |k, v|
|
123
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
124
|
+
end
|
125
|
+
end
|
126
|
+
else # model
|
127
|
+
temp_model = DocuSign_WebForms.const_get(type).new
|
128
|
+
temp_model.build_from_hash(value)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
# Returns the string representation of the object
|
133
|
+
# @return [String] String presentation of the object
|
134
|
+
def to_s
|
135
|
+
to_hash.to_s
|
136
|
+
end
|
137
|
+
|
138
|
+
# to_body is an alias to to_hash (backward compatibility)
|
139
|
+
# @return [Hash] Returns the object in the form of hash
|
140
|
+
def to_body
|
141
|
+
to_hash
|
142
|
+
end
|
143
|
+
|
144
|
+
# Returns the object in the form of hash
|
145
|
+
# @return [Hash] Returns the object in the form of hash
|
146
|
+
def to_hash
|
147
|
+
hash = {}
|
148
|
+
self.class.attribute_map.each_pair do |attr, param|
|
149
|
+
value = self.send(attr)
|
150
|
+
next if value.nil?
|
151
|
+
hash[param] = _to_hash(value)
|
152
|
+
end
|
153
|
+
hash
|
154
|
+
end
|
155
|
+
|
156
|
+
# Outputs non-array value in the form of hash
|
157
|
+
# For object, use to_hash. Otherwise, just return the value
|
158
|
+
# @param [Object] value Any valid value
|
159
|
+
# @return [Hash] Returns the value in the form of hash
|
160
|
+
def _to_hash(value)
|
161
|
+
if value.is_a?(Array)
|
162
|
+
value.compact.map { |v| _to_hash(v) }
|
163
|
+
elsif value.is_a?(Hash)
|
164
|
+
{}.tap do |hash|
|
165
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
166
|
+
end
|
167
|
+
elsif value.respond_to? :to_hash
|
168
|
+
value.to_hash
|
169
|
+
else
|
170
|
+
value
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
end
|
175
|
+
end
|
@@ -0,0 +1,193 @@
|
|
1
|
+
=begin
|
2
|
+
#Web Forms API version 1.1
|
3
|
+
|
4
|
+
#The Web Forms API facilitates generating semantic HTML forms around everyday contracts.
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.1.0
|
7
|
+
Contact: devcenter@docusign.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
=end
|
11
|
+
|
12
|
+
require 'date'
|
13
|
+
|
14
|
+
module DocuSign_WebForms
|
15
|
+
# General information about the web form that is consistent across versions
|
16
|
+
class WebFormProperties
|
17
|
+
attr_accessor :name
|
18
|
+
|
19
|
+
attr_accessor :is_private_access
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'name' => :'name',
|
25
|
+
:'is_private_access' => :'isPrivateAccess'
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
# Attribute type mapping.
|
30
|
+
def self.swagger_types
|
31
|
+
{
|
32
|
+
:'name' => :'String',
|
33
|
+
:'is_private_access' => :'BOOLEAN'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Initializes the object
|
38
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
39
|
+
def initialize(attributes = {})
|
40
|
+
return unless attributes.is_a?(Hash)
|
41
|
+
|
42
|
+
# convert string to symbol for hash key
|
43
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
44
|
+
|
45
|
+
if attributes.has_key?(:'name')
|
46
|
+
self.name = attributes[:'name']
|
47
|
+
end
|
48
|
+
|
49
|
+
if attributes.has_key?(:'isPrivateAccess')
|
50
|
+
self.is_private_access = attributes[:'isPrivateAccess']
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
55
|
+
# @return Array for valid properties with the reasons
|
56
|
+
def list_invalid_properties
|
57
|
+
invalid_properties = Array.new
|
58
|
+
invalid_properties
|
59
|
+
end
|
60
|
+
|
61
|
+
# Check to see if the all the properties in the model are valid
|
62
|
+
# @return true if the model is valid
|
63
|
+
def valid?
|
64
|
+
true
|
65
|
+
end
|
66
|
+
|
67
|
+
# Checks equality by comparing each attribute.
|
68
|
+
# @param [Object] Object to be compared
|
69
|
+
def ==(o)
|
70
|
+
return true if self.equal?(o)
|
71
|
+
self.class == o.class &&
|
72
|
+
name == o.name &&
|
73
|
+
is_private_access == o.is_private_access
|
74
|
+
end
|
75
|
+
|
76
|
+
# @see the `==` method
|
77
|
+
# @param [Object] Object to be compared
|
78
|
+
def eql?(o)
|
79
|
+
self == o
|
80
|
+
end
|
81
|
+
|
82
|
+
# Calculates hash code according to all attributes.
|
83
|
+
# @return [Fixnum] Hash code
|
84
|
+
def hash
|
85
|
+
[name, is_private_access].hash
|
86
|
+
end
|
87
|
+
|
88
|
+
# Builds the object from hash
|
89
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
90
|
+
# @return [Object] Returns the model itself
|
91
|
+
def build_from_hash(attributes)
|
92
|
+
return nil unless attributes.is_a?(Hash)
|
93
|
+
self.class.swagger_types.each_pair do |key, type|
|
94
|
+
if type =~ /\AArray<(.*)>/i
|
95
|
+
# check to ensure the input is an array given that the attribute
|
96
|
+
# is documented as an array but the input is not
|
97
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
98
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
99
|
+
end
|
100
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
101
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
102
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
103
|
+
end
|
104
|
+
|
105
|
+
self
|
106
|
+
end
|
107
|
+
|
108
|
+
# Deserializes the data based on type
|
109
|
+
# @param string type Data type
|
110
|
+
# @param string value Value to be deserialized
|
111
|
+
# @return [Object] Deserialized data
|
112
|
+
def _deserialize(type, value)
|
113
|
+
case type.to_sym
|
114
|
+
when :DateTime
|
115
|
+
DateTime.parse(value)
|
116
|
+
when :Date
|
117
|
+
Date.parse(value)
|
118
|
+
when :String
|
119
|
+
value.to_s
|
120
|
+
when :Integer
|
121
|
+
value.to_i
|
122
|
+
when :Float
|
123
|
+
value.to_f
|
124
|
+
when :BOOLEAN
|
125
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
126
|
+
true
|
127
|
+
else
|
128
|
+
false
|
129
|
+
end
|
130
|
+
when :Object
|
131
|
+
# generic object (usually a Hash), return directly
|
132
|
+
value
|
133
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
134
|
+
inner_type = Regexp.last_match[:inner_type]
|
135
|
+
value.map { |v| _deserialize(inner_type, v) }
|
136
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
137
|
+
k_type = Regexp.last_match[:k_type]
|
138
|
+
v_type = Regexp.last_match[:v_type]
|
139
|
+
{}.tap do |hash|
|
140
|
+
value.each do |k, v|
|
141
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
else # model
|
145
|
+
temp_model = DocuSign_WebForms.const_get(type).new
|
146
|
+
temp_model.build_from_hash(value)
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
# Returns the string representation of the object
|
151
|
+
# @return [String] String presentation of the object
|
152
|
+
def to_s
|
153
|
+
to_hash.to_s
|
154
|
+
end
|
155
|
+
|
156
|
+
# to_body is an alias to to_hash (backward compatibility)
|
157
|
+
# @return [Hash] Returns the object in the form of hash
|
158
|
+
def to_body
|
159
|
+
to_hash
|
160
|
+
end
|
161
|
+
|
162
|
+
# Returns the object in the form of hash
|
163
|
+
# @return [Hash] Returns the object in the form of hash
|
164
|
+
def to_hash
|
165
|
+
hash = {}
|
166
|
+
self.class.attribute_map.each_pair do |attr, param|
|
167
|
+
value = self.send(attr)
|
168
|
+
next if value.nil?
|
169
|
+
hash[param] = _to_hash(value)
|
170
|
+
end
|
171
|
+
hash
|
172
|
+
end
|
173
|
+
|
174
|
+
# Outputs non-array value in the form of hash
|
175
|
+
# For object, use to_hash. Otherwise, just return the value
|
176
|
+
# @param [Object] value Any valid value
|
177
|
+
# @return [Hash] Returns the value in the form of hash
|
178
|
+
def _to_hash(value)
|
179
|
+
if value.is_a?(Array)
|
180
|
+
value.compact.map { |v| _to_hash(v) }
|
181
|
+
elsif value.is_a?(Hash)
|
182
|
+
{}.tap do |hash|
|
183
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
184
|
+
end
|
185
|
+
elsif value.respond_to? :to_hash
|
186
|
+
value.to_hash
|
187
|
+
else
|
188
|
+
value
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
end
|
193
|
+
end
|
@@ -0,0 +1,175 @@
|
|
1
|
+
=begin
|
2
|
+
#Web Forms API version 1.1
|
3
|
+
|
4
|
+
#The Web Forms API facilitates generating semantic HTML forms around everyday contracts.
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.1.0
|
7
|
+
Contact: devcenter@docusign.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
=end
|
11
|
+
|
12
|
+
require 'date'
|
13
|
+
|
14
|
+
module DocuSign_WebForms
|
15
|
+
# A collection of the published component name and its corresponding type
|
16
|
+
class WebFormPublishedNames
|
17
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
18
|
+
def self.attribute_map
|
19
|
+
{
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
# Attribute type mapping.
|
24
|
+
def self.swagger_types
|
25
|
+
{
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
# Initializes the object
|
30
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
31
|
+
def initialize(attributes = {})
|
32
|
+
return unless attributes.is_a?(Hash)
|
33
|
+
|
34
|
+
# convert string to symbol for hash key
|
35
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
36
|
+
end
|
37
|
+
|
38
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
39
|
+
# @return Array for valid properties with the reasons
|
40
|
+
def list_invalid_properties
|
41
|
+
invalid_properties = Array.new
|
42
|
+
invalid_properties
|
43
|
+
end
|
44
|
+
|
45
|
+
# Check to see if the all the properties in the model are valid
|
46
|
+
# @return true if the model is valid
|
47
|
+
def valid?
|
48
|
+
true
|
49
|
+
end
|
50
|
+
|
51
|
+
# Checks equality by comparing each attribute.
|
52
|
+
# @param [Object] Object to be compared
|
53
|
+
def ==(o)
|
54
|
+
return true if self.equal?(o)
|
55
|
+
self.class == o.class
|
56
|
+
end
|
57
|
+
|
58
|
+
# @see the `==` method
|
59
|
+
# @param [Object] Object to be compared
|
60
|
+
def eql?(o)
|
61
|
+
self == o
|
62
|
+
end
|
63
|
+
|
64
|
+
# Calculates hash code according to all attributes.
|
65
|
+
# @return [Fixnum] Hash code
|
66
|
+
def hash
|
67
|
+
[].hash
|
68
|
+
end
|
69
|
+
|
70
|
+
# Builds the object from hash
|
71
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
72
|
+
# @return [Object] Returns the model itself
|
73
|
+
def build_from_hash(attributes)
|
74
|
+
return nil unless attributes.is_a?(Hash)
|
75
|
+
self.class.swagger_types.each_pair do |key, type|
|
76
|
+
if type =~ /\AArray<(.*)>/i
|
77
|
+
# check to ensure the input is an array given that the attribute
|
78
|
+
# is documented as an array but the input is not
|
79
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
80
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
81
|
+
end
|
82
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
83
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
84
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
85
|
+
end
|
86
|
+
|
87
|
+
self
|
88
|
+
end
|
89
|
+
|
90
|
+
# Deserializes the data based on type
|
91
|
+
# @param string type Data type
|
92
|
+
# @param string value Value to be deserialized
|
93
|
+
# @return [Object] Deserialized data
|
94
|
+
def _deserialize(type, value)
|
95
|
+
case type.to_sym
|
96
|
+
when :DateTime
|
97
|
+
DateTime.parse(value)
|
98
|
+
when :Date
|
99
|
+
Date.parse(value)
|
100
|
+
when :String
|
101
|
+
value.to_s
|
102
|
+
when :Integer
|
103
|
+
value.to_i
|
104
|
+
when :Float
|
105
|
+
value.to_f
|
106
|
+
when :BOOLEAN
|
107
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
108
|
+
true
|
109
|
+
else
|
110
|
+
false
|
111
|
+
end
|
112
|
+
when :Object
|
113
|
+
# generic object (usually a Hash), return directly
|
114
|
+
value
|
115
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
116
|
+
inner_type = Regexp.last_match[:inner_type]
|
117
|
+
value.map { |v| _deserialize(inner_type, v) }
|
118
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
119
|
+
k_type = Regexp.last_match[:k_type]
|
120
|
+
v_type = Regexp.last_match[:v_type]
|
121
|
+
{}.tap do |hash|
|
122
|
+
value.each do |k, v|
|
123
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
124
|
+
end
|
125
|
+
end
|
126
|
+
else # model
|
127
|
+
temp_model = DocuSign_WebForms.const_get(type).new
|
128
|
+
temp_model.build_from_hash(value)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
# Returns the string representation of the object
|
133
|
+
# @return [String] String presentation of the object
|
134
|
+
def to_s
|
135
|
+
to_hash.to_s
|
136
|
+
end
|
137
|
+
|
138
|
+
# to_body is an alias to to_hash (backward compatibility)
|
139
|
+
# @return [Hash] Returns the object in the form of hash
|
140
|
+
def to_body
|
141
|
+
to_hash
|
142
|
+
end
|
143
|
+
|
144
|
+
# Returns the object in the form of hash
|
145
|
+
# @return [Hash] Returns the object in the form of hash
|
146
|
+
def to_hash
|
147
|
+
hash = {}
|
148
|
+
self.class.attribute_map.each_pair do |attr, param|
|
149
|
+
value = self.send(attr)
|
150
|
+
next if value.nil?
|
151
|
+
hash[param] = _to_hash(value)
|
152
|
+
end
|
153
|
+
hash
|
154
|
+
end
|
155
|
+
|
156
|
+
# Outputs non-array value in the form of hash
|
157
|
+
# For object, use to_hash. Otherwise, just return the value
|
158
|
+
# @param [Object] value Any valid value
|
159
|
+
# @return [Hash] Returns the value in the form of hash
|
160
|
+
def _to_hash(value)
|
161
|
+
if value.is_a?(Array)
|
162
|
+
value.compact.map { |v| _to_hash(v) }
|
163
|
+
elsif value.is_a?(Hash)
|
164
|
+
{}.tap do |hash|
|
165
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
166
|
+
end
|
167
|
+
elsif value.respond_to? :to_hash
|
168
|
+
value.to_hash
|
169
|
+
else
|
170
|
+
value
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
end
|
175
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
=begin
|
2
|
+
#Web Forms API version 1.1
|
3
|
+
|
4
|
+
#The Web Forms API facilitates generating semantic HTML forms around everyday contracts.
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.1.0
|
7
|
+
Contact: devcenter@docusign.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
=end
|
11
|
+
|
12
|
+
require 'date'
|
13
|
+
|
14
|
+
module DocuSign_WebForms
|
15
|
+
class WebFormSource
|
16
|
+
|
17
|
+
TEMPLATES = 'templates'.freeze
|
18
|
+
BLANK = 'blank'.freeze
|
19
|
+
|
20
|
+
# Builds the enum from string
|
21
|
+
# @param [String] The enum value in the form of the string
|
22
|
+
# @return [String] The enum value
|
23
|
+
def build_from_hash(value)
|
24
|
+
constantValues = WebFormSource.constants.select { |c| WebFormSource::const_get(c) == value }
|
25
|
+
raise "Invalid ENUM value #{value} for class #WebFormSource" if constantValues.empty?
|
26
|
+
value
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
=begin
|
2
|
+
#Web Forms API version 1.1
|
3
|
+
|
4
|
+
#The Web Forms API facilitates generating semantic HTML forms around everyday contracts.
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.1.0
|
7
|
+
Contact: devcenter@docusign.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
=end
|
11
|
+
|
12
|
+
require 'date'
|
13
|
+
|
14
|
+
module DocuSign_WebForms
|
15
|
+
class WebFormState
|
16
|
+
|
17
|
+
ACTIVE = 'active'.freeze
|
18
|
+
DRAFT = 'draft'.freeze
|
19
|
+
|
20
|
+
# Builds the enum from string
|
21
|
+
# @param [String] The enum value in the form of the string
|
22
|
+
# @return [String] The enum value
|
23
|
+
def build_from_hash(value)
|
24
|
+
constantValues = WebFormState.constants.select { |c| WebFormState::const_get(c) == value }
|
25
|
+
raise "Invalid ENUM value #{value} for class #WebFormState" if constantValues.empty?
|
26
|
+
value
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|