Class: NuvemfiscalSdkRuby::NfeSefazProd

Inherits:
Object
  • Object
show all
Defined in:
lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb

Overview

Dados dos produtos e serviços da NF-e.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ NfeSefazProd

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 261

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `NuvemfiscalSdkRuby::NfeSefazProd` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `NuvemfiscalSdkRuby::NfeSefazProd`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'c_prod')
    self.c_prod = attributes[:'c_prod']
  else
    self.c_prod = nil
  end

  if attributes.key?(:'c_ean')
    self.c_ean = attributes[:'c_ean']
  else
    self.c_ean = nil
  end

  if attributes.key?(:'c_barra')
    self.c_barra = attributes[:'c_barra']
  end

  if attributes.key?(:'x_prod')
    self.x_prod = attributes[:'x_prod']
  else
    self.x_prod = nil
  end

  if attributes.key?(:'ncm')
    self.ncm = attributes[:'ncm']
  else
    self.ncm = nil
  end

  if attributes.key?(:'nve')
    if (value = attributes[:'nve']).is_a?(Array)
      self.nve = value
    end
  end

  if attributes.key?(:'cest')
    self.cest = attributes[:'cest']
  end

  if attributes.key?(:'ind_escala')
    self.ind_escala = attributes[:'ind_escala']
  end

  if attributes.key?(:'cnpj_fab')
    self.cnpj_fab = attributes[:'cnpj_fab']
  end

  if attributes.key?(:'c_benef')
    self.c_benef = attributes[:'c_benef']
  end

  if attributes.key?(:'g_cred')
    if (value = attributes[:'g_cred']).is_a?(Array)
      self.g_cred = value
    end
  end

  if attributes.key?(:'extipi')
    self.extipi = attributes[:'extipi']
  end

  if attributes.key?(:'cfop')
    self.cfop = attributes[:'cfop']
  else
    self.cfop = nil
  end

  if attributes.key?(:'u_com')
    self.u_com = attributes[:'u_com']
  else
    self.u_com = nil
  end

  if attributes.key?(:'q_com')
    self.q_com = attributes[:'q_com']
  else
    self.q_com = nil
  end

  if attributes.key?(:'v_un_com')
    self.v_un_com = attributes[:'v_un_com']
  else
    self.v_un_com = nil
  end

  if attributes.key?(:'v_prod')
    self.v_prod = attributes[:'v_prod']
  else
    self.v_prod = nil
  end

  if attributes.key?(:'c_ean_trib')
    self.c_ean_trib = attributes[:'c_ean_trib']
  else
    self.c_ean_trib = nil
  end

  if attributes.key?(:'c_barra_trib')
    self.c_barra_trib = attributes[:'c_barra_trib']
  end

  if attributes.key?(:'u_trib')
    self.u_trib = attributes[:'u_trib']
  else
    self.u_trib = nil
  end

  if attributes.key?(:'q_trib')
    self.q_trib = attributes[:'q_trib']
  else
    self.q_trib = nil
  end

  if attributes.key?(:'v_un_trib')
    self.v_un_trib = attributes[:'v_un_trib']
  else
    self.v_un_trib = nil
  end

  if attributes.key?(:'v_frete')
    self.v_frete = attributes[:'v_frete']
  end

  if attributes.key?(:'v_seg')
    self.v_seg = attributes[:'v_seg']
  end

  if attributes.key?(:'v_desc')
    self.v_desc = attributes[:'v_desc']
  end

  if attributes.key?(:'v_outro')
    self.v_outro = attributes[:'v_outro']
  end

  if attributes.key?(:'ind_tot')
    self.ind_tot = attributes[:'ind_tot']
  else
    self.ind_tot = nil
  end

  if attributes.key?(:'di')
    if (value = attributes[:'di']).is_a?(Array)
      self.di = value
    end
  end

  if attributes.key?(:'det_export')
    if (value = attributes[:'det_export']).is_a?(Array)
      self.det_export = value
    end
  end

  if attributes.key?(:'x_ped')
    self.x_ped = attributes[:'x_ped']
  end

  if attributes.key?(:'n_item_ped')
    self.n_item_ped = attributes[:'n_item_ped']
  end

  if attributes.key?(:'n_fci')
    self.n_fci = attributes[:'n_fci']
  end

  if attributes.key?(:'rastro')
    if (value = attributes[:'rastro']).is_a?(Array)
      self.rastro = value
    end
  end

  if attributes.key?(:'inf_prod_nff')
    self.inf_prod_nff = attributes[:'inf_prod_nff']
  end

  if attributes.key?(:'inf_prod_emb')
    self.inf_prod_emb = attributes[:'inf_prod_emb']
  end

  if attributes.key?(:'veic_prod')
    self.veic_prod = attributes[:'veic_prod']
  end

  if attributes.key?(:'med')
    self.med = attributes[:'med']
  end

  if attributes.key?(:'arma')
    if (value = attributes[:'arma']).is_a?(Array)
      self.arma = value
    end
  end

  if attributes.key?(:'comb')
    self.comb = attributes[:'comb']
  end

  if attributes.key?(:'n_recopi')
    self.n_recopi = attributes[:'n_recopi']
  end
