Class: Io::Flow::V0::Models::LabelTriggerMethod

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) ⇒ LabelTriggerMethod

Returns a new instance of LabelTriggerMethod.



21895
21896
21897
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21895

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



21893
21894
21895
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21893

def value
  @value
end

Class Method Details

.ALLObject



21915
21916
21917
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21915

def LabelTriggerMethod.ALL
  @@all ||= [LabelTriggerMethod.autogenerated, LabelTriggerMethod.on_demand]
end

.apply(value) ⇒ Object

Returns the instance of LabelTriggerMethod for this value, creating a new instance for an unknown value



21900
21901
21902
21903
21904
21905
21906
21907
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21900

def LabelTriggerMethod.apply(value)
  if value.instance_of?(LabelTriggerMethod)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || LabelTriggerMethod.new(value))
  end
end

.autogeneratedObject

Label was generated as a side-effect based on some automated trigger condition



21920
21921
21922
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21920

def LabelTriggerMethod.autogenerated
  @@_autogenerated ||= LabelTriggerMethod.new('autogenerated')
end

.from_string(value) ⇒ Object

Returns the instance of LabelTriggerMethod for this value, or nil if not found



21910
21911
21912
21913
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21910

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

.on_demandObject

Label was generated by an intentional internal or external actor



21925
21926
21927
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21925

def LabelTriggerMethod.on_demand
  @@_on_demand ||= LabelTriggerMethod.new('on_demand')
end

Instance Method Details

#to_hashObject



21929
21930
21931
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21929

def to_hash
  value
end