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.



20814
20815
20816
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20814

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



20812
20813
20814
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20812

def value
  @value
end

Class Method Details

.ALLObject



20834
20835
20836
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20834

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



20819
20820
20821
20822
20823
20824
20825
20826
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20819

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



20829
20830
20831
20832
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20829

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



20846
20847
20848
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20846

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



20840
20841
20842
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20840

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

Instance Method Details

#to_hashObject



20850
20851
20852
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20850

def to_hash
  value
end