Class: UnivapayClientSdk::TokenCreateBankTransferData

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/univapay_client_sdk/models/token_create_bank_transfer_data.rb

Overview

Token Create Bank Transfer Data schema.

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(brand:, expiration_period: SKIP, expiration_time_shift: SKIP, name: SKIP, additional_properties: nil) ⇒ TokenCreateBankTransferData

Returns a new instance of TokenCreateBankTransferData.



53
54
55
56
57
58
59
60
61
62
63
# File 'lib/univapay_client_sdk/models/token_create_bank_transfer_data.rb', line 53

def initialize(brand:, expiration_period: SKIP, expiration_time_shift: SKIP,
               name: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @brand = brand
  @expiration_period = expiration_period unless expiration_period == SKIP
  @expiration_time_shift = expiration_time_shift unless expiration_time_shift == SKIP
  @name = name unless name == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#brandString

The bank brand identifier (e.g., 'aozora_bank').

Returns:

  • (String)


14
15
16
# File 'lib/univapay_client_sdk/models/token_create_bank_transfer_data.rb', line 14

def brand
  @brand
end

#expiration_periodString

ISO 8601 duration format (e.g., 'PT168H').

Returns:

  • (String)


18
19
20
# File 'lib/univapay_client_sdk/models/token_create_bank_transfer_data.rb', line 18

def expiration_period
  @expiration_period
end

#expiration_time_shiftString

Time shift applied to the expiration, typically pushing it to the end of the day in a specific timezone (e.g., '23:59:59+09:00').

Returns:

  • (String)


23
24
25
# File 'lib/univapay_client_sdk/models/token_create_bank_transfer_data.rb', line 23

def expiration_time_shift
  @expiration_time_shift
end

#nameString

The name of the customer initiating the transfer.

Returns:

  • (String)


27
28
29
# File 'lib/univapay_client_sdk/models/token_create_bank_transfer_data.rb', line 27

def name
  @name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/univapay_client_sdk/models/token_create_bank_transfer_data.rb', line 66

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  brand = hash.key?('brand') ? hash['brand'] : nil
  expiration_period =
    hash.key?('expiration_period') ? hash['expiration_period'] : SKIP
  expiration_time_shift =
    hash.key?('expiration_time_shift') ? hash['expiration_time_shift'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  TokenCreateBankTransferData.new(brand: brand,
                                  expiration_period: expiration_period,
                                  expiration_time_shift: expiration_time_shift,
                                  name: name,
                                  additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



30
31
32
33
34
35
36
37
# File 'lib/univapay_client_sdk/models/token_create_bank_transfer_data.rb', line 30

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['brand'] = 'brand'
  @_hash['expiration_period'] = 'expiration_period'
  @_hash['expiration_time_shift'] = 'expiration_time_shift'
  @_hash['name'] = 'name'
  @_hash
end

.nullablesObject

An array for nullable fields



49
50
51
# File 'lib/univapay_client_sdk/models/token_create_bank_transfer_data.rb', line 49

def self.nullables
  []
end

.optionalsObject

An array for optional fields



40
41
42
43
44
45
46
# File 'lib/univapay_client_sdk/models/token_create_bank_transfer_data.rb', line 40

def self.optionals
  %w[
    expiration_period
    expiration_time_shift
    name
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



94
95
96
97
98
99
100
101
102
103
104
# File 'lib/univapay_client_sdk/models/token_create_bank_transfer_data.rb', line 94

def self.validate(value)
  if value.instance_of? self
    return APIHelper.valid_type?(value.brand,
                                 ->(val) { val.instance_of? String })
  end

  return false unless value.instance_of? Hash

  APIHelper.valid_type?(value['brand'],
                        ->(val) { val.instance_of? String })
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



115
116
117
118
119
120
# File 'lib/univapay_client_sdk/models/token_create_bank_transfer_data.rb', line 115

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} brand: #{@brand.inspect}, expiration_period: #{@expiration_period.inspect},"\
  " expiration_time_shift: #{@expiration_time_shift.inspect}, name: #{@name.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



107
108
109
110
111
112
# File 'lib/univapay_client_sdk/models/token_create_bank_transfer_data.rb', line 107

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} brand: #{@brand}, expiration_period: #{@expiration_period},"\
  " expiration_time_shift: #{@expiration_time_shift}, name: #{@name}, additional_properties:"\
  " #{@additional_properties}>"
end