Class: Io::Flow::V0::Models::WebhookStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ WebhookStatus

Returns a new instance of WebhookStatus.



15573
15574
15575
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15573

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15571
15572
15573
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15571

def value
  @value
end

Class Method Details

.ALLObject



15593
15594
15595
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15593

def WebhookStatus.ALL
  @@all ||= [WebhookStatus.pending, WebhookStatus.success, WebhookStatus.failure]
end

.apply(value) ⇒ Object

Returns the instance of WebhookStatus for this value, creating a new instance for an unknown value



15578
15579
15580
15581
15582
15583
15584
15585
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15578

def WebhookStatus.apply(value)
  if value.instance_of?(WebhookStatus)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || WebhookStatus.new(value))
  end
end

.failureObject



15605
15606
15607
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15605

def WebhookStatus.failure
  @@_failure ||= WebhookStatus.new('failure')
end

.from_string(value) ⇒ Object

Returns the instance of WebhookStatus for this value, or nil if not found



15588
15589
15590
15591
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15588

def WebhookStatus.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  WebhookStatus.ALL.find { |v| v.value == value }
end

.pendingObject



15597
15598
15599
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15597

def WebhookStatus.pending
  @@_pending ||= WebhookStatus.new('pending')
end

.successObject



15601
15602
15603
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15601

def WebhookStatus.success
  @@_success ||= WebhookStatus.new('success')
end

Instance Method Details

#to_hashObject



15609
15610
15611
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15609

def to_hash
  value
end