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.



17967
17968
17969
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17967

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17965
17966
17967
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17965

def value
  @value
end

Class Method Details

.ALLObject



17987
17988
17989
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17987

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



17972
17973
17974
17975
17976
17977
17978
17979
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17972

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



17999
18000
18001
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17999

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



17982
17983
17984
17985
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17982

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

.pendingObject



17991
17992
17993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17991

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

.successObject



17995
17996
17997
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17995

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

Instance Method Details

#to_hashObject



18003
18004
18005
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18003

def to_hash
  value
end