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.



21265
21266
21267
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21265

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



21263
21264
21265
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21263

def value
  @value
end

Class Method Details

.ALLObject



21285
21286
21287
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21285

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



21270
21271
21272
21273
21274
21275
21276
21277
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21270

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



21289
21290
21291
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21289

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

.discardObject



21298
21299
21300
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21298

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



21280
21281
21282
21283
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21280

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.



21294
21295
21296
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21294

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

Instance Method Details

#to_hashObject



21302
21303
21304
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21302

def to_hash
  value
end