Class: NewStoreApi::SignatureItemFrV1Dto

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/new_store_api/models/signature_item_fr_v1_dto.rb

Overview

SignatureItemFrV1Dto Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(caption = nil, data = nil, format = nil, type = nil) ⇒ SignatureItemFrV1Dto

Returns a new instance of SignatureItemFrV1Dto.



48
49
50
51
52
53
# File 'lib/new_store_api/models/signature_item_fr_v1_dto.rb', line 48

def initialize(caption = nil, data = nil, format = nil, type = nil)
  @caption = caption
  @data = data
  @format = format
  @type = type
end

Instance Attribute Details

#captionString

Caption used for printing.

Returns:

  • (String)


14
15
16
# File 'lib/new_store_api/models/signature_item_fr_v1_dto.rb', line 14

def caption
  @caption
end

#dataString

Signature payload.

Returns:

  • (String)


18
19
20
# File 'lib/new_store_api/models/signature_item_fr_v1_dto.rb', line 18

def data
  @data
end

#formatFtFrSignatureFormatEnum

Signature payload.



22
23
24
# File 'lib/new_store_api/models/signature_item_fr_v1_dto.rb', line 22

def format
  @format
end

#typeFtFrSignatureTypeEnum

Signature payload.



26
27
28
# File 'lib/new_store_api/models/signature_item_fr_v1_dto.rb', line 26

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/new_store_api/models/signature_item_fr_v1_dto.rb', line 56

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  caption = hash.key?('caption') ? hash['caption'] : nil
  data = hash.key?('data') ? hash['data'] : nil
  format = hash.key?('format') ? hash['format'] : nil
  type = hash.key?('type') ? hash['type'] : nil

  # Create object from extracted values.
  SignatureItemFrV1Dto.new(caption,
                           data,
                           format,
                           type)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
36
# File 'lib/new_store_api/models/signature_item_fr_v1_dto.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['caption'] = 'caption'
  @_hash['data'] = 'data'
  @_hash['format'] = 'format'
  @_hash['type'] = 'type'
  @_hash
end

.nullablesObject

An array for nullable fields



44
45
46
# File 'lib/new_store_api/models/signature_item_fr_v1_dto.rb', line 44

def self.nullables
  []
end

.optionalsObject

An array for optional fields



39
40
41
# File 'lib/new_store_api/models/signature_item_fr_v1_dto.rb', line 39

def self.optionals
  []
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/new_store_api/models/signature_item_fr_v1_dto.rb', line 74

def self.validate(value)
  if value.instance_of? self
    return (
      APIHelper.valid_type?(value.caption,
                            ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.data,
                              ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.format,
                              ->(val) { FtFrSignatureFormatEnum.validate(val) }) and
        APIHelper.valid_type?(value.type,
                              ->(val) { FtFrSignatureTypeEnum.validate(val) })
    )
  end

  return false unless value.instance_of? Hash

  (
    APIHelper.valid_type?(value['caption'],
                          ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['data'],
                            ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['format'],
                            ->(val) { FtFrSignatureFormatEnum.validate(val) }) and
      APIHelper.valid_type?(value['type'],
                            ->(val) { FtFrSignatureTypeEnum.validate(val) })
  )
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



109
110
111
112
113
# File 'lib/new_store_api/models/signature_item_fr_v1_dto.rb', line 109

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} caption: #{@caption.inspect}, data: #{@data.inspect}, format:"\
  " #{@format.inspect}, type: #{@type.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



103
104
105
106
# File 'lib/new_store_api/models/signature_item_fr_v1_dto.rb', line 103

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} caption: #{@caption}, data: #{@data}, format: #{@format}, type: #{@type}>"
end