Class: Nfe::Generated::NfConsumidorV2::InvoiceResource

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInvoiceResource

Returns a new instance of InvoiceResource.

Parameters:



35
# File 'sig/nfe/generated/nf_consumidor_v2/invoice_resource.rbs', line 35

def initialize: (?additional_information: AdditionalInformationResource, ?authorization: AuthorizationResource, ?billing: BillingResource, ?buyer: BuyerResource, ?contingency_details: ContingencyDetails, ?created_on: String?, ?delivery: DeliveryInformationResource, ?environment_type: untyped, ?export: ExportResource, ?id: String?, ?issuer: IssuerResource, ?last_events: InvoiceEventsResourceBase, ?modified_on: String?, ?number: Integer?, ?operation_nature: String?, ?operation_on: String?, ?operation_type: untyped, ?payment: Array[PaymentResource]?, ?purpose_type: untyped, ?serie: Integer?, ?status: untyped, ?totals: TotalResource, ?transaction_intermediate: IntermediateResource, ?transport: TransportInformationResource, ?withdrawal: WithdrawalInformationResource) -> 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/invoice_resource.rb', line 9

def additional_information
  @additional_information
end

#authorizationObject (readonly)

Returns the value of attribute authorization

Returns:

  • (Object)

    the current value of authorization



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

def authorization
  @authorization
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/invoice_resource.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/invoice_resource.rb', line 9

def buyer
  @buyer
end

#contingency_detailsObject (readonly)

Returns the value of attribute contingency_details

Returns:

  • (Object)

    the current value of contingency_details



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

def contingency_details
  @contingency_details
end

#created_onObject (readonly)

Returns the value of attribute created_on

Returns:

  • (Object)

    the current value of created_on



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

def created_on
  @created_on
end

#deliveryObject (readonly)

Returns the value of attribute delivery

Returns:

  • (Object)

    the current value of delivery



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

def delivery
  @delivery
end

#environment_typeObject (readonly)

Returns the value of attribute environment_type

Returns:

  • (Object)

    the current value of environment_type



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

def environment_type
  @environment_type
end

#exportObject (readonly)

Returns the value of attribute export

Returns:

  • (Object)

    the current value of export



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

def export
  @export
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/invoice_resource.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/invoice_resource.rb', line 9

def issuer
  @issuer
end

#last_eventsObject (readonly)

Returns the value of attribute last_events

Returns:

  • (Object)

    the current value of last_events



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

def last_events
  @last_events
end

#modified_onObject (readonly)

Returns the value of attribute modified_on

Returns:

  • (Object)

    the current value of modified_on



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

def modified_on
  @modified_on
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/invoice_resource.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/invoice_resource.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/invoice_resource.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/invoice_resource.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/invoice_resource.rb', line 9

def payment
  @payment
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/invoice_resource.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/invoice_resource.rb', line 9

def serie
  @serie
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



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

def status
  @status
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/invoice_resource.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/invoice_resource.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/invoice_resource.rb', line 9

def transport
  @transport
end

#withdrawalObject (readonly)

Returns the value of attribute withdrawal

Returns:

  • (Object)

    the current value of withdrawal



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

def withdrawal
  @withdrawal
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
# File 'lib/nfe/generated/nf_consumidor_v2/invoice_resource.rb', line 10

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

  new(
    additional_information: AdditionalInformationResource.from_api(payload["additionalInformation"]),
    authorization: AuthorizationResource.from_api(payload["authorization"]),
    billing: BillingResource.from_api(payload["billing"]),
    buyer: BuyerResource.from_api(payload["buyer"]),
    contingency_details: ContingencyDetails.from_api(payload["contingencyDetails"]),
    created_on: payload["createdOn"],
    delivery: DeliveryInformationResource.from_api(payload["delivery"]),
    environment_type: payload["environmentType"],
    export: ExportResource.from_api(payload["export"]),
    id: payload["id"],
    issuer: IssuerResource.from_api(payload["issuer"]),
    last_events: InvoiceEventsResourceBase.from_api(payload["lastEvents"]),
    modified_on: payload["modifiedOn"],
    number: payload["number"],
    operation_nature: payload["operationNature"],
    operation_on: payload["operationOn"],
    operation_type: payload["operationType"],
    payment: (payload["payment"] || []).map { |e| PaymentResource.from_api(e) },
    purpose_type: payload["purposeType"],
    serie: payload["serie"],
    status: payload["status"],
    totals: TotalResource.from_api(payload["totals"]),
    transaction_intermediate: IntermediateResource.from_api(payload["transactionIntermediate"]),
    transport: TransportInformationResource.from_api(payload["transport"]),
    withdrawal: WithdrawalInformationResource.from_api(payload["withdrawal"]),
  )
end

.newinstance

Parameters:

Returns:

  • (instance)


34
# File 'sig/nfe/generated/nf_consumidor_v2/invoice_resource.rbs', line 34

def self.new: (?additional_information: AdditionalInformationResource, ?authorization: AuthorizationResource, ?billing: BillingResource, ?buyer: BuyerResource, ?contingency_details: ContingencyDetails, ?created_on: String?, ?delivery: DeliveryInformationResource, ?environment_type: untyped, ?export: ExportResource, ?id: String?, ?issuer: IssuerResource, ?last_events: InvoiceEventsResourceBase, ?modified_on: String?, ?number: Integer?, ?operation_nature: String?, ?operation_on: String?, ?operation_type: untyped, ?payment: Array[PaymentResource]?, ?purpose_type: untyped, ?serie: Integer?, ?status: untyped, ?totals: TotalResource, ?transaction_intermediate: IntermediateResource, ?transport: TransportInformationResource, ?withdrawal: WithdrawalInformationResource) -> instance