end

Instance Attribute Details

#armaObject

Returns the value of attribute arma.



120
121
122
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 120

def arma
  @arma
end

#c_barraObject

Codigo de barras diferente do padrão GTIN.



26
27
28
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 26

def c_barra
  @c_barra
end

#c_barra_tribObject

Código de barras da unidade tributável diferente do padrão GTIN.



71
72
73
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 71

def c_barra_trib
  @c_barra_trib
end

#c_benefObject

Returns the value of attribute c_benef.



45
46
47
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 45

def c_benef
  @c_benef
end

#c_eanObject

GTIN (Global Trade Item Number) do produto, antigo código EAN ou código de barras.



23
24
25
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 23

def c_ean
  @c_ean
end

#c_ean_tribObject

GTIN (Global Trade Item Number) da unidade tributável, antigo código EAN ou código de barras.



68
69
70
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 68

def c_ean_trib
  @c_ean_trib
end

#c_prodObject

Código do produto ou serviço. Preencher com CFOP caso se trate de itens não relacionados com mercadorias/produto e que o contribuinte não possua codificação própria Formato ”CFOP9999”.



20
21
22
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 20

def c_prod
  @c_prod
end

#cestObject

Codigo especificador da Substuicao Tributaria - CEST, que identifica a mercadoria sujeita aos regimes de substituicao tributária e de antecipação do recolhimento do imposto.



38
39
40
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 38

def cest
  @cest
end

#cfopObject

Cfop.



53
54
55
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 53

def cfop
  @cfop
end

#cnpj_fabObject

CNPJ do Fabricante da Mercadoria, obrigatório para produto em escala NÃO relevante.



43
44
45
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 43

def cnpj_fab
  @cnpj_fab
end

#combObject

Returns the value of attribute comb.



122
123
124
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 122

def comb
  @comb
end

#det_exportObject

Returns the value of attribute det_export.



99
100
101
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 99

def det_export
  @det_export
end

#diObject

Returns the value of attribute di.



97
98
99
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 97

def di
  @di
end

#extipiObject

Código EX TIPI (3 posições).



50
51
52
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 50

def extipi
  @extipi
end

#g_credObject

Returns the value of attribute g_cred.



47
48
49
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 47

def g_cred
  @g_cred
end

#ind_escalaObject

Returns the value of attribute ind_escala.



40
41
42
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 40

def ind_escala
  @ind_escala
end

#ind_totObject

Este campo deverá ser preenchido com: * 0 - o valor do item (vProd) não compõe o valor total da NF-e (vProd) * 1 - o valor do item (vProd) compõe o valor total da NF-e (vProd)



95
96
97
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 95

def ind_tot
  @ind_tot
end

#inf_prod_embObject

Returns the value of attribute inf_prod_emb.



114
115
116
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 114

def inf_prod_emb
  @inf_prod_emb
end

#inf_prod_nffObject

Returns the value of attribute inf_prod_nff.



112
113
114
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 112

def inf_prod_nff
  @inf_prod_nff
end

#medObject

Returns the value of attribute med.



118
119
120
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 118

def med
  @med
end

#n_fciObject

Número de controle da FCI - Ficha de Conteúdo de Importação.



108
109
110
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 108

