Class: UnivapayClientSdk::TokenResponseCardDataCvvAuthorizeCheck

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

Overview

Token Response Card Data Cvv Authorize Check 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(status: SKIP, charge_id: SKIP, date: SKIP, additional_properties: nil) ⇒ TokenResponseCardDataCvvAuthorizeCheck

Returns a new instance of TokenResponseCardDataCvvAuthorizeCheck.



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

def initialize(status: SKIP, charge_id: SKIP, date: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @status = status unless status == SKIP
  @charge_id = charge_id unless charge_id == SKIP
  @date = date unless date == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#charge_idUUID | String

Charge identifier.

Returns:

  • (UUID | String)


19
20
21
# File 'lib/univapay_client_sdk/models/token_response_card_data_cvv_authorize_check.rb', line 19

def charge_id
  @charge_id
end

#dateDateTime

Date value.

Returns:

  • (DateTime)


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

def date
  @date
end

#statusString

Current status of the resource.

Returns:

  • (String)


15
16
17
# File 'lib/univapay_client_sdk/models/token_response_card_data_cvv_authorize_check.rb', line 15

def status
  @status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  status = hash.key?('status') ? hash['status'] : SKIP
  charge_id = hash.key?('charge_id') ? hash['charge_id'] : SKIP
  date = if hash.key?('date')
           (DateTimeHelper.from_rfc3339(hash['date']) if hash['date'])
         else
           SKIP
         end

  # 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.
  TokenResponseCardDataCvvAuthorizeCheck.new(status: status,
                                             charge_id: charge_id,
                                             date: date,
                                             additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



26
27
28
29
30
31
32
# File 'lib/univapay_client_sdk/models/token_response_card_data_cvv_authorize_check.rb', line 26

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['status'] = 'status'
  @_hash['charge_id'] = 'charge_id'
  @_hash['date'] = 'date'
  @_hash
end

.nullablesObject

An array for nullable fields



44
45
46
47
48
49
50
# File 'lib/univapay_client_sdk/models/token_response_card_data_cvv_authorize_check.rb', line 44

def self.nullables
  %w[
    status
    charge_id
    date
  ]
end

.optionalsObject

An array for optional fields



35
36
37
38
39
40
41
# File 'lib/univapay_client_sdk/models/token_response_card_data_cvv_authorize_check.rb', line 35

def self.optionals
  %w[
    status
    charge_id
    date
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



96
97
98
99
100
101
102
# File 'lib/univapay_client_sdk/models/token_response_card_data_cvv_authorize_check.rb', line 96

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



112
113
114
115
116
# File 'lib/univapay_client_sdk/models/token_response_card_data_cvv_authorize_check.rb', line 112

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

#to_custom_dateObject



90
91
92
# File 'lib/univapay_client_sdk/models/token_response_card_data_cvv_authorize_check.rb', line 90

def to_custom_date
  DateTimeHelper.to_rfc3339(date)
end

#to_sObject

Provides a human-readable string representation of the object.



105
106
107
108
109
# File 'lib/univapay_client_sdk/models/token_response_card_data_cvv_authorize_check.rb', line 105

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