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.



12032
12033
12034
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12032

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12030
12031
12032
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12030

def value
  @value
end

Class Method Details

.ALLObject



12052
12053
12054
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12052

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



12037
12038
12039
12040
12041
12042
12043
12044
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12037

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



12064
12065
12066
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12064

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



12047
12048
12049
12050
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12047

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

.pendingObject



12056
12057
12058
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12056

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

.successObject



12060
12061
12062
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12060

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

Instance Method Details

#to_hashObject



12068
12069
12070
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12068

def to_hash
  value
end