Class: Nfe::Generated::NfConsumidorV2::ConsumerInvoiceRequest

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConsumerInvoiceRequest

Returns a new instance of ConsumerInvoiceRequest.

Parameters:



37
# File 'sig/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rbs', line 37

def initialize: (?additional_information: AdditionalInformationResource, ?billing: BillingResource, ?buyer: BuyerResource, ?consumer_type: untyped, ?consumption_city_code: Integer?, ?contingency_justification: String?, ?contingency_on: String?, ?credit_type: untyped, ?debit_type: untyped, ?destination: untyped, ?government_purchase: GovernmentPurchaseResource, ?ibs_consumption_city_code: Integer?, ?id: String?, ?issuer: IssuerFromRequestResource, items: Array[InvoiceItemResource], ?number: Integer?, ?operation_nature: String?, ?operation_on: String?, ?operation_type: untyped, ?payment: Array[PaymentResource]?, ?presence_type: untyped, ?print_type: untyped, ?purpose_type: untyped, ?serie: Integer?, ?totals: TotalResource, ?transaction_intermediate: IntermediateResource, ?transport: TransportInformationResource) -> void

Instance Attribute Details

#additional_informationObject (readonly)

Returns the value of attribute additional_information

Returns:

  • (Object)

    the current value of additional_information



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def additional_information
  @additional_information
end

#billingObject (readonly)

Returns the value of attribute billing

Returns:

  • (Object)

    the current value of billing



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def billing
  @billing
end

#buyerObject (readonly)

Returns the value of attribute buyer

Returns:

  • (Object)

    the current value of buyer



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def buyer
  @buyer
end

#consumer_typeObject (readonly)

Returns the value of attribute consumer_type

Returns:

  • (Object)

    the current value of consumer_type



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def consumer_type
  @consumer_type
end

#consumption_city_codeObject (readonly)

Returns the value of attribute consumption_city_code

Returns:

  • (Object)

    the current value of consumption_city_code



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def consumption_city_code
  @consumption_city_code
end

#contingency_justificationObject (readonly)

Returns the value of attribute contingency_justification

Returns:

  • (Object)

    the current value of contingency_justification



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def contingency_justification
  @contingency_justification
end

#contingency_onObject (readonly)

Returns the value of attribute contingency_on

Returns:

  • (Object)

    the current value of contingency_on



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def contingency_on
  @contingency_on
end

#credit_typeObject (readonly)

Returns the value of attribute credit_type

Returns:

  • (Object)

    the current value of credit_type



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def credit_type
  @credit_type
end

#debit_typeObject (readonly)

Returns the value of attribute debit_type

Returns:

  • (Object)

    the current value of debit_type



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def debit_type
  @debit_type
end

#destinationObject (readonly)

Returns the value of attribute destination

Returns:

  • (Object)

    the current value of destination



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def destination
  @destination
end

#government_purchaseObject (readonly)

Returns the value of attribute government_purchase

Returns:

  • (Object)

    the current value of government_purchase



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def government_purchase
  @government_purchase
end

#ibs_consumption_city_codeObject (readonly)

Returns the value of attribute ibs_consumption_city_code

Returns:

  • (Object)

    the current value of ibs_consumption_city_code



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def ibs_consumption_city_code
  @ibs_consumption_city_code
end

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def id
  @id
end

#issuerObject (readonly)

Returns the value of attribute issuer

Returns:

  • (Object)

    the current value of issuer



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_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/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def items
  @items
end

#numberObject (readonly)

Returns the value of attribute number

Returns:

  • (Object)

    the current value of number



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def number
  @number
end

#operation_natureObject (readonly)

Returns the value of attribute operation_nature

Returns:

  • (Object)

    the current value of operation_nature



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def operation_nature
  @operation_nature
end

#operation_onObject (readonly)

Returns the value of attribute operation_on

Returns:

  • (Object)

    the current value of operation_on



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def operation_on
  @operation_on
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/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def operation_type
  @operation_type
