Class: UnivapayClientSdk::MerchantWebhookLimitRefundBySalesConfiguration

Inherits:
BaseModel
  • Object
show all
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

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(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

#enabledTrueClass | FalseClass

Enables sales-based refund limit checks.

Returns:

  • (TrueClass | FalseClass)


14
15
16
# File 'lib/univapay_client_sdk/models/merchant_webhook_limit_refund_by_sales_configuration.rb', line 14

def enabled
  @enabled
end

#periodString

Sales aggregation period used to evaluate refund limits.

Returns:

  • (String)


18
19
20
# File 'lib/univapay_client_sdk/models/merchant_webhook_limit_refund_by_sales_configuration.rb', line 18

def period
  @period
end

#rolling_windowTrueClass | FalseClass

Uses a rolling window instead of fixed calendar periods.

Returns:

  • (TrueClass | FalseClass)


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

.namesObject

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

.nullablesObject

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

.optionalsObject

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

#inspectObject

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_sObject

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