Class: NuvemfiscalSdkRuby::NfcomSefazGProcRef
- Inherits:
-
Object
- Object
- NuvemfiscalSdkRuby::NfcomSefazGProcRef
- Defined in:
- lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb
Overview
Grupo Processo referenciado. Este grupo somente deverá ser preenchido quando houver processo judicial ou administrativo que altere valores.
Instance Attribute Summary collapse
-
#g_proc ⇒ Object
Returns the value of attribute g_proc.
-
#ind_devolucao ⇒ Object
Indicador de devolução do valor do item.
-
#p_icms ⇒ Object
Alíquota do ICMS.
-
#q_faturada ⇒ Object
Quantidade Faturada.
-
#v_bc ⇒ Object
Valor da BC do ICMS.
-
#v_cofins ⇒ Object
Valor do COFINS.
-
#v_desc ⇒ Object
Valor do Desconto.
-
#v_fcp ⇒ Object
Valor do Fundo de Combate à Pobreza (FCP).
-
#v_icms ⇒ Object
Valor do ICMS.
-
#v_item ⇒ Object
Valor unitário do item.
-
#v_outro ⇒ Object
Outras despesas acessórias.
-
#v_pis ⇒ Object
Valor do PIS.
-
#v_prod ⇒ Object
Valor total do item.
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ NfcomSefazGProcRef
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ NfcomSefazGProcRef
Initializes the object
120 121 122 123 124 125 126 127 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 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 120 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `NuvemfiscalSdkRuby::NfcomSefazGProcRef` 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::NfcomSefazGProcRef`. 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?(:'v_item') self.v_item = attributes[:'v_item'] else self.v_item = nil end if attributes.key?(:'q_faturada') self.q_faturada = attributes[:'q_faturada'] else self.q_faturada = nil end if attributes.key?(:'v_prod') self.v_prod = attributes[:'v_prod'] else self.v_prod = nil 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_devolucao') self.ind_devolucao = attributes[:'ind_devolucao'] end if attributes.key?(:'v_bc') self.v_bc = attributes[:'v_bc'] end if attributes.key?(:'p_icms') self.p_icms = attributes[:'p_icms'] end if attributes.key?(:'v_icms') self.v_icms = attributes[:'v_icms'] end if attributes.key?(:'v_pis') self.v_pis = attributes[:'v_pis'] end if attributes.key?(:'v_cofins') self.v_cofins = attributes[:'v_cofins'] end if attributes.key?(:'v_fcp') self.v_fcp = attributes[:'v_fcp'] end if attributes.key?(:'g_proc') if (value = attributes[:'g_proc']).is_a?(Array) self.g_proc = value end else self.g_proc = nil end end |
Instance Attribute Details
#g_proc ⇒ Object
Returns the value of attribute g_proc.
55 56 57 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 55 def g_proc @g_proc end |
#ind_devolucao ⇒ Object
Indicador de devolução do valor do item. * 1 - Devolução do valor do item
35 36 37 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 35 def ind_devolucao @ind_devolucao end |
#p_icms ⇒ Object
Alíquota do ICMS.
41 42 43 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 41 def p_icms @p_icms end |
#q_faturada ⇒ Object
Quantidade Faturada. Informar a quantidade de comercialização do produto .
23 24 25 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 23 def q_faturada @q_faturada end |
#v_bc ⇒ Object
Valor da BC do ICMS.
38 39 40 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 38 def v_bc @v_bc end |
#v_cofins ⇒ Object
Valor do COFINS.
50 51 52 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 50 def v_cofins @v_cofins end |
#v_desc ⇒ Object
Valor do Desconto.
29 30 31 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 29 def v_desc @v_desc end |
#v_fcp ⇒ Object
Valor do Fundo de Combate à Pobreza (FCP).
53 54 55 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 53 def v_fcp @v_fcp end |
#v_icms ⇒ Object
Valor do ICMS.
44 45 46 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 44 def v_icms @v_icms end |
#v_item ⇒ Object
Valor unitário do item. Informar o valor sem a influência da decisão judicial/administrativa.
20 21 22 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 20 def v_item @v_item end |
#v_outro ⇒ Object
Outras despesas acessórias.
32 33 34 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 32 def v_outro @v_outro end |
#v_pis ⇒ Object
Valor do PIS.
47 48 49 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 47 def v_pis @v_pis end |
#v_prod ⇒ Object
Valor total do item.
26 27 28 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 26 def v_prod @v_prod end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
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 474 475 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 438 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_attributes ⇒ Object
Returns all the JSON keys this model knows about
77 78 79 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 77 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 58 def self.attribute_map { :'v_item' => :'vItem', :'q_faturada' => :'qFaturada', :'v_prod' => :'vProd', :'v_desc' => :'vDesc', :'v_outro' => :'vOutro', :'ind_devolucao' => :'indDevolucao', :'v_bc' => :'vBC', :'p_icms' => :'pICMS', :'v_icms' => :'vICMS', :'v_pis' => :'vPIS', :'v_cofins' => :'vCOFINS', :'v_fcp' => :'vFCP', :'g_proc' => :'gProc' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 414 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_nullable ⇒ Object
List of attributes with nullable: true
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 101 def self.openapi_nullable Set.new([ :'v_item', :'q_faturada', :'v_prod', :'v_desc', :'v_outro', :'ind_devolucao', :'v_bc', :'p_icms', :'v_icms', :'v_pis', :'v_cofins', :'v_fcp', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 82 def self.openapi_types { :'v_item' => :'Float', :'q_faturada' => :'Float', :'v_prod' => :'Float', :'v_desc' => :'Float', :'v_outro' => :'Float', :'ind_devolucao' => :'Integer', :'v_bc' => :'Float', :'p_icms' => :'Float', :'v_icms' => :'Float', :'v_pis' => :'Float', :'v_cofins' => :'Float', :'v_fcp' => :'Float', :'g_proc' => :'Array<NfcomSefazGProc>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 381 def ==(o) return true if self.equal?(o) self.class == o.class && v_item == o.v_item && q_faturada == o.q_faturada && v_prod == o.v_prod && v_desc == o.v_desc && v_outro == o.v_outro && ind_devolucao == o.ind_devolucao && v_bc == o.v_bc && p_icms == o.p_icms && v_icms == o.v_icms && v_pis == o.v_pis && v_cofins == o.v_cofins && v_fcp == o.v_fcp && g_proc == o.g_proc end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
509 510 511 512 513 514 515 516 517 518 519 520 521 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 509 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
401 402 403 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 401 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
407 408 409 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 407 def hash [v_item, q_faturada, v_prod, v_desc, v_outro, ind_devolucao, v_bc, p_icms, v_icms, v_pis, v_cofins, v_fcp, g_proc].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 223 224 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 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 198 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @q_faturada < 0 invalid_properties.push('invalid value for "q_faturada", must be greater than or equal to 0.') end if !@v_desc.nil? && @v_desc < 0 invalid_properties.push('invalid value for "v_desc", must be greater than or equal to 0.') end if !@v_outro.nil? && @v_outro < 0 invalid_properties.push('invalid value for "v_outro", must be greater than or equal to 0.') end if !@v_bc.nil? && @v_bc < 0 invalid_properties.push('invalid value for "v_bc", must be greater than or equal to 0.') end if !@p_icms.nil? && @p_icms < 0 invalid_properties.push('invalid value for "p_icms", must be greater than or equal to 0.') end if !@v_icms.nil? && @v_icms < 0 invalid_properties.push('invalid value for "v_icms", must be greater than or equal to 0.') end if !@v_pis.nil? && @v_pis < 0 invalid_properties.push('invalid value for "v_pis", must be greater than or equal to 0.') end if !@v_cofins.nil? && @v_cofins < 0 invalid_properties.push('invalid value for "v_cofins", must be greater than or equal to 0.') end if !@v_fcp.nil? && @v_fcp < 0 invalid_properties.push('invalid value for "v_fcp", must be greater than or equal to 0.') end if @g_proc.nil? invalid_properties.push('invalid value for "g_proc", g_proc cannot be nil.') end if @g_proc.length > 10 invalid_properties.push('invalid value for "g_proc", number of items must be less than or equal to 10.') end if @g_proc.length < 1 invalid_properties.push('invalid value for "g_proc", number of items must be greater than or equal to 1.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
485 486 487 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 485 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
491 492 493 494 495 496 497 498 499 500 501 502 503 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 491 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_s ⇒ String
Returns the string representation of the object
479 480 481 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 479 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/nuvemfiscal_sdk_ruby/models/nfcom_sefaz_g_proc_ref.rb', line 254 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @q_faturada < 0 return false if !@v_desc.nil? && @v_desc < 0 return false if !@v_outro.nil? && @v_outro < 0 return false if !@v_bc.nil? && @v_bc < 0 return false if !@p_icms.nil? && @p_icms < 0 return false if !@v_icms.nil? && @v_icms < 0 return false if !@v_pis.nil? && @v_pis < 0 return false if !@v_cofins.nil? && @v_cofins < 0 return false if !@v_fcp.nil? && @v_fcp < 0 return false if @g_proc.nil? return false if @g_proc.length > 10 return false if @g_proc.length < 1 true end |