end

#paymentObject (readonly)

Returns the value of attribute payment

Returns:

  • (Object)

    the current value of payment



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def payment
  @payment
end

#presence_typeObject (readonly)

Returns the value of attribute presence_type

Returns:

  • (Object)

    the current value of presence_type



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def presence_type
  @presence_type
end

Returns the value of attribute print_type

Returns:

  • (Object)

    the current value of print_type



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def print_type
  @print_type
end

#purpose_typeObject (readonly)

Returns the value of attribute purpose_type

Returns:

  • (Object)

    the current value of purpose_type



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def purpose_type
  @purpose_type
end

#serieObject (readonly)

Returns the value of attribute serie

Returns:

  • (Object)

    the current value of serie



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def serie
  @serie
end

#totalsObject (readonly)

Returns the value of attribute totals

Returns:

  • (Object)

    the current value of totals



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def totals
  @totals
end

#transaction_intermediateObject (readonly)

Returns the value of attribute transaction_intermediate

Returns:

  • (Object)

    the current value of transaction_intermediate



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def transaction_intermediate
  @transaction_intermediate
end

#transportObject (readonly)

Returns the value of attribute transport

Returns:

  • (Object)

    the current value of transport



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 9

def transport
  @transport
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
36
37
38
39
40
41
42
# File 'lib/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rb', line 10

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

  new(
    additional_information: AdditionalInformationResource.from_api(payload["additionalInformation"]),
    billing: BillingResource.from_api(payload["billing"]),
    buyer: BuyerResource.from_api(payload["buyer"]),
    consumer_type: payload["consumerType"],
    consumption_city_code: payload["consumptionCityCode"],
    contingency_justification: payload["contingencyJustification"],
    contingency_on: payload["contingencyOn"],
    credit_type: payload["creditType"],
    debit_type: payload["debitType"],
    destination: payload["destination"],
    government_purchase: GovernmentPurchaseResource.from_api(payload["governmentPurchase"]),
    ibs_consumption_city_code: payload["ibsConsumptionCityCode"],
    id: payload["id"],
    issuer: IssuerFromRequestResource.from_api(payload["issuer"]),
    items: (payload["items"] || []).map { |e| InvoiceItemResource.from_api(e) },
    number: payload["number"],
    operation_nature: payload["operationNature"],
    operation_on: payload["operationOn"],
    operation_type: payload["operationType"],
    payment: (payload["payment"] || []).map { |e| PaymentResource.from_api(e) },
    presence_type: payload["presenceType"],
    print_type: payload["printType"],
    purpose_type: payload["purposeType"],
    serie: payload["serie"],
    totals: TotalResource.from_api(payload["totals"]),
    transaction_intermediate: IntermediateResource.from_api(payload["transactionIntermediate"]),
    transport: TransportInformationResource.from_api(payload["transport"]),
  )
end

.newinstance

Parameters:

Returns:

  • (instance)


36
# File 'sig/nfe/generated/nf_consumidor_v2/consumer_invoice_request.rbs', line 36

def self.new: (?additional_information: AdditionalInformationResource, ?billing: BillingResource, ?buyer: BuyerResource, ?consumer_type: untyped, ?consumption_city_code: Integer?, ?contingency_justification: String?, ?contingency_on: String?, ?credit_type: untyped, ?debit_type: untyped, ?destination: untyped, ?government_purchase: GovernmentPurchaseResource, ?ibs_consumption_city_code: Integer?, ?id: String?, ?issuer: IssuerFromRequestResource, items: Array[InvoiceItemResource], ?number: Integer?, ?operation_nature: String?, ?operation_on: String?, ?operation_type: untyped, ?payment: Array[PaymentResource]?, ?presence_type: untyped, ?print_type: untyped, ?purpose_type: untyped, ?serie: Integer?, ?totals: TotalResource, ?transaction_intermediate: IntermediateResource, ?transport: TransportInformationResource) -> instance