Class: Io::Flow::V0::Models::WebhookRequestStatus

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) ⇒ WebhookRequestStatus

Returns a new instance of WebhookRequestStatus.



5891
5892
5893
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5891

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



5889
5890
5891
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5889

def value
  @value
end

Class Method Details

.ALLObject



5911
5912
5913
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5911

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

.apply(value) ⇒ Object

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



5896
5897
5898
5899
5900
5901
5902
5903
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5896

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

.failureObject



5923
5924
5925
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5923

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

.from_string(value) ⇒ Object

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



5906
5907
5908
5909
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5906

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

.pendingObject



5915
5916
5917
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5915

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

.successObject



5919
5920
5921
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5919

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

Instance Method Details

#to_hashObject



5927
5928
5929
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5927

def to_hash
  value
end