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.



21345
21346
21347
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21345

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



21343
21344
21345
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21343

def value
  @value
end

Class Method Details

.ALLObject



21365
21366
21367
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21365

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



21350
21351
21352
21353
21354
21355
21356
21357
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21350

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



21377
21378
21379
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21377

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



21360
21361
21362
21363
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21360

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

.pendingObject



21369
21370
21371
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21369

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

.successObject



21373
21374
21375
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21373

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

Instance Method Details

#to_hashObject



21381
21382
21383
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21381

def to_hash
  value
end