Class: Nfe::Generated::CalculoImpostosV1::CalculateItemRequest

Inherits:
Data
  • Object
show all
Defined in:
lib/nfe/generated/calculo_impostos_v1/calculate_item_request.rb,
sig/nfe/generated/calculo_impostos_v1/calculate_item_request.rbs

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCalculateItemRequest

Returns a new instance of CalculateItemRequest.

Parameters:

  • acquisition_purpose: (String, nil)
  • benefit: (String, nil)
  • cest: (String, nil)
  • discount_amount: (Float, nil)
  • ex_tipi: (String, nil)
  • freight_amount: (Float, nil)
  • gtin: (String, nil)
  • icms: (Icms)
  • id: (String)
  • ii: (Ii)
  • insurance_amount: (Float, nil)
  • issuer_tax_profile: (String, nil)
  • ncm: (String, nil)
  • operation_code: (Integer)
  • origin: (Object)
  • others_amount: (Float, nil)
  • quantity: (Float)
  • recipient_tax_profile: (String, nil)
  • sku: (String, nil)
  • unit_amount: (Float)


30
# File 'sig/nfe/generated/calculo_impostos_v1/calculate_item_request.rbs', line 30

def initialize: (?acquisition_purpose: String?, ?benefit: String?, ?cest: String?, ?discount_amount: Float?, ?ex_tipi: String?, ?freight_amount: Float?, ?gtin: String?, ?icms: Icms, id: String, ?ii: Ii, ?insurance_amount: Float?, ?issuer_tax_profile: String?, ?ncm: String?, operation_code: Integer, origin: untyped, ?others_amount: Float?, quantity: Float, ?recipient_tax_profile: String?, ?sku: String?, unit_amount: Float) -> void

Instance Attribute Details

#acquisition_purposeObject (readonly)

Returns the value of attribute acquisition_purpose

Returns:

  • (Object)

    the current value of acquisition_purpose



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/calculate_item_request.rb', line 9

def acquisition_purpose
  @acquisition_purpose
end

#benefitObject (readonly)

Returns the value of attribute benefit

Returns:

  • (Object)

    the current value of benefit



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/calculate_item_request.rb', line 9

def benefit
  @benefit
end

#cestObject (readonly)

Returns the value of attribute cest

Returns:

  • (Object)

    the current value of cest



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/calculate_item_request.rb', line 9

def cest
  @cest
end

#discount_amountObject (readonly)

Returns the value of attribute discount_amount

Returns:

  • (Object)

    the current value of discount_amount



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/calculate_item_request.rb', line 9

def discount_amount
  @discount_amount
end

#ex_tipiObject (readonly)

Returns the value of attribute ex_tipi

Returns:

  • (Object)

    the current value of ex_tipi



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/calculate_item_request.rb', line 9

def ex_tipi
  @ex_tipi
end

#freight_amountObject (readonly)

Returns the value of attribute freight_amount

Returns:

  • (Object)

    the current value of freight_amount



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/calculate_item_request.rb', line 9

def freight_amount
  @freight_amount
end

#gtinObject (readonly)

Returns the value of attribute gtin

Returns:

  • (Object)

    the current value of gtin



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/calculate_item_request.rb', line 9

def gtin
  @gtin
end

#icmsObject (readonly)

Returns the value of attribute icms

Returns:

  • (Object)

    the current value of icms



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/calculate_item_request.rb', line 9

def icms
  @icms
end

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/calculate_item_request.rb', line 9

def id
  @id
end

#iiObject (readonly)

Returns the value of attribute ii

Returns:

  • (Object)

    the current value of ii



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/calculate_item_request.rb', line 9

def ii
  @ii
end

#insurance_amountObject (readonly)

Returns the value of attribute insurance_amount

Returns:

  • (Object)

    the current value of insurance_amount



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/calculate_item_request.rb', line 9

def insurance_amount
  @insurance_amount
end

#issuer_tax_profileObject (readonly)

Returns the value of attribute issuer_tax_profile

Returns:

  • (Object)

    the current value of issuer_tax_profile



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/calculate_item_request.rb', line 9

def issuer_tax_profile
  @issuer_tax_profile
end

#ncmObject (readonly)

