Class: Nfe::Generated::CalculoImpostosV1::CalculateRequest

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCalculateRequest

Returns a new instance of CalculateRequest.

Parameters:



16
# File 'sig/nfe/generated/calculo_impostos_v1/calculate_request.rbs', line 16

def initialize: (?collection_id: String?, ?is_product_registration: bool, issuer: CalculateRequestIssuer, items: Array[CalculateItemRequest], operation_type: untyped, recipient: CalculateRequestRecipient) -> void

Instance Attribute Details

#collection_idObject (readonly)

Returns the value of attribute collection_id

Returns:

  • (Object)

    the current value of collection_id



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

def collection_id
  @collection_id
end

#is_product_registrationObject (readonly)

Returns the value of attribute is_product_registration

Returns:

  • (Object)

    the current value of is_product_registration



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

def is_product_registration
  @is_product_registration
end

#issuerObject (readonly)

Returns the value of attribute issuer

Returns:

  • (Object)

    the current value of issuer



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

def issuer
  @issuer
end

#itemsObject (readonly)

Returns the value of attribute items

Returns:

  • (Object)

    the current value of items



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

def items
  @items
end

#operation_typeObject (readonly)

Returns the value of attribute operation_type

Returns:

  • (Object)

    the current value of operation_type



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

def operation_type
  @operation_type
end

#recipientObject (readonly)

Returns the value of attribute recipient

Returns:

  • (Object)

    the current value of recipient



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

def recipient
  @recipient
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
# File 'lib/nfe/generated/calculo_impostos_v1/calculate_request.rb', line 10

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

  new(
    collection_id: payload["collectionId"],
    is_product_registration: payload["isProductRegistration"],
    issuer: CalculateRequestIssuer.from_api(payload["issuer"]),
    items: (payload["items"] || []).map { |e| CalculateItemRequest.from_api(e) },
    operation_type: payload["operationType"],
    recipient: CalculateRequestRecipient.from_api(payload["recipient"]),
  )
end

.newinstance

Parameters:

Returns:

  • (instance)


15
# File 'sig/nfe/generated/calculo_impostos_v1/calculate_request.rbs', line 15

def self.new: (?collection_id: String?, ?is_product_registration: bool, issuer: CalculateRequestIssuer, items: Array[CalculateItemRequest], operation_type: untyped, recipient: CalculateRequestRecipient) -> instance