Class: Nfe::Generated::NfConsumidorV2::BuyerResource

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBuyerResource

Returns a new instance of BuyerResource.

Parameters:

  • account_id: (String, nil)
  • address: (AddressResource)
  • email: (String, nil)
  • federal_tax_number: (Integer, nil)
  • id: (String, nil)
  • name: (String, nil)
  • state_tax_number: (String, nil)
  • state_tax_number_indicator: (Object)
  • tax_regime: (Object)
  • trade_name: (String, nil)
  • type: (Object)


21
# File 'sig/nfe/generated/nf_consumidor_v2/buyer_resource.rbs', line 21

def initialize: (?account_id: String?, ?address: AddressResource, ?email: String?, ?federal_tax_number: Integer?, ?id: String?, ?name: String?, ?state_tax_number: String?, ?state_tax_number_indicator: untyped, ?tax_regime: untyped, ?trade_name: String?, ?type: untyped) -> void

Instance Attribute Details

#account_idObject (readonly)

Returns the value of attribute account_id

Returns:

  • (Object)

    the current value of account_id



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

def 
  @account_id
end

#addressObject (readonly)

Returns the value of attribute address

Returns:

  • (Object)

    the current value of address



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

def address
  @address
end

#emailObject (readonly)

Returns the value of attribute email

Returns:

  • (Object)

    the current value of email



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

def email
  @email
end

#federal_tax_numberObject (readonly)

Returns the value of attribute federal_tax_number

Returns:

  • (Object)

    the current value of federal_tax_number



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

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

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



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

def name
  @name
end

#state_tax_numberObject (readonly)

Returns the value of attribute state_tax_number

Returns:

  • (Object)

    the current value of state_tax_number



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

def state_tax_number
  @state_tax_number
end

#state_tax_number_indicatorObject (readonly)

Returns the value of attribute state_tax_number_indicator

Returns:

  • (Object)

    the current value of state_tax_number_indicator



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

def state_tax_number_indicator
  @state_tax_number_indicator
end

#tax_regimeObject (readonly)

Returns the value of attribute tax_regime

Returns:

  • (Object)

    the current value of tax_regime



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

def tax_regime
  @tax_regime
end

#trade_nameObject (readonly)

Returns the value of attribute trade_name

Returns:

  • (Object)

    the current value of trade_name



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

def trade_name
  @trade_name
end

#typeObject (readonly)

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



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

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

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

  new(
    account_id: payload["accountId"],
    address: AddressResource.from_api(payload["address"]),
    email: payload["email"],
    federal_tax_number: payload["federalTaxNumber"],
    id: payload["id"],
    name: payload["name"],
    state_tax_number: payload["stateTaxNumber"],
    state_tax_number_indicator: payload["stateTaxNumberIndicator"],
    tax_regime: payload["taxRegime"],
    trade_name: payload["tradeName"],
    type: payload["type"],
  )
end

.newinstance

Parameters:

  • account_id: (String, nil)
  • address: (AddressResource)
  • email: (String, nil)
  • federal_tax_number: (Integer, nil)
  • id: (String, nil)
  • name: (String, nil)
  • state_tax_number: (String, nil)
  • state_tax_number_indicator: (Object)
  • tax_regime: (Object)
  • trade_name: (String, nil)
  • type: (Object)

Returns:

  • (instance)


20
# File 'sig/nfe/generated/nf_consumidor_v2/buyer_resource.rbs', line 20

def self.new: (?account_id: String?, ?address: AddressResource, ?email: String?, ?federal_tax_number: Integer?, ?id: String?, ?name: String?, ?state_tax_number: String?, ?state_tax_number_indicator: untyped, ?tax_regime: untyped, ?trade_name: String?, ?type: untyped) -> instance