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.



11229
11230
11231
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11229

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



11227
11228
11229
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11227

def value
  @value
end

Class Method Details

.ALLObject



11249
11250
11251
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11249

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



11234
11235
11236
11237
11238
11239
11240
11241
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11234

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



11261
11262
11263
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11261

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



11244
11245
11246
11247
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11244

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

.pendingObject



11253
11254
11255
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11253

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

.successObject



11257
11258
11259
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11257

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

Instance Method Details

#to_hashObject



11265
11266
11267
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11265

def to_hash
  value
end