Class: VisaAcceptanceMergedSpec::SellerProtection
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- VisaAcceptanceMergedSpec::SellerProtection
- Defined in:
- lib/visa_acceptance_merged_spec/models/seller_protection.rb
Overview
SellerProtection Model.
Instance Attribute Summary collapse
-
#dispute_categories ⇒ Array[String]
An array of conditions that are covered for the transaction.
-
#eligibility ⇒ String
Indicates whether the transaction is eligible for seller protection.
-
#eligibility_type ⇒ String
The kind of seller protection in force for the transaction.
-
#type ⇒ String
The kind of seller protection in force for the transaction.
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.
Instance Method Summary collapse
-
#initialize(type: SKIP, eligibility: SKIP, dispute_categories: SKIP, eligibility_type: SKIP, additional_properties: nil) ⇒ SellerProtection
constructor
A new instance of SellerProtection.
-
#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(type: SKIP, eligibility: SKIP, dispute_categories: SKIP, eligibility_type: SKIP, additional_properties: nil) ⇒ SellerProtection
Returns a new instance of SellerProtection.
75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/visa_acceptance_merged_spec/models/seller_protection.rb', line 75 def initialize(type: SKIP, eligibility: SKIP, dispute_categories: SKIP, eligibility_type: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @type = type unless type == SKIP @eligibility = eligibility unless eligibility == SKIP @dispute_categories = dispute_categories unless dispute_categories == SKIP @eligibility_type = eligibility_type unless eligibility_type == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#dispute_categories ⇒ Array[String]
An array of conditions that are covered for the transaction.
36 37 38 |
# File 'lib/visa_acceptance_merged_spec/models/seller_protection.rb', line 36 def dispute_categories @dispute_categories end |
#eligibility ⇒ String
Indicates whether the transaction is eligible for seller protection. The values returned are described below. Possible values:
ELIGIBLEPARTIALLY_ELIGIBLEINELIGIBLENOT_ELIGIBLE
32 33 34 |
# File 'lib/visa_acceptance_merged_spec/models/seller_protection.rb', line 32 def eligibility @eligibility end |
#eligibility_type ⇒ String
The kind of seller protection in force for the transaction. This field is returned only when the protection_eligibility property is set to ELIGIBLE or PARTIALLY_ELIGIBLE. Possible values:
ITEM_NOT_RECEIVED_ELIGIBLE: Sellers are protected against claims for items not received.UNAUTHORIZED_PAYMENT_ELIGIBLE: Sellers are protected against claims for unauthorized payments.One or both values can be returned.
48 49 50 |
# File 'lib/visa_acceptance_merged_spec/models/seller_protection.rb', line 48 def eligibility_type @eligibility_type end |
#type ⇒ String
The kind of seller protection in force for the transaction. This field is returned only when the protection eligibility value is set to ELIGIBLE or PARTIALLY_ELIGIBLE. Possible values
- ITEM_NOT_RECEIVED_ELIGIBLE: Sellers are protected against claims for items not received.
- UNAUTHORIZED_PAYMENT_ELIGIBLE: Sellers are protected against claims for unauthorized payments. One or both values can be returned.
22 23 24 |
# File 'lib/visa_acceptance_merged_spec/models/seller_protection.rb', line 22 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/visa_acceptance_merged_spec/models/seller_protection.rb', line 88 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. type = hash.key?('type') ? hash['type'] : SKIP eligibility = hash.key?('eligibility') ? hash['eligibility'] : SKIP dispute_categories = hash.key?('disputeCategories') ? hash['disputeCategories'] : SKIP eligibility_type = hash.key?('eligibilityType') ? hash['eligibilityType'] : 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. SellerProtection.new(type: type, eligibility: eligibility, dispute_categories: dispute_categories, eligibility_type: eligibility_type, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
51 52 53 54 55 56 57 58 |
# File 'lib/visa_acceptance_merged_spec/models/seller_protection.rb', line 51 def self.names @_hash = {} if @_hash.nil? @_hash['type'] = 'type' @_hash['eligibility'] = 'eligibility' @_hash['dispute_categories'] = 'disputeCategories' @_hash['eligibility_type'] = 'eligibilityType' @_hash end |
.nullables ⇒ Object
An array for nullable fields
71 72 73 |
# File 'lib/visa_acceptance_merged_spec/models/seller_protection.rb', line 71 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
61 62 63 64 65 66 67 68 |
# File 'lib/visa_acceptance_merged_spec/models/seller_protection.rb', line 61 def self.optionals %w[ type eligibility dispute_categories eligibility_type ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
123 124 125 126 127 128 |
# File 'lib/visa_acceptance_merged_spec/models/seller_protection.rb', line 123 def inspect class_name = self.class.name.split('::').last "<#{class_name} type: #{@type.inspect}, eligibility: #{@eligibility.inspect},"\ " dispute_categories: #{@dispute_categories.inspect}, eligibility_type:"\ " #{@eligibility_type.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
115 116 117 118 119 120 |
# File 'lib/visa_acceptance_merged_spec/models/seller_protection.rb', line 115 def to_s class_name = self.class.name.split('::').last "<#{class_name} type: #{@type}, eligibility: #{@eligibility}, dispute_categories:"\ " #{@dispute_categories}, eligibility_type: #{@eligibility_type}, additional_properties:"\ " #{@additional_properties}>" end |