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.



21439
21440
21441
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21439

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



21437
21438
21439
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21437

def value
  @value
end

Class Method Details

.ALLObject



21459
21460
21461
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21459

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



21444
21445
21446
21447
21448
21449
21450
21451
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21444

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



21471
21472
21473
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21471

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



21454
21455
21456
21457
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21454

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

.pendingObject



21463
21464
21465
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21463

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

.successObject



21467
21468
21469
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21467

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

Instance Method Details

#to_hashObject



21475
21476
21477
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21475

def to_hash
  value
end