Class: Io::Flow::V0::Models::SyncStreamType

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

Returns a new instance of SyncStreamType.



20447
20448
20449
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20447

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



20445
20446
20447
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20445

def value
  @value
end

Class Method Details

.ALLObject



20467
20468
20469
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20467

def SyncStreamType.ALL
  @@all ||= [SyncStreamType., SyncStreamType.placed_order]
end

.apply(value) ⇒ Object

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



20452
20453
20454
20455
20456
20457
20458
20459
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20452

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

.from_string(value) ⇒ Object

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



20462
20463
20464
20465
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20462

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

.placed_orderObject

Represents a sync stream of placed orders - ie each record reported represents a placed order



20479
20480
20481
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20479

def SyncStreamType.placed_order
  @@_placed_order ||= SyncStreamType.new('placed_order')
end

.submitted_orderObject

Represents a sync stream of submitted orders - ie each record reported represents a submitted order



20473
20474
20475
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20473

def SyncStreamType.
   ||= SyncStreamType.new('submitted_order')
end

Instance Method Details

#to_hashObject



20483
20484
20485
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20483

def to_hash
  value
end