Class: UnivapayClientSdk::SubscriptionTerminateWithStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/univapay_client_sdk/models/subscription_terminate_with_status.rb

Overview

The status to transition the subscription to on the next payment date.

Constant Summary collapse

SUBSCRIPTION_TERMINATE_WITH_STATUS =
[
  # TODO: Write general description for SUSPENDED
  SUSPENDED = 'suspended'.freeze,

  # TODO: Write general description for CANCELED
  CANCELED = 'canceled'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = SUSPENDED) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/univapay_client_sdk/models/subscription_terminate_with_status.rb', line 23

def self.from_value(value, default_value = SUSPENDED)
  return default_value if value.nil?

  str = value.to_s.strip

  case str.downcase
  when 'suspended' then SUSPENDED
  when 'canceled' then CANCELED
  else
    default_value
  end
end

.validate(value) ⇒ Object



17
18
19
20
21
# File 'lib/univapay_client_sdk/models/subscription_terminate_with_status.rb', line 17

def self.validate(value)
  return false if value.nil?

  SUBSCRIPTION_TERMINATE_WITH_STATUS.include?(value)
end