Returns the value of attribute ncm

Returns:

  • (Object)

    the current value of ncm



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/calculate_item_request.rb', line 9

def ncm
  @ncm
end

#operation_codeObject (readonly)

Returns the value of attribute operation_code

Returns:

  • (Object)

    the current value of operation_code



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/calculate_item_request.rb', line 9

def operation_code
  @operation_code
end

#originObject (readonly)

Returns the value of attribute origin

Returns:

  • (Object)

    the current value of origin



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/calculate_item_request.rb', line 9

def origin
  @origin
end

#others_amountObject (readonly)

Returns the value of attribute others_amount

Returns:

  • (Object)

    the current value of others_amount



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/calculate_item_request.rb', line 9

def others_amount
  @others_amount
end

#quantityObject (readonly)

Returns the value of attribute quantity

Returns:

  • (Object)

    the current value of quantity



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/calculate_item_request.rb', line 9

def quantity
  @quantity
end

#recipient_tax_profileObject (readonly)

Returns the value of attribute recipient_tax_profile

Returns:

  • (Object)

    the current value of recipient_tax_profile



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/calculate_item_request.rb', line 9

def recipient_tax_profile
  @recipient_tax_profile
end

#skuObject (readonly)

Returns the value of attribute sku

Returns:

  • (Object)

    the current value of sku



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/calculate_item_request.rb', line 9

def sku
  @sku
end

#unit_amountObject (readonly)

Returns the value of attribute unit_amount

Returns:

  • (Object)

    the current value of unit_amount



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/calculate_item_request.rb', line 9

def unit_amount
  @unit_amount
end

Class Method Details

.from_api(payload) ⇒ instance?

Parameters:

  • payload (Hash[String, untyped], nil)

Returns:

  • (instance, nil)


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/nfe/generated/calculo_impostos_v1/calculate_item_request.rb', line 10

def self.from_api(payload)
  return nil if payload.nil?

  new(
    acquisition_purpose: payload["acquisitionPurpose"],
    benefit: payload["benefit"],
    cest: payload["cest"],
    discount_amount: payload["discountAmount"],
    ex_tipi: payload["exTipi"],
    freight_amount: payload["freightAmount"],
    gtin: payload["gtin"],
    icms: Icms.from_api(payload["icms"]),
    id: payload["id"],
    ii: Ii.from_api(payload["ii"]),
    insurance_amount: payload["insuranceAmount"],
    issuer_tax_profile: payload["issuerTaxProfile"],
    ncm: payload["ncm"],
    operation_code: payload["operationCode"],
    origin: payload["origin"],
    others_amount: payload["othersAmount"],
    quantity: payload["quantity"],
    recipient_tax_profile: payload["recipientTaxProfile"],
    sku: payload["sku"],
    unit_amount: payload["unitAmount"],
  )
end

.newinstance

Parameters:

  • acquisition_purpose: (String, nil)
  • benefit: (String, nil)
  • cest: (String, nil)
  • discount_amount: (Float, nil)
  • ex_tipi: (String, nil)
  • freight_amount: (Float, nil)
  • gtin: (String, nil)
  • icms: (Icms)
  • id: (String)
  • ii: (Ii)
  • insurance_amount: (Float, nil)
  • issuer_tax_profile: (String, nil)
  • ncm: (String, nil)
  • operation_code: (Integer)
  • origin: (Object)
  • others_amount: (Float, nil)
  • quantity: (Float)
  • recipient_tax_profile: (String, nil)
  • sku: (String, nil)
  • unit_amount: (Float)

Returns:

  • (instance)


29
# File 'sig/nfe/generated/calculo_impostos_v1/calculate_item_request.rbs', line 29

def self.new: (?acquisition_purpose: String?, ?benefit: String?, ?cest: String?, ?discount_amount: Float?, ?ex_tipi: String?, ?freight_amount: Float?, ?gtin: String?, ?icms: Icms, id: String, ?ii: Ii, ?insurance_amount: Float?, ?issuer_tax_profile: String?, ?ncm: String?, operation_code: Integer, origin: untyped, ?others_amount: Float?, quantity: Float, ?recipient_tax_profile: String?, ?sku: String?, unit_amount: Float) -> instance