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.



7822
7823
7824
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7822

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



7820
7821
7822
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7820

def value
  @value
end

Class Method Details

.ALLObject



7842
7843
7844
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7842

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



7827
7828
7829
7830
7831
7832
7833
7834
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7827

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



7854
7855
7856
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7854

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



7837
7838
7839
7840
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7837

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

.pendingObject



7846
7847
7848
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7846

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

.successObject



7850
7851
7852
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7850

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

Instance Method Details

#to_hashObject



7858
7859
7860
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7858

def to_hash
  value
end