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.



16243
16244
16245
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16243

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16241
16242
16243
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16241

def value
  @value
end

Class Method Details

.ALLObject



16263
16264
16265
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16263

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



16248
16249
16250
16251
16252
16253
16254
16255
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16248

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



16275
16276
16277
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16275

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



16258
16259
16260
16261
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16258

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

.pendingObject



16267
16268
16269
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16267

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

.successObject



16271
16272
16273
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16271

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

Instance Method Details

#to_hashObject



16279
16280
16281
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16279

def to_hash
  value
end