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.



19816
19817
19818
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19816

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



19814
19815
19816
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19814

def value
  @value
end

Class Method Details

.ALLObject



19836
19837
19838
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19836

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



19821
19822
19823
19824
19825
19826
19827
19828
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19821

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



19831
19832
19833
19834
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19831

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



19848
19849
19850
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19848

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



19842
19843
19844
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19842

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

Instance Method Details

#to_hashObject



19852
19853
19854
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19852

def to_hash
  value
end