Class: UnivapayClientSdk::TokenResponsePaidyData
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- UnivapayClientSdk::TokenResponsePaidyData
- Defined in:
- lib/univapay_client_sdk/models/token_response_paidy_data.rb
Overview
Token Response Paidy Data schema.
Instance Attribute Summary collapse
-
#paidy_token ⇒ String
One-time token issued by the Paidy SDK/widget on the client side.
-
#phone_number ⇒ String
Consumer phone number in Japanese format.
-
#shipping_address ⇒ TokenResponsePaidyDataShippingAddress
Shipping address returned for a Paidy token.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(paidy_token:, phone_number: SKIP, shipping_address: SKIP, additional_properties: nil) ⇒ TokenResponsePaidyData
constructor
A new instance of TokenResponsePaidyData.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(paidy_token:, phone_number: SKIP, shipping_address: SKIP, additional_properties: nil) ⇒ TokenResponsePaidyData
Returns a new instance of TokenResponsePaidyData.
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/univapay_client_sdk/models/token_response_paidy_data.rb', line 48 def initialize(paidy_token:, phone_number: SKIP, shipping_address: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @paidy_token = paidy_token @phone_number = phone_number unless phone_number == SKIP @shipping_address = shipping_address unless shipping_address == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#paidy_token ⇒ String
One-time token issued by the Paidy SDK/widget on the client side.
14 15 16 |
# File 'lib/univapay_client_sdk/models/token_response_paidy_data.rb', line 14 def paidy_token @paidy_token end |
#phone_number ⇒ String
Consumer phone number in Japanese format.
18 19 20 |
# File 'lib/univapay_client_sdk/models/token_response_paidy_data.rb', line 18 def phone_number @phone_number end |
#shipping_address ⇒ TokenResponsePaidyDataShippingAddress
Shipping address returned for a Paidy token.
22 23 24 |
# File 'lib/univapay_client_sdk/models/token_response_paidy_data.rb', line 22 def shipping_address @shipping_address end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/univapay_client_sdk/models/token_response_paidy_data.rb', line 60 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. paidy_token = hash.key?('paidy_token') ? hash['paidy_token'] : nil phone_number = hash.key?('phone_number') ? hash['phone_number'] : SKIP if hash['shipping_address'] shipping_address = TokenResponsePaidyDataShippingAddress.from_hash(hash['shipping_address']) 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. TokenResponsePaidyData.new(paidy_token: paidy_token, phone_number: phone_number, shipping_address: shipping_address, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 31 |
# File 'lib/univapay_client_sdk/models/token_response_paidy_data.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['paidy_token'] = 'paidy_token' @_hash['phone_number'] = 'phone_number' @_hash['shipping_address'] = 'shipping_address' @_hash end |
.nullables ⇒ Object
An array for nullable fields
42 43 44 45 46 |
# File 'lib/univapay_client_sdk/models/token_response_paidy_data.rb', line 42 def self.nullables %w[ phone_number ] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 37 38 39 |
# File 'lib/univapay_client_sdk/models/token_response_paidy_data.rb', line 34 def self.optionals %w[ phone_number shipping_address ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/univapay_client_sdk/models/token_response_paidy_data.rb', line 86 def self.validate(value) if value.instance_of? self return APIHelper.valid_type?(value.paidy_token, ->(val) { val.instance_of? String }) end return false unless value.instance_of? Hash APIHelper.valid_type?(value['paidy_token'], ->(val) { val.instance_of? String }) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
106 107 108 109 110 111 |
# File 'lib/univapay_client_sdk/models/token_response_paidy_data.rb', line 106 def inspect class_name = self.class.name.split('::').last "<#{class_name} paidy_token: #{@paidy_token.inspect}, phone_number:"\ " #{@phone_number.inspect}, shipping_address: #{@shipping_address.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
99 100 101 102 103 |
# File 'lib/univapay_client_sdk/models/token_response_paidy_data.rb', line 99 def to_s class_name = self.class.name.split('::').last "<#{class_name} paidy_token: #{@paidy_token}, phone_number: #{@phone_number},"\ " shipping_address: #{@shipping_address}, additional_properties: #{@additional_properties}>" end |