Class: YousignClient::FileObjectOutput
- Inherits:
-
Object
- Object
- YousignClient::FileObjectOutput
- Defined in:
- lib/yousign_client/models/file_object_output.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#content ⇒ Object
- type=text
-
The content of the field.
-
#content_required ⇒ Object
- type=text
-
Indicate if the member must fill or not the field.
-
#created_at ⇒ Object
Created date of the object.
-
#executed_at ⇒ Object
Date of signature or validation.
-
#field_name ⇒ Object
- type=signature
-
Name of the signature field existing in the document.
-
#file ⇒ Object
Returns the value of attribute file.
-
#font_color ⇒ Object
- type=text
-
The font color used to render the field.
-
#font_family ⇒ Object
- type=text
-
The font familly used to render the TextField.
-
#font_size ⇒ Object
- type=text
-
The font size used to render the field.
-
#id ⇒ Object
Id of the object.
-
#mention ⇒ Object
- type=signature
-
Text associated above the signature image.
-
#mention2__internal ⇒ Object
- type=signature
-
Text associated below the signature image.
-
#page ⇒ Object
Page of the visible signature.
-
#position ⇒ Object
Coordinates of the signature image to set.
-
#reason ⇒ Object
- type=signature
-
The reason they are signing the agreement.
-
#type ⇒ Object
The type of the file object.
-
#updated_at ⇒ Object
Updated date of the object.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ FileObjectOutput
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ FileObjectOutput
Initializes the object
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
# File 'lib/yousign_client/models/file_object_output.rb', line 137 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'id') self.id = attributes[:'id'] end if attributes.has_key?(:'file') self.file = attributes[:'file'] end if attributes.has_key?(:'page') self.page = attributes[:'page'] end if attributes.has_key?(:'position') self.position = attributes[:'position'] end if attributes.has_key?(:'fieldName') self.field_name = attributes[:'fieldName'] end if attributes.has_key?(:'mention') self.mention = attributes[:'mention'] end if attributes.has_key?(:'mention2 (internal)') self.mention2__internal = attributes[:'mention2 (internal)'] end if attributes.has_key?(:'createdAt') self.created_at = attributes[:'createdAt'] end if attributes.has_key?(:'updatedAt') self.updated_at = attributes[:'updatedAt'] end if attributes.has_key?(:'executedAt') self.executed_at = attributes[:'executedAt'] end if attributes.has_key?(:'reason') self.reason = attributes[:'reason'] else self.reason = 'Signed by Firstname Lastname' end if attributes.has_key?(:'type') self.type = attributes[:'type'] else self.type = 'signature' end if attributes.has_key?(:'contentRequired') self.content_required = attributes[:'contentRequired'] else self.content_required = false end if attributes.has_key?(:'content') self.content = attributes[:'content'] end if attributes.has_key?(:'fontFamily') self.font_family = attributes[:'fontFamily'] else self.font_family = 'raleway' end if attributes.has_key?(:'fontSize') self.font_size = attributes[:'fontSize'] else self.font_size = 12 end if attributes.has_key?(:'fontColor') self.font_color = attributes[:'fontColor'] end end |
Instance Attribute Details
#content ⇒ Object
- type=text
-
The content of the field. Could be used for placeholder
56 57 58 |
# File 'lib/yousign_client/models/file_object_output.rb', line 56 def content @content end |
#content_required ⇒ Object
- type=text
-
Indicate if the member must fill or not the field
53 54 55 |
# File 'lib/yousign_client/models/file_object_output.rb', line 53 def content_required @content_required end |
#created_at ⇒ Object
Created date of the object
38 39 40 |
# File 'lib/yousign_client/models/file_object_output.rb', line 38 def created_at @created_at end |
#executed_at ⇒ Object
Date of signature or validation
44 45 46 |
# File 'lib/yousign_client/models/file_object_output.rb', line 44 def executed_at @executed_at end |
#field_name ⇒ Object
- type=signature
-
Name of the signature field existing in the document
29 30 31 |
# File 'lib/yousign_client/models/file_object_output.rb', line 29 def field_name @field_name end |
#file ⇒ Object
Returns the value of attribute file.
20 21 22 |
# File 'lib/yousign_client/models/file_object_output.rb', line 20 def file @file end |
#font_color ⇒ Object
- type=text
-
The font color used to render the field.
65 66 67 |
# File 'lib/yousign_client/models/file_object_output.rb', line 65 def font_color @font_color end |
#font_family ⇒ Object
- type=text
-
The font familly used to render the TextField. Currently only the default value will be used.
59 60 61 |
# File 'lib/yousign_client/models/file_object_output.rb', line 59 def font_family @font_family end |
#font_size ⇒ Object
- type=text
-
The font size used to render the field. Currently only the default value will be used.
62 63 64 |
# File 'lib/yousign_client/models/file_object_output.rb', line 62 def font_size @font_size end |
#id ⇒ Object
Id of the object
18 19 20 |
# File 'lib/yousign_client/models/file_object_output.rb', line 18 def id @id end |
#mention ⇒ Object
- type=signature
-
Text associated above the signature image. You can use some variable inside : YousignClient::FileObjectOutput.{date{date.en} YousignClient::FileObjectOutput.{date{date.fr} YousignClient::FileObjectOutput.{time{time.en} YousignClient::FileObjectOutput.{time{time.fr} that it will be parsed to show the date of the signature.
32 33 34 |
# File 'lib/yousign_client/models/file_object_output.rb', line 32 def mention @mention end |
#mention2__internal ⇒ Object
- type=signature
-
Text associated below the signature image. (internal usage only, should not be used). You can use some variable inside : YousignClient::FileObjectOutput.{date{date.en} YousignClient::FileObjectOutput.{date{date.fr} YousignClient::FileObjectOutput.{time{time.en} YousignClient::FileObjectOutput.{time{time.fr} that it will be parsed to show the date of the signature.
35 36 37 |
# File 'lib/yousign_client/models/file_object_output.rb', line 35 def mention2__internal @mention2__internal end |
#page ⇒ Object
Page of the visible signature. This property is ignored if fieldName is set. If you want a visible signature, you must set page, position and fieldName.
23 24 25 |
# File 'lib/yousign_client/models/file_object_output.rb', line 23 def page @page end |
#position ⇒ Object
Coordinates of the signature image to set. Format is : “llx,lly,urx,ury”. llx=left lower x coordinate, lly=left lower y coordinate, urx=upper right x coordinate, ury = upper right y coordinate. To get easily coordinates, you could use this tool : placeit.yousign.fr
26 27 28 |
# File 'lib/yousign_client/models/file_object_output.rb', line 26 def position @position end |
#reason ⇒ Object
- type=signature
-
The reason they are signing the agreement
47 48 49 |
# File 'lib/yousign_client/models/file_object_output.rb', line 47 def reason @reason end |
#type ⇒ Object
The type of the file object
50 51 52 |
# File 'lib/yousign_client/models/file_object_output.rb', line 50 def type @type end |
#updated_at ⇒ Object
Updated date of the object
41 42 43 |
# File 'lib/yousign_client/models/file_object_output.rb', line 41 def updated_at @updated_at end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/yousign_client/models/file_object_output.rb', line 90 def self.attribute_map { :'id' => :'id', :'file' => :'file', :'page' => :'page', :'position' => :'position', :'field_name' => :'fieldName', :'mention' => :'mention', :'mention2__internal' => :'mention2 (internal)', :'created_at' => :'createdAt', :'updated_at' => :'updatedAt', :'executed_at' => :'executedAt', :'reason' => :'reason', :'type' => :'type', :'content_required' => :'contentRequired', :'content' => :'content', :'font_family' => :'fontFamily', :'font_size' => :'fontSize', :'font_color' => :'fontColor' } end |
.swagger_types ⇒ Object
Attribute type mapping.
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/yousign_client/models/file_object_output.rb', line 113 def self.swagger_types { :'id' => :'String', :'file' => :'FileOutput', :'page' => :'Integer', :'position' => :'String', :'field_name' => :'String', :'mention' => :'String', :'mention2__internal' => :'String', :'created_at' => :'DateTime', :'updated_at' => :'DateTime', :'executed_at' => :'DateTime', :'reason' => :'String', :'type' => :'String', :'content_required' => :'BOOLEAN', :'content' => :'String', :'font_family' => :'String', :'font_size' => :'Integer', :'font_color' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
# File 'lib/yousign_client/models/file_object_output.rb', line 350 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && file == o.file && page == o.page && position == o.position && field_name == o.field_name && mention == o.mention && mention2__internal == o.mention2__internal && created_at == o.created_at && updated_at == o.updated_at && executed_at == o.executed_at && reason == o.reason && type == o.type && content_required == o.content_required && content == o.content && font_family == o.font_family && font_size == o.font_size && font_color == o.font_color end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 |
# File 'lib/yousign_client/models/file_object_output.rb', line 408 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = YousignClient.const_get(type).new temp_model.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
474 475 476 477 478 479 480 481 482 483 484 485 486 |
# File 'lib/yousign_client/models/file_object_output.rb', line 474 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 |
# File 'lib/yousign_client/models/file_object_output.rb', line 387 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(o) ⇒ Boolean
374 375 376 |
# File 'lib/yousign_client/models/file_object_output.rb', line 374 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
380 381 382 |
# File 'lib/yousign_client/models/file_object_output.rb', line 380 def hash [id, file, page, position, field_name, mention, mention2__internal, created_at, updated_at, executed_at, reason, type, content_required, content, font_family, font_size, font_color].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/yousign_client/models/file_object_output.rb', line 224 def list_invalid_properties invalid_properties = Array.new if !@id.nil? && @id !~ Regexp.new(/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/) invalid_properties.push('invalid value for "id", must conform to the pattern /^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/.') end if @file.nil? invalid_properties.push('invalid value for "file", file cannot be nil.') end if !@position.nil? && @position !~ Regexp.new(/^\\d+(,\\d+){3}$/) invalid_properties.push('invalid value for "position", must conform to the pattern /^\\d+(,\\d+){3}$/.') end if !@content.nil? && @content.to_s.length > 255 invalid_properties.push('invalid value for "content", the character length must be smaller than or equal to 255.') end if !@font_size.nil? && @font_size > 20 invalid_properties.push('invalid value for "font_size", must be smaller than or equal to 20.') end if !@font_size.nil? && @font_size < 6 invalid_properties.push('invalid value for "font_size", must be greater than or equal to 6.') end if !@font_color.nil? && @font_color !~ Regexp.new(/^(0|255|25[0-4]|2[0-4]\\d|1\\d\\d|0?\\d?\\d),(0|255|25[0-4]|2[0-4]\\d|1\\d\\d|0?\\d?\\d),(0|255|25[0-4]|2[0-4]\\d|1\\d\\d|0?\\d?\\d)$/) invalid_properties.push('invalid value for "font_color", must conform to the pattern /^(0|255|25[0-4]|2[0-4]\\d|1\\d\\d|0?\\d?\\d),(0|255|25[0-4]|2[0-4]\\d|1\\d\\d|0?\\d?\\d),(0|255|25[0-4]|2[0-4]\\d|1\\d\\d|0?\\d?\\d)$/.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
454 455 456 |
# File 'lib/yousign_client/models/file_object_output.rb', line 454 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
460 461 462 463 464 465 466 467 468 |
# File 'lib/yousign_client/models/file_object_output.rb', line 460 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
448 449 450 |
# File 'lib/yousign_client/models/file_object_output.rb', line 448 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
259 260 261 262 263 264 265 266 267 268 269 270 271 272 |
# File 'lib/yousign_client/models/file_object_output.rb', line 259 def valid? return false if !@id.nil? && @id !~ Regexp.new(/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/) return false if @file.nil? return false if !@position.nil? && @position !~ Regexp.new(/^\\d+(,\\d+){3}$/) type_validator = EnumAttributeValidator.new('String', ['signature', 'text']) return false unless type_validator.valid?(@type) return false if !@content.nil? && @content.to_s.length > 255 font_family_validator = EnumAttributeValidator.new('String', ['raleway']) return false unless font_family_validator.valid?(@font_family) return false if !@font_size.nil? && @font_size > 20 return false if !@font_size.nil? && @font_size < 6 return false if !@font_color.nil? && @font_color !~ Regexp.new(/^(0|255|25[0-4]|2[0-4]\\d|1\\d\\d|0?\\d?\\d),(0|255|25[0-4]|2[0-4]\\d|1\\d\\d|0?\\d?\\d),(0|255|25[0-4]|2[0-4]\\d|1\\d\\d|0?\\d?\\d)$/) true end |