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.



23756
23757
23758
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23756

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



23754
23755
23756
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23754

def value
  @value
end

Class Method Details

.ALLObject



23776
23777
23778
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23776

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



23761
23762
23763
23764
23765
23766
23767
23768
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23761

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



23771
23772
23773
23774
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23771

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



23788
23789
23790
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23788

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



23782
23783
23784
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23782

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

Instance Method Details

#to_hashObject



23792
23793
23794
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23792

def to_hash
  value
end