Class: UnivapayClientSdk::CustomsDeclarationWebhookDeclaration
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- UnivapayClientSdk::CustomsDeclarationWebhookDeclaration
- Defined in:
- lib/univapay_client_sdk/models/customs_declaration_webhook_declaration.rb
Overview
WeChat customs declaration payload returned by the backend formatter.
Instance Attribute Summary collapse
-
#certificate_id ⇒ String
Customer certificate or passport identifier.
-
#certificate_name ⇒ String
Customer name as provided to customs.
-
#customs ⇒ String
WeChat customs authority code.
-
#merchant_customs_no ⇒ String
Merchant customs registration number.
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(customs: SKIP, merchant_customs_no: SKIP, certificate_id: SKIP, certificate_name: SKIP, additional_properties: nil) ⇒ CustomsDeclarationWebhookDeclaration
constructor
A new instance of CustomsDeclarationWebhookDeclaration.
-
#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(customs: SKIP, merchant_customs_no: SKIP, certificate_id: SKIP, certificate_name: SKIP, additional_properties: nil) ⇒ CustomsDeclarationWebhookDeclaration
Returns a new instance of CustomsDeclarationWebhookDeclaration.
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/univapay_client_sdk/models/customs_declaration_webhook_declaration.rb', line 53 def initialize(customs: SKIP, merchant_customs_no: SKIP, certificate_id: SKIP, certificate_name: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @customs = customs unless customs == SKIP @merchant_customs_no = merchant_customs_no unless merchant_customs_no == SKIP @certificate_id = certificate_id unless certificate_id == SKIP @certificate_name = certificate_name unless certificate_name == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#certificate_id ⇒ String
Customer certificate or passport identifier.
22 23 24 |
# File 'lib/univapay_client_sdk/models/customs_declaration_webhook_declaration.rb', line 22 def certificate_id @certificate_id end |
#certificate_name ⇒ String
Customer name as provided to customs.
26 27 28 |
# File 'lib/univapay_client_sdk/models/customs_declaration_webhook_declaration.rb', line 26 def certificate_name @certificate_name end |
#customs ⇒ String
WeChat customs authority code.
14 15 16 |
# File 'lib/univapay_client_sdk/models/customs_declaration_webhook_declaration.rb', line 14 def customs @customs end |
#merchant_customs_no ⇒ String
Merchant customs registration number.
18 19 20 |
# File 'lib/univapay_client_sdk/models/customs_declaration_webhook_declaration.rb', line 18 def merchant_customs_no @merchant_customs_no end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/univapay_client_sdk/models/customs_declaration_webhook_declaration.rb', line 67 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. customs = hash.key?('customs') ? hash['customs'] : SKIP merchant_customs_no = hash.key?('merchant_customs_no') ? hash['merchant_customs_no'] : SKIP certificate_id = hash.key?('certificate_id') ? hash['certificate_id'] : SKIP certificate_name = hash.key?('certificate_name') ? hash['certificate_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. CustomsDeclarationWebhookDeclaration.new(customs: customs, merchant_customs_no: merchant_customs_no, certificate_id: certificate_id, certificate_name: certificate_name, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/univapay_client_sdk/models/customs_declaration_webhook_declaration.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['customs'] = 'customs' @_hash['merchant_customs_no'] = 'merchant_customs_no' @_hash['certificate_id'] = 'certificate_id' @_hash['certificate_name'] = 'certificate_name' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/univapay_client_sdk/models/customs_declaration_webhook_declaration.rb', line 49 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 44 45 46 |
# File 'lib/univapay_client_sdk/models/customs_declaration_webhook_declaration.rb', line 39 def self.optionals %w[ customs merchant_customs_no certificate_id certificate_name ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
96 97 98 99 100 101 102 |
# File 'lib/univapay_client_sdk/models/customs_declaration_webhook_declaration.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
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
113 114 115 116 117 118 119 |
# File 'lib/univapay_client_sdk/models/customs_declaration_webhook_declaration.rb', line 113 def inspect class_name = self.class.name.split('::').last "<#{class_name} customs: #{@customs.inspect}, merchant_customs_no:"\ " #{@merchant_customs_no.inspect}, certificate_id: #{@certificate_id.inspect},"\ " certificate_name: #{@certificate_name.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
105 106 107 108 109 110 |
# File 'lib/univapay_client_sdk/models/customs_declaration_webhook_declaration.rb', line 105 def to_s class_name = self.class.name.split('::').last "<#{class_name} customs: #{@customs}, merchant_customs_no: #{@merchant_customs_no},"\ " certificate_id: #{@certificate_id}, certificate_name: #{@certificate_name},"\ " additional_properties: #{@additional_properties}>" end |