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

Returns a new instance of EntityIdentifierType.



19206
19207
19208
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19206

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



19204
19205
19206
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19204

def value
  @value
end

Class Method Details

.ALLObject



19226
19227
19228
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19226

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



19211
19212
19213
19214
19215
19216
19217
19218
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19211

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



19221
19222
19223
19224
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19221

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



19232
19233
19234
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19232

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



19239
19240
19241
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19239

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

Instance Method Details

#to_hashObject



19243
19244
19245
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19243

def to_hash
  value
end