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.



7599
7600
7601
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7599

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



7597
7598
7599
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7597

def value
  @value
end

Class Method Details

.ALLObject



7619
7620
7621
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7619

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



7604
7605
7606
7607
7608
7609
7610
7611
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7604

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



7623
7624
7625
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7623

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

.discardObject



7632
7633
7634
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7632

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



7614
7615
7616
7617
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7614

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.



7628
7629
7630
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7628

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

Instance Method Details

#to_hashObject



7636
7637
7638
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7636

def to_hash
  value
end