def n_fci
  @n_fci
end

#n_item_pedObject

Número do Item do Pedido de Compra - Identificação do número do item do pedido de Compra.



105
106
107
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 105

def n_item_ped
  @n_item_ped
end

#n_recopiObject

Número do RECOPI.



125
126
127
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 125

def n_recopi
  @n_recopi
end

#ncmObject

Código NCM (8 posições), será permitida a informação do gênero (posição do capítulo do NCM) quando a operação não for de comércio exterior (importação/exportação) ou o produto não seja tributado pelo IPI. Em caso de item de serviço ou item que não tenham produto (Ex. transferência de crédito, crédito do ativo imobilizado, etc.), informar o código 00 (zeros) (v2.0).



32
33
34
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 32

def ncm
  @ncm
end

#nveObject

Nomenclatura de Valor aduaneio e Estatístico.



35
36
37
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 35

def nve
  @nve
end

#q_comObject

Quantidade Comercial do produto, alterado para aceitar de 0 a 4 casas decimais e 11 inteiros.



59
60
61
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 59

def q_com
  @q_com
end

#q_tribObject

Quantidade Tributável - alterado para aceitar de 0 a 4 casas decimais e 11 inteiros.



77
78
79
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 77

def q_trib
  @q_trib
end

#rastroObject

Returns the value of attribute rastro.



110
111
112
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 110

def rastro
  @rastro
end

#u_comObject

Unidade comercial.



56
57
58
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 56

def u_com
  @u_com
end

#u_tribObject

Unidade Tributável.



74
75
76
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 74

def u_trib
  @u_trib
end

#v_descObject

Valor do Desconto.



89
90
91
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 89

def v_desc
  @v_desc
end

#v_freteObject

Valor Total do Frete.



83
84
85
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 83

def v_frete
  @v_frete
end

#v_outroObject

Outras despesas acessórias.



92
93
94
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 92

def v_outro
  @v_outro
end

#v_prodObject

Valor bruto do produto ou serviço.



65
66
67
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 65

def v_prod
  @v_prod
end

#v_segObject

Valor Total do Seguro.



86
87
88
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 86

def v_seg
  @v_seg
end

#v_un_comObject

Valor unitário de comercialização - alterado para aceitar 0 a 10 casas decimais e 11 inteiros.



62
63
64
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 62

def v_un_com
  @v_un_com
end

#v_un_tribObject

Valor unitário de tributação - - alterado para aceitar 0 a 10 casas decimais e 11 inteiros.



80
81
82
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 80

def v_un_trib
  @v_un_trib
end

#veic_prodObject

Returns the value of attribute veic_prod.



116
117
118
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 116

def veic_prod
  @veic_prod
end

#x_pedObject

pedido de compra - Informação de interesse do emissor para controle do B2B.



102
103
104
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 102

def x_ped
  @x_ped
end

#x_prodObject

Descrição do produto ou serviço.



29
30
31
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 29

def x_prod
  @x_prod
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 1047

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = NuvemfiscalSdkRuby.const_get(type)
    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



174
175
176
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 174

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 128

def self.attribute_map
  {
    :'c_prod' => :'cProd',
    :'c_ean' => :'cEAN',
    :'c_barra' => :'cBarra',
    :'x_prod' => :'xProd',
    :'ncm' => :'NCM',
    :'nve' => :'NVE',
    :'cest' => :'CEST',
    :'ind_escala' => :'indEscala',
    :'cnpj_fab' => :'CNPJFab',
    :'c_benef' => :'cBenef',
    :'g_cred' => :'gCred',
    :'extipi' => :'EXTIPI',
    :'cfop' => :'CFOP',
    :'u_com' => :'uCom',
    :'q_com' => :'qCom',
    :'v_un_com' => :'vUnCom',
    :'v_prod' => :'vProd',
    :'c_ean_trib' => :'cEANTrib',
    :'c_barra_trib' => :'cBarraTrib',
    :'u_trib' => :'uTrib',
    :'q_trib' => :'qTrib',
    :'v_un_trib' => :'vUnTrib',
    :'v_frete' => :'vFrete',
    :'v_seg' => :'vSeg',
    :'v_desc' => :'vDesc',
    :'v_outro' => :'vOutro',
    :'ind_tot' => :'indTot',
    :'di' => :'DI',
    :'det_export' => :'detExport',
    :'x_ped' => :'xPed',
    :'n_item_ped' => :'nItemPed',
    :'n_fci' => :'nFCI',
    :'rastro' => :'rastro',
    :'inf_prod_nff' => :'infProdNFF',
    :'inf_prod_emb' => :'infProdEmb',
    :'veic_prod' => :'veicProd',
    :'med' => :'med',
    :'arma' => :'arma',
    :'comb' => :'comb',
    :'n_recopi' => :'nRECOPI'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 1023

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 225

def self.openapi_nullable
  Set.new([
    :'c_prod',
    :'c_ean',
    :'c_barra',
    :'x_prod',
    :'ncm',
    :'cest',
    :'ind_escala',
    :'cnpj_fab',
    :'c_benef',
    :'extipi',
    :'cfop',
    :'u_com',
    :'q_com',
    :'v_un_com',
    :'v_prod',
    :'c_ean_trib',
    :'c_barra_trib',
    :'u_trib',
    :'q_trib',
    :'v_un_trib',
    :'v_frete',
    :'v_seg',
    :'v_desc',
    :'v_outro',
    :'ind_tot',
    :'x_ped',
    :'n_item_ped',
    :'n_fci',
    :'n_recopi'
  ])
end

.openapi_typesObject

Attribute type mapping.



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 179

def self.openapi_types
  {
    :'c_prod' => :'String',
    :'c_ean' => :'String',
    :'c_barra' => :'String',
    :'x_prod' => :'String',
    :'ncm' => :'String',
    :'nve' => :'Array<String>',
    :'cest' => :'String',
    :'ind_escala' => :'String',
    :'cnpj_fab' => :'String',
    :'c_benef' => :'String',
    :'g_cred' => :'Array<NfeSefazGCred>',
    :'extipi' => :'String',
    :'cfop' => :'String',
    :'u_com' => :'String',
    :'q_com' => :'Float',
    :'v_un_com' => :'Float',
    :'v_prod' => :'Float',
    :'c_ean_trib' => :'String',
    :'c_barra_trib' => :'String',
    :'u_trib' => :'String',
    :'q_trib' => :'Float',
    :'v_un_trib' => :'Float',
    :'v_frete' => :'Float',
    :'v_seg' => :'Float',
    :'v_desc' => :'Float',
    :'v_outro' => :'Float',
    :'ind_tot' => :'Integer',
    :'di' => :'Array<NfeSefazDI>',
    :'det_export' => :'Array<NfeSefazDetExport>',
    :'x_ped' => :'String',
    :'n_item_ped' => :'Integer',
    :'n_fci' => :'String',
    :'rastro' => :'Array<NfeSefazRastro>',
    :'inf_prod_nff' => :'NfeSefazInfProdNFF',
    :'inf_prod_emb' => :'NfeSefazInfProdEmb',
    :'veic_prod' => :'NfeSefazVeicProd',
    :'med' => :'NfeSefazMed',
    :'arma' => :'Array<NfeSefazArma>',
    :'comb' => :'NfeSefazComb',
    :'n_recopi' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 963

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      c_prod == o.c_prod &&
      c_ean == o.c_ean &&
      c_barra == o.c_barra &&
      x_prod == o.x_prod &&
      ncm == o.ncm &&
      nve == o.nve &&
      cest == o.cest &&
      ind_escala == o.ind_escala &&
      cnpj_fab == o.cnpj_fab &&
      c_benef == o.c_benef &&
      g_cred == o.g_cred &&
      extipi == o.extipi &&
      cfop == o.cfop &&
      u_com == o.u_com &&
      q_com == o.q_com &&
      v_un_com == o.v_un_com &&
      v_prod == o.v_prod &&
      c_ean_trib == o.c_ean_trib &&
      c_barra_trib == o.c_barra_trib &&
      u_trib == o.u_trib &&
      q_trib == o.q_trib &&
      v_un_trib == o.v_un_trib &&
      v_frete == o.v_frete &&
      v_seg == o.v_seg &&
      v_desc == o.v_desc &&
      v_outro == o.v_outro &&
      ind_tot == o.ind_tot &&
      di == o.di &&
      det_export == o.det_export &&
      x_ped == o.x_ped &&
      n_item_ped == o.n_item_ped &&
      n_fci == o.n_fci &&
      rastro == o.rastro &&
      inf_prod_nff == o.inf_prod_nff &&
      inf_prod_emb == o.inf_prod_emb &&
      veic_prod == o.veic_prod &&
      med == o.med &&
      arma == o.arma &&
      comb == o.comb &&
      n_recopi == o.n_recopi
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 1118

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


1010
1011
1012
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 1010

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



1016
1017
1018
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 1016

def hash
  [c_prod, c_ean, c_barra, x_prod, ncm, nve, cest, ind_escala, cnpj_fab, c_benef, g_cred, extipi, cfop, u_com, q_com, v_un_com, v_prod, c_ean_trib, c_barra_trib, u_trib, q_trib, v_un_trib, v_frete, v_seg, v_desc, v_outro, ind_tot, di, det_export, x_ped, n_item_ped, n_fci, rastro, inf_prod_nff, inf_prod_emb, veic_prod, med, arma, comb, n_recopi].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 477

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @c_prod.to_s.length > 60
    invalid_properties.push('invalid value for "c_prod", the character length must be smaller than or equal to 60.')
  end

  if @c_prod.to_s.length < 1
    invalid_properties.push('invalid value for "c_prod", the character length must be great than or equal to 1.')
  end

  if !@c_barra.nil? && @c_barra.to_s.length > 30
    invalid_properties.push('invalid value for "c_barra", the character length must be smaller than or equal to 30.')
  end

  if !@c_barra.nil? && @c_barra.to_s.length < 3
    invalid_properties.push('invalid value for "c_barra", the character length must be great than or equal to 3.')
  end

  if @x_prod.to_s.length > 120
    invalid_properties.push('invalid value for "x_prod", the character length must be smaller than or equal to 120.')
  end

  if @x_prod.to_s.length < 1
    invalid_properties.push('invalid value for "x_prod", the character length must be great than or equal to 1.')
  end

  if !@nve.nil? && @nve.length > 8
    invalid_properties.push('invalid value for "nve", number of items must be less than or equal to 8.')
  end

  if !@cnpj_fab.nil? && @cnpj_fab.to_s.length > 14
    invalid_properties.push('invalid value for "cnpj_fab", the character length must be smaller than or equal to 14.')
  end

  if !@g_cred.nil? && @g_cred.length > 4
    invalid_properties.push('invalid value for "g_cred", number of items must be less than or equal to 4.')
  end

  if @u_com.to_s.length > 6
    invalid_properties.push('invalid value for "u_com", the character length must be smaller than or equal to 6.')
  end

  if @u_com.to_s.length < 1
    invalid_properties.push('invalid value for "u_com", the character length must be great than or equal to 1.')
  end

  if @q_com < 0
    invalid_properties.push('invalid value for "q_com", must be greater than or equal to 0.')
  end

  if @v_un_com < 0
    invalid_properties.push('invalid value for "v_un_com", must be greater than or equal to 0.')
  end

  if @v_prod < 0
    invalid_properties.push('invalid value for "v_prod", must be greater than or equal to 0.')
  end

  if !@c_barra_trib.nil? && @c_barra_trib.to_s.length > 30
    invalid_properties.push('invalid value for "c_barra_trib", the character length must be smaller than or equal to 30.')
  end

  if !@c_barra_trib.nil? && @c_barra_trib.to_s.length < 3
    invalid_properties.push('invalid value for "c_barra_trib", the character length must be great than or equal to 3.')
  end

  if @u_trib.to_s.length > 6
    invalid_properties.push('invalid value for "u_trib", the character length must be smaller than or equal to 6.')
  end

  if @u_trib.to_s.length < 1
    invalid_properties.push('invalid value for "u_trib", the character length must be great than or equal to 1.')
  end

  if @q_trib < 0
    invalid_properties.push('invalid value for "q_trib", must be greater than or equal to 0.')
  end

  if @v_un_trib < 0
    invalid_properties.push('invalid value for "v_un_trib", must be greater than or equal to 0.')
  end

  if !@v_frete.nil? && @v_frete <= 0
    invalid_properties.push('invalid value for "v_frete", must be greater than 0.')
  end

  if !@v_seg.nil? && @v_seg <= 0
    invalid_properties.push('invalid value for "v_seg", must be greater than 0.')
  end

  if !@v_desc.nil? && @v_desc <= 0
    invalid_properties.push('invalid value for "v_desc", must be greater than 0.')
  end

  if !@v_outro.nil? && @v_outro <= 0
    invalid_properties.push('invalid value for "v_outro", must be greater than 0.')
  end

  if !@di.nil? && @di.length > 100
    invalid_properties.push('invalid value for "di", number of items must be less than or equal to 100.')
  end

  if !@det_export.nil? && @det_export.length > 500
    invalid_properties.push('invalid value for "det_export", number of items must be less than or equal to 500.')
  end

  if !@x_ped.nil? && @x_ped.to_s.length > 15
    invalid_properties.push('invalid value for "x_ped", the character length must be smaller than or equal to 15.')
  end

  if !@x_ped.nil? && @x_ped.to_s.length < 1
    invalid_properties.push('invalid value for "x_ped", the character length must be great than or equal to 1.')
  end

  if !@n_item_ped.nil? && @n_item_ped > 999999
    invalid_properties.push('invalid value for "n_item_ped", must be smaller than or equal to 999999.')
  end

  if !@n_item_ped.nil? && @n_item_ped < 0
    invalid_properties.push('invalid value for "n_item_ped", must be greater than or equal to 0.')
  end

  if !@rastro.nil? && @rastro.length > 500
    invalid_properties.push('invalid value for "rastro", number of items must be less than or equal to 500.')
  end

  if !@arma.nil? && @arma.length > 500
    invalid_properties.push('invalid value for "arma", number of items must be less than or equal to 500.')
  end

  if !@n_recopi.nil? && @n_recopi.to_s.length > 20
    invalid_properties.push('invalid value for "n_recopi", the character length must be smaller than or equal to 20.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



1094
1095
1096
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 1094

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 1100

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



1088
1089
1090
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 1088

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
# File 'lib/nuvemfiscal_sdk_ruby/models/nfe_sefaz_prod.rb', line 617

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @c_prod.to_s.length > 60
  return false if @c_prod.to_s.length < 1
  return false if !@c_barra.nil? && @c_barra.to_s.length > 30
  return false if !@c_barra.nil? && @c_barra.to_s.length < 3
  return false if @x_prod.to_s.length > 120
  return false if @x_prod.to_s.length < 1
  return false if !@nve.nil? && @nve.length > 8
  return false if !@cnpj_fab.nil? && @cnpj_fab.to_s.length > 14
  return false if !@g_cred.nil? && @g_cred.length > 4
  return false if @u_com.to_s.length > 6
  return false if @u_com.to_s.length < 1
  return false if @q_com < 0
  return false if @v_un_com < 0
  return false if @v_prod < 0
  return false if !@c_barra_trib.nil? && @c_barra_trib.to_s.length > 30
  return false if !@c_barra_trib.nil? && @c_barra_trib.to_s.length < 3
  return false if @u_trib.to_s.length > 6
  return false if @u_trib.to_s.length < 1
  return false if @q_trib < 0
  return false if @v_un_trib < 0
  return false if !@v_frete.nil? && @v_frete <= 0
  return false if !@v_seg.nil? && @v_seg <= 0
  return false if !@v_desc.nil? && @v_desc <= 0
  return false if !@v_outro.nil? && @v_outro <= 0
  return false if !@di.nil? && @di.length > 100
  return false if !@det_export.nil? && @det_export.length > 500
  return false if !@x_ped.nil? && @x_ped.to_s.length > 15
  return false if !@x_ped.nil? && @x_ped.to_s.length < 1
  return false if !@n_item_ped.nil? && @n_item_ped > 999999
  return false if !@n_item_ped.nil? && @n_item_ped < 0
  return false if !@rastro.nil? && @rastro.length > 500
  return false if !@arma.nil? && @arma.length > 500
  return false if !@n_recopi.nil? && @n_recopi.to_s.length > 20
  true
end