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.



24712
24713
24714
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24712

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



24710
24711
24712
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24710

def value
  @value
end

Class Method Details

.ALLObject



24732
24733
24734
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24732

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



24717
24718
24719
24720
24721
24722
24723
24724
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24717

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



24736
24737
24738
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24736

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

.discardObject



24745
24746
24747
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24745

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



24727
24728
24729
24730
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24727

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.



24741
24742
24743
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24741

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

Instance Method Details

#to_hashObject



24749
24750
24751
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24749

def to_hash
  value
end