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.



9029
9030
9031
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9029

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9027
9028
9029
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9027

def value
  @value
end

Class Method Details

.ALLObject



9049
9050
9051
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9049

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



9034
9035
9036
9037
9038
9039
9040
9041
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9034

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



9061
9062
9063
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9061

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



9044
9045
9046
9047
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9044

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

.pendingObject



9053
9054
9055
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9053

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

.successObject



9057
9058
9059
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9057

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

Instance Method Details

#to_hashObject



9065
9066
9067
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9065

def to_hash
  value
end