Class: UnivapayClientSdk::MerchantWebhookLimitRefundBySalesConfiguration
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- UnivapayClientSdk::MerchantWebhookLimitRefundBySalesConfiguration
- Defined in:
- lib/univapay_client_sdk/models/merchant_webhook_limit_refund_by_sales_configuration.rb
Overview
Refund-limiting configuration based on sales history.
Instance Attribute Summary collapse
-
#enabled ⇒ TrueClass | FalseClass
Enables sales-based refund limit checks.
-
#period ⇒ String
Sales aggregation period used to evaluate refund limits.
-
#rolling_window ⇒ TrueClass | FalseClass
Uses a rolling window instead of fixed calendar periods.
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(enabled: SKIP, period: SKIP, rolling_window: SKIP, additional_properties: nil) ⇒ MerchantWebhookLimitRefundBySalesConfiguration
constructor
A new instance of MerchantWebhookLimitRefundBySalesConfiguration.
-
#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(enabled: SKIP, period: SKIP, rolling_window: SKIP, additional_properties: nil) ⇒ MerchantWebhookLimitRefundBySalesConfiguration
Returns a new instance of MerchantWebhookLimitRefundBySalesConfiguration.
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_limit_refund_by_sales_configuration.rb', line 51 def initialize(enabled: SKIP, period: SKIP, rolling_window: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @enabled = enabled unless enabled == SKIP @period = period unless period == SKIP @rolling_window = rolling_window unless rolling_window == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#enabled ⇒ TrueClass | FalseClass
Enables sales-based refund limit checks.
14 15 16 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_limit_refund_by_sales_configuration.rb', line 14 def enabled @enabled end |
#period ⇒ String
Sales aggregation period used to evaluate refund limits.
18 19 20 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_limit_refund_by_sales_configuration.rb', line 18 def period @period end |
#rolling_window ⇒ TrueClass | FalseClass
Uses a rolling window instead of fixed calendar periods.
22 23 24 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_limit_refund_by_sales_configuration.rb', line 22 def rolling_window @rolling_window end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_limit_refund_by_sales_configuration.rb', line 63 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. enabled = hash.key?('enabled') ? hash['enabled'] : SKIP period = hash.key?('period') ? hash['period'] : SKIP rolling_window = hash.key?('rolling_window') ? hash['rolling_window'] : 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. MerchantWebhookLimitRefundBySalesConfiguration.new(enabled: enabled, period: period, rolling_window: rolling_window, 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/merchant_webhook_limit_refund_by_sales_configuration.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['enabled'] = 'enabled' @_hash['period'] = 'period' @_hash['rolling_window'] = 'rolling_window' @_hash end |
.nullables ⇒ Object
An array for nullable fields
43 44 45 46 47 48 49 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_limit_refund_by_sales_configuration.rb', line 43 def self.nullables %w[ enabled period rolling_window ] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 37 38 39 40 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_limit_refund_by_sales_configuration.rb', line 34 def self.optionals %w[ enabled period rolling_window ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
94 95 96 97 98 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_limit_refund_by_sales_configuration.rb', line 94 def inspect class_name = self.class.name.split('::').last "<#{class_name} enabled: #{@enabled.inspect}, period: #{@period.inspect}, rolling_window:"\ " #{@rolling_window.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
87 88 89 90 91 |
# File 'lib/univapay_client_sdk/models/merchant_webhook_limit_refund_by_sales_configuration.rb', line 87 def to_s class_name = self.class.name.split('::').last "<#{class_name} enabled: #{@enabled}, period: #{@period}, rolling_window:"\ " #{@rolling_window}, additional_properties: #{@additional_properties}>" end |