Class: Io::Flow::V0::Models::EntityIdentifierType

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



17836
17837
17838
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17836

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17834
17835
17836
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17834

def value
  @value
end

Class Method Details

.ALLObject



17856
17857
17858
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17856

def EntityIdentifierType.ALL
  @@all ||= [EntityIdentifierType.ioss, EntityIdentifierType.voec]
end

.apply(value) ⇒ Object

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



17841
17842
17843
17844
17845
17846
17847
17848
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17841

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

.from_string(value) ⇒ Object

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



17851
17852
17853
17854
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17851

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

.iossObject

The Import One-Stop Shop (IOSS) to comply with VAT on imported goods. see: ec.europa.eu/taxation_customs/business/vat/ioss_en



17862
17863
17864
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17862

def EntityIdentifierType.ioss
  @@_ioss ||= EntityIdentifierType.new('ioss')
end

.voecObject

The VAT on Electronic Commerce (VOEC) to comply with VAT on imported goods. see: www.skatteetaten.no/globalassets/bedrift-og-organisasjon/voec/voec-guidelines-20200807.pdf



17869
17870
17871
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17869

def EntityIdentifierType.voec
  @@_voec ||= EntityIdentifierType.new('voec')
end

Instance Method Details

#to_hashObject



17873
17874
17875
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17873

def to_hash
  value
end