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.



13281
13282
13283
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13281

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13279
13280
13281
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13279

def value
  @value
end

Class Method Details

.ALLObject



13301
13302
13303
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13301

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



13286
13287
13288
13289
13290
13291
13292
13293
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13286

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



13305
13306
13307
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13305

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

.discardObject



13314
13315
13316
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13314

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



13296
13297
13298
13299
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13296

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.



13310
13311
13312
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13310

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

Instance Method Details

#to_hashObject



13318
13319
13320
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13318

def to_hash
  value
end