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.



16176
16177
16178
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16176

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16174
16175
16176
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16174

def value
  @value
end

Class Method Details

.ALLObject



16196
16197
16198
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16196

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



16181
16182
16183
16184
16185
16186
16187
16188
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16181

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



16208
16209
16210
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16208

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



16191
16192
16193
16194
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16191

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

.pendingObject



16200
16201
16202
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16200

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

.successObject



16204
16205
16206
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16204

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

Instance Method Details

#to_hashObject



16212
16213
16214
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16212

def to_hash
  value
end