Class: Io::Flow::V0::Models::UpdatePolicy

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

Returns a new instance of UpdatePolicy.



13824
13825
13826
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13824

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13822
13823
13824
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13822

def value
  @value
end

Class Method Details

.ALLObject



13844
13845
13846
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13844

def UpdatePolicy.ALL
  @@all ||= [UpdatePolicy.auto, UpdatePolicy.queue, UpdatePolicy.discard]
end

.apply(value) ⇒ Object

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



13829
13830
13831
13832
13833
13834
13835
13836
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13829

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

.autoObject



13848
13849
13850
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13848

def UpdatePolicy.auto
  @@_auto ||= UpdatePolicy.new('auto')
end

.discardObject



13857
13858
13859
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13857

def UpdatePolicy.discard
  @@_discard ||= UpdatePolicy.new('discard')
end

.from_string(value) ⇒ Object

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



13839
13840
13841
13842
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13839

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

.queueObject

Queue item update for approval.



13853
13854
13855
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13853

def UpdatePolicy.queue
  @@_queue ||= UpdatePolicy.new('queue')
end

Instance Method Details

#to_hashObject



13861
13862
13863
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13861

def to_hash
  value
end