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.



24939
24940
24941
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24939

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



24937
24938
24939
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24937

def value
  @value
end

Class Method Details

.ALLObject



24959
24960
24961
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24959

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



24944
24945
24946
24947
24948
24949
24950
24951
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24944

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



24954
24955
24956
24957
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24954

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



24971
24972
24973
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24971

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



24965
24966
24967
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24965

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

Instance Method Details

#to_hashObject



24975
24976
24977
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24975

def to_hash
  value
end