docusign_click 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,283 @@
1
+ =begin
2
+ #DocuSign Click API
3
+
4
+ #Elastic signing (also known as DocuSign Click) lets you capture consent to standard agreement terms with a single click: terms and conditions, terms of service, terms of use, privacy policies, and more. The Click API lets you include this customizable elastic template solution in your DocuSign integrations.
5
+
6
+ OpenAPI spec version: v1
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_Click
15
+ # Control the display of the agreement statement.
16
+ class DocumentLinkStyles
17
+ attr_accessor :focus
18
+
19
+ attr_accessor :hover
20
+
21
+ # Control the border of the element.
22
+ attr_accessor :border
23
+
24
+ # Control the fore-ground color of the element.
25
+ attr_accessor :color
26
+
27
+ # Control the font family of the text.
28
+ attr_accessor :font_family
29
+
30
+ # Control the font size of the text.
31
+ attr_accessor :font_size
32
+
33
+ # Control the font style of the text.
34
+ attr_accessor :font_style
35
+
36
+ # Control the font weight of the text.
37
+ attr_accessor :font_weight
38
+
39
+ # Control the margin of the element.
40
+ attr_accessor :margin
41
+
42
+ # Control the padding of the element.
43
+ attr_accessor :padding
44
+
45
+ # Control the underline and other styles of the text.
46
+ attr_accessor :text_decoration
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'focus' => :':focus',
52
+ :'hover' => :':hover',
53
+ :'border' => :'border',
54
+ :'color' => :'color',
55
+ :'font_family' => :'fontFamily',
56
+ :'font_size' => :'fontSize',
57
+ :'font_style' => :'fontStyle',
58
+ :'font_weight' => :'fontWeight',
59
+ :'margin' => :'margin',
60
+ :'padding' => :'padding',
61
+ :'text_decoration' => :'textDecoration'
62
+ }
63
+ end
64
+
65
+ # Attribute type mapping.
66
+ def self.swagger_types
67
+ {
68
+ :'focus' => :'DocumentLinkStylesFocus',
69
+ :'hover' => :'DocumentLinkStylesFocus',
70
+ :'border' => :'String',
71
+ :'color' => :'String',
72
+ :'font_family' => :'String',
73
+ :'font_size' => :'String',
74
+ :'font_style' => :'String',
75
+ :'font_weight' => :'Object',
76
+ :'margin' => :'String',
77
+ :'padding' => :'String',
78
+ :'text_decoration' => :'String'
79
+ }
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ return unless attributes.is_a?(Hash)
86
+
87
+ # convert string to symbol for hash key
88
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
89
+
90
+ if attributes.has_key?(:':focus')
91
+ self.focus = attributes[:':focus']
92
+ end
93
+
94
+ if attributes.has_key?(:':hover')
95
+ self.hover = attributes[:':hover']
96
+ end
97
+
98
+ if attributes.has_key?(:'border')
99
+ self.border = attributes[:'border']
100
+ end
101
+
102
+ if attributes.has_key?(:'color')
103
+ self.color = attributes[:'color']
104
+ end
105
+
106
+ if attributes.has_key?(:'fontFamily')
107
+ self.font_family = attributes[:'fontFamily']
108
+ end
109
+
110
+ if attributes.has_key?(:'fontSize')
111
+ self.font_size = attributes[:'fontSize']
112
+ end
113
+
114
+ if attributes.has_key?(:'fontStyle')
115
+ self.font_style = attributes[:'fontStyle']
116
+ end
117
+
118
+ if attributes.has_key?(:'fontWeight')
119
+ self.font_weight = attributes[:'fontWeight']
120
+ end
121
+
122
+ if attributes.has_key?(:'margin')
123
+ self.margin = attributes[:'margin']
124
+ end
125
+
126
+ if attributes.has_key?(:'padding')
127
+ self.padding = attributes[:'padding']
128
+ end
129
+
130
+ if attributes.has_key?(:'textDecoration')
131
+ self.text_decoration = attributes[:'textDecoration']
132
+ end
133
+ end
134
+
135
+ # Show invalid properties with the reasons. Usually used together with valid?
136
+ # @return Array for valid properties with the reasons
137
+ def list_invalid_properties
138
+ invalid_properties = Array.new
139
+ invalid_properties
140
+ end
141
+
142
+ # Check to see if the all the properties in the model are valid
143
+ # @return true if the model is valid
144
+ def valid?
145
+ true
146
+ end
147
+
148
+ # Checks equality by comparing each attribute.
149
+ # @param [Object] Object to be compared
150
+ def ==(o)
151
+ return true if self.equal?(o)
152
+ self.class == o.class &&
153
+ focus == o.focus &&
154
+ hover == o.hover &&
155
+ border == o.border &&
156
+ color == o.color &&
157
+ font_family == o.font_family &&
158
+ font_size == o.font_size &&
159
+ font_style == o.font_style &&
160
+ font_weight == o.font_weight &&
161
+ margin == o.margin &&
162
+ padding == o.padding &&
163
+ text_decoration == o.text_decoration
164
+ end
165
+
166
+ # @see the `==` method
167
+ # @param [Object] Object to be compared
168
+ def eql?(o)
169
+ self == o
170
+ end
171
+
172
+ # Calculates hash code according to all attributes.
173
+ # @return [Fixnum] Hash code
174
+ def hash
175
+ [focus, hover, border, color, font_family, font_size, font_style, font_weight, margin, padding, text_decoration].hash
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ self.class.swagger_types.each_pair do |key, type|
184
+ if type =~ /\AArray<(.*)>/i
185
+ # check to ensure the input is an array given that the attribute
186
+ # is documented as an array but the input is not
187
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
188
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
189
+ end
190
+ elsif !attributes[self.class.attribute_map[key]].nil?
191
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
192
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
193
+ end
194
+
195
+ self
196
+ end
197
+
198
+ # Deserializes the data based on type
199
+ # @param string type Data type
200
+ # @param string value Value to be deserialized
201
+ # @return [Object] Deserialized data
202
+ def _deserialize(type, value)
203
+ case type.to_sym
204
+ when :DateTime
205
+ DateTime.parse(value)
206
+ when :Date
207
+ Date.parse(value)
208
+ when :String
209
+ value.to_s
210
+ when :Integer
211
+ value.to_i
212
+ when :Float
213
+ value.to_f
214
+ when :BOOLEAN
215
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
216
+ true
217
+ else
218
+ false
219
+ end
220
+ when :Object
221
+ # generic object (usually a Hash), return directly
222
+ value
223
+ when /\AArray<(?<inner_type>.+)>\z/
224
+ inner_type = Regexp.last_match[:inner_type]
225
+ value.map { |v| _deserialize(inner_type, v) }
226
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
227
+ k_type = Regexp.last_match[:k_type]
228
+ v_type = Regexp.last_match[:v_type]
229
+ {}.tap do |hash|
230
+ value.each do |k, v|
231
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
232
+ end
233
+ end
234
+ else # model
235
+ temp_model = DocuSign_Click.const_get(type).new
236
+ temp_model.build_from_hash(value)
237
+ end
238
+ end
239
+
240
+ # Returns the string representation of the object
241
+ # @return [String] String presentation of the object
242
+ def to_s
243
+ to_hash.to_s
244
+ end
245
+
246
+ # to_body is an alias to to_hash (backward compatibility)
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_body
249
+ to_hash
250
+ end
251
+
252
+ # Returns the object in the form of hash
253
+ # @return [Hash] Returns the object in the form of hash
254
+ def to_hash
255
+ hash = {}
256
+ self.class.attribute_map.each_pair do |attr, param|
257
+ value = self.send(attr)
258
+ next if value.nil?
259
+ hash[param] = _to_hash(value)
260
+ end
261
+ hash
262
+ end
263
+
264
+ # Outputs non-array value in the form of hash
265
+ # For object, use to_hash. Otherwise, just return the value
266
+ # @param [Object] value Any valid value
267
+ # @return [Hash] Returns the value in the form of hash
268
+ def _to_hash(value)
269
+ if value.is_a?(Array)
270
+ value.compact.map { |v| _to_hash(v) }
271
+ elsif value.is_a?(Hash)
272
+ {}.tap do |hash|
273
+ value.each { |k, v| hash[k] = _to_hash(v) }
274
+ end
275
+ elsif value.respond_to? :to_hash
276
+ value.to_hash
277
+ else
278
+ value
279
+ end
280
+ end
281
+
282
+ end
283
+ end
@@ -0,0 +1,264 @@
1
+ =begin
2
+ #DocuSign Click API
3
+
4
+ #Elastic signing (also known as DocuSign Click) lets you capture consent to standard agreement terms with a single click: terms and conditions, terms of service, terms of use, privacy policies, and more. The Click API lets you include this customizable elastic template solution in your DocuSign integrations.
5
+
6
+ OpenAPI spec version: v1
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_Click
15
+ class DocumentLinkStylesFocus
16
+ # Control the border of the element.
17
+ attr_accessor :border
18
+
19
+ # Control the fore-ground color of the element.
20
+ attr_accessor :color
21
+
22
+ # Control the font family of the text.
23
+ attr_accessor :font_family
24
+
25
+ # Control the font size of the text.
26
+ attr_accessor :font_size
27
+
28
+ # Control the font style of the text.
29
+ attr_accessor :font_style
30
+
31
+ # Control the font weight of the text.
32
+ attr_accessor :font_weight
33
+
34
+ # Control the margin of the element.
35
+ attr_accessor :margin
36
+
37
+ # Control the padding of the element.
38
+ attr_accessor :padding
39
+
40
+ # Control the underline and other styles of the text.
41
+ attr_accessor :text_decoration
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ :'border' => :'border',
47
+ :'color' => :'color',
48
+ :'font_family' => :'fontFamily',
49
+ :'font_size' => :'fontSize',
50
+ :'font_style' => :'fontStyle',
51
+ :'font_weight' => :'fontWeight',
52
+ :'margin' => :'margin',
53
+ :'padding' => :'padding',
54
+ :'text_decoration' => :'textDecoration'
55
+ }
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.swagger_types
60
+ {
61
+ :'border' => :'String',
62
+ :'color' => :'String',
63
+ :'font_family' => :'String',
64
+ :'font_size' => :'String',
65
+ :'font_style' => :'String',
66
+ :'font_weight' => :'Object',
67
+ :'margin' => :'String',
68
+ :'padding' => :'String',
69
+ :'text_decoration' => :'String'
70
+ }
71
+ end
72
+
73
+ # Initializes the object
74
+ # @param [Hash] attributes Model attributes in the form of hash
75
+ def initialize(attributes = {})
76
+ return unless attributes.is_a?(Hash)
77
+
78
+ # convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
80
+
81
+ if attributes.has_key?(:'border')
82
+ self.border = attributes[:'border']
83
+ end
84
+
85
+ if attributes.has_key?(:'color')
86
+ self.color = attributes[:'color']
87
+ end
88
+
89
+ if attributes.has_key?(:'fontFamily')
90
+ self.font_family = attributes[:'fontFamily']
91
+ end
92
+
93
+ if attributes.has_key?(:'fontSize')
94
+ self.font_size = attributes[:'fontSize']
95
+ end
96
+
97
+ if attributes.has_key?(:'fontStyle')
98
+ self.font_style = attributes[:'fontStyle']
99
+ end
100
+
101
+ if attributes.has_key?(:'fontWeight')
102
+ self.font_weight = attributes[:'fontWeight']
103
+ end
104
+
105
+ if attributes.has_key?(:'margin')
106
+ self.margin = attributes[:'margin']
107
+ end
108
+
109
+ if attributes.has_key?(:'padding')
110
+ self.padding = attributes[:'padding']
111
+ end
112
+
113
+ if attributes.has_key?(:'textDecoration')
114
+ self.text_decoration = attributes[:'textDecoration']
115
+ end
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
+ invalid_properties
123
+ end
124
+
125
+ # Check to see if the all the properties in the model are valid
126
+ # @return true if the model is valid
127
+ def valid?
128
+ true
129
+ end
130
+
131
+ # Checks equality by comparing each attribute.
132
+ # @param [Object] Object to be compared
133
+ def ==(o)
134
+ return true if self.equal?(o)
135
+ self.class == o.class &&
136
+ border == o.border &&
137
+ color == o.color &&
138
+ font_family == o.font_family &&
139
+ font_size == o.font_size &&
140
+ font_style == o.font_style &&
141
+ font_weight == o.font_weight &&
142
+ margin == o.margin &&
143
+ padding == o.padding &&
144
+ text_decoration == o.text_decoration
145
+ end
146
+
147
+ # @see the `==` method
148
+ # @param [Object] Object to be compared
149
+ def eql?(o)
150
+ self == o
151
+ end
152
+
153
+ # Calculates hash code according to all attributes.
154
+ # @return [Fixnum] Hash code
155
+ def hash
156
+ [border, color, font_family, font_size, font_style, font_weight, margin, padding, text_decoration].hash
157
+ end
158
+
159
+ # Builds the object from hash
160
+ # @param [Hash] attributes Model attributes in the form of hash
161
+ # @return [Object] Returns the model itself
162
+ def build_from_hash(attributes)
163
+ return nil unless attributes.is_a?(Hash)
164
+ self.class.swagger_types.each_pair do |key, type|
165
+ if type =~ /\AArray<(.*)>/i
166
+ # check to ensure the input is an array given that the attribute
167
+ # is documented as an array but the input is not
168
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
169
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
170
+ end
171
+ elsif !attributes[self.class.attribute_map[key]].nil?
172
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
173
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
174
+ end
175
+
176
+ self
177
+ end
178
+
179
+ # Deserializes the data based on type
180
+ # @param string type Data type
181
+ # @param string value Value to be deserialized
182
+ # @return [Object] Deserialized data
183
+ def _deserialize(type, value)
184
+ case type.to_sym
185
+ when :DateTime
186
+ DateTime.parse(value)
187
+ when :Date
188
+ Date.parse(value)
189
+ when :String
190
+ value.to_s
191
+ when :Integer
192
+ value.to_i
193
+ when :Float
194
+ value.to_f
195
+ when :BOOLEAN
196
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
197
+ true
198
+ else
199
+ false
200
+ end
201
+ when :Object
202
+ # generic object (usually a Hash), return directly
203
+ value
204
+ when /\AArray<(?<inner_type>.+)>\z/
205
+ inner_type = Regexp.last_match[:inner_type]
206
+ value.map { |v| _deserialize(inner_type, v) }
207
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
208
+ k_type = Regexp.last_match[:k_type]
209
+ v_type = Regexp.last_match[:v_type]
210
+ {}.tap do |hash|
211
+ value.each do |k, v|
212
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
213
+ end
214
+ end
215
+ else # model
216
+ temp_model = DocuSign_Click.const_get(type).new
217
+ temp_model.build_from_hash(value)
218
+ end
219
+ end
220
+
221
+ # Returns the string representation of the object
222
+ # @return [String] String presentation of the object
223
+ def to_s
224
+ to_hash.to_s
225
+ end
226
+
227
+ # to_body is an alias to to_hash (backward compatibility)
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_body
230
+ to_hash
231
+ end
232
+
233
+ # Returns the object in the form of hash
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_hash
236
+ hash = {}
237
+ self.class.attribute_map.each_pair do |attr, param|
238
+ value = self.send(attr)
239
+ next if value.nil?
240
+ hash[param] = _to_hash(value)
241
+ end
242
+ hash
243
+ end
244
+
245
+ # Outputs non-array value in the form of hash
246
+ # For object, use to_hash. Otherwise, just return the value
247
+ # @param [Object] value Any valid value
248
+ # @return [Hash] Returns the value in the form of hash
249
+ def _to_hash(value)
250
+ if value.is_a?(Array)
251
+ value.compact.map { |v| _to_hash(v) }
252
+ elsif value.is_a?(Hash)
253
+ {}.tap do |hash|
254
+ value.each { |k, v| hash[k] = _to_hash(v) }
255
+ end
256
+ elsif value.respond_to? :to_hash
257
+ value.to_hash
258
+ else
259
+ value
260
+ end
261
+ end
262
+
263
+ end
264
+ end