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.



21488
21489
21490
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21488

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



21486
21487
21488
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21486

def value
  @value
end

Class Method Details

.ALLObject



21508
21509
21510
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21508

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



21493
21494
21495
21496
21497
21498
21499
21500
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21493

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



21520
21521
21522
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21520

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



21503
21504
21505
21506
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21503

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

.pendingObject



21512
21513
21514
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21512

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

.successObject



21516
21517
21518
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21516

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

Instance Method Details

#to_hashObject



21524
21525
21526
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21524

def to_hash
  value
end