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.



14047
14048
14049
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14047

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



14045
14046
14047
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14045

def value
  @value
end

Class Method Details

.ALLObject



14067
14068
14069
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14067

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



14052
14053
14054
14055
14056
14057
14058
14059
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14052

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



14079
14080
14081
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14079

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



14062
14063
14064
14065
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14062

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

.pendingObject



14071
14072
14073
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14071

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

.successObject



14075
14076
14077
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14075

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

Instance Method Details

#to_hashObject



14083
14084
14085
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14083

def to_hash
  value
end