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.



22130
22131
22132
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22130

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



22128
22129
22130
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22128

def value
  @value
end

Class Method Details

.ALLObject



22150
22151
22152
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22150

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



22135
22136
22137
22138
22139
22140
22141
22142
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22135

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



22162
22163
22164
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22162

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



22145
22146
22147
22148
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22145

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

.pendingObject



22154
22155
22156
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22154

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

.successObject



22158
22159
22160
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22158

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

Instance Method Details

#to_hashObject



22166
22167
22168
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22166

def to_hash
  value
end