Class: FactPulse::FactureFacturX
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- FactPulse::FactureFacturX
- Defined in:
- lib/factpulse/models/facture_factur_x.rb
Overview
Modèle de données pour une facture destinée à être convertie en Factur-X.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#cadre_de_facturation ⇒ Object
Returns the value of attribute cadre_de_facturation.
-
#commentaire ⇒ Object
Returns the value of attribute commentaire.
-
#date_echeance_paiement ⇒ Object
Returns the value of attribute date_echeance_paiement.
-
#date_facture ⇒ Object
Returns the value of attribute date_facture.
-
#destinataire ⇒ Object
Returns the value of attribute destinataire.
-
#fournisseur ⇒ Object
Returns the value of attribute fournisseur.
-
#id_utilisateur_courant ⇒ Object
Returns the value of attribute id_utilisateur_courant.
-
#lignes_de_poste ⇒ Object
Returns the value of attribute lignes_de_poste.
-
#lignes_de_tva ⇒ Object
Returns the value of attribute lignes_de_tva.
-
#mode_depot ⇒ Object
Returns the value of attribute mode_depot.
-
#montant_total ⇒ Object
Returns the value of attribute montant_total.
-
#numero_facture ⇒ Object
Returns the value of attribute numero_facture.
-
#pieces_jointes_complementaires ⇒ Object
Returns the value of attribute pieces_jointes_complementaires.
-
#references ⇒ Object
Returns the value of attribute references.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.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.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ FactureFacturX
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ FactureFacturX
Initializes the object
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 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 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 130 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::FactureFacturX` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::FactureFacturX`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'numero_facture') self.numero_facture = attributes[:'numero_facture'] else self.numero_facture = nil end if attributes.key?(:'date_echeance_paiement') self.date_echeance_paiement = attributes[:'date_echeance_paiement'] else self.date_echeance_paiement = nil end if attributes.key?(:'date_facture') self.date_facture = attributes[:'date_facture'] end if attributes.key?(:'mode_depot') self.mode_depot = attributes[:'mode_depot'] else self.mode_depot = nil end if attributes.key?(:'destinataire') self.destinataire = attributes[:'destinataire'] else self.destinataire = nil end if attributes.key?(:'fournisseur') self.fournisseur = attributes[:'fournisseur'] else self.fournisseur = nil end if attributes.key?(:'cadre_de_facturation') self.cadre_de_facturation = attributes[:'cadre_de_facturation'] else self.cadre_de_facturation = nil end if attributes.key?(:'references') self.references = attributes[:'references'] else self.references = nil end if attributes.key?(:'montant_total') self.montant_total = attributes[:'montant_total'] else self.montant_total = nil end if attributes.key?(:'lignes_de_poste') if (value = attributes[:'lignes_de_poste']).is_a?(Array) self.lignes_de_poste = value end end if attributes.key?(:'lignes_de_tva') if (value = attributes[:'lignes_de_tva']).is_a?(Array) self.lignes_de_tva = value end end if attributes.key?(:'commentaire') self.commentaire = attributes[:'commentaire'] end if attributes.key?(:'id_utilisateur_courant') self.id_utilisateur_courant = attributes[:'id_utilisateur_courant'] end if attributes.key?(:'pieces_jointes_complementaires') if (value = attributes[:'pieces_jointes_complementaires']).is_a?(Array) self.pieces_jointes_complementaires = value end end end |
Instance Attribute Details
#cadre_de_facturation ⇒ Object
Returns the value of attribute cadre_de_facturation.
31 32 33 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 31 def cadre_de_facturation @cadre_de_facturation end |
#commentaire ⇒ Object
Returns the value of attribute commentaire.
41 42 43 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 41 def commentaire @commentaire end |
#date_echeance_paiement ⇒ Object
Returns the value of attribute date_echeance_paiement.
21 22 23 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 21 def date_echeance_paiement @date_echeance_paiement end |
#date_facture ⇒ Object
Returns the value of attribute date_facture.
23 24 25 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 23 def date_facture @date_facture end |
#destinataire ⇒ Object
Returns the value of attribute destinataire.
27 28 29 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 27 def destinataire @destinataire end |
#fournisseur ⇒ Object
Returns the value of attribute fournisseur.
29 30 31 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 29 def fournisseur @fournisseur end |
#id_utilisateur_courant ⇒ Object
Returns the value of attribute id_utilisateur_courant.
43 44 45 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 43 def id_utilisateur_courant @id_utilisateur_courant end |
#lignes_de_poste ⇒ Object
Returns the value of attribute lignes_de_poste.
37 38 39 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 37 def lignes_de_poste @lignes_de_poste end |
#lignes_de_tva ⇒ Object
Returns the value of attribute lignes_de_tva.
39 40 41 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 39 def lignes_de_tva @lignes_de_tva end |
#mode_depot ⇒ Object
Returns the value of attribute mode_depot.
25 26 27 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 25 def mode_depot @mode_depot end |
#montant_total ⇒ Object
Returns the value of attribute montant_total.
35 36 37 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 35 def montant_total @montant_total end |
#numero_facture ⇒ Object
Returns the value of attribute numero_facture.
19 20 21 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 19 def numero_facture @numero_facture end |
#pieces_jointes_complementaires ⇒ Object
Returns the value of attribute pieces_jointes_complementaires.
45 46 47 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 45 def pieces_jointes_complementaires @pieces_jointes_complementaires end |
#references ⇒ Object
Returns the value of attribute references.
33 34 35 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 33 def references @references end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
90 91 92 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 90 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
95 96 97 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 95 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 70 def self.attribute_map { :'numero_facture' => :'numeroFacture', :'date_echeance_paiement' => :'dateEcheancePaiement', :'date_facture' => :'dateFacture', :'mode_depot' => :'modeDepot', :'destinataire' => :'destinataire', :'fournisseur' => :'fournisseur', :'cadre_de_facturation' => :'cadreDeFacturation', :'references' => :'references', :'montant_total' => :'montantTotal', :'lignes_de_poste' => :'lignesDePoste', :'lignes_de_tva' => :'lignesDeTva', :'commentaire' => :'commentaire', :'id_utilisateur_courant' => :'idUtilisateurCourant', :'pieces_jointes_complementaires' => :'piecesJointesComplementaires' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 394 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
120 121 122 123 124 125 126 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 120 def self.openapi_nullable Set.new([ :'commentaire', :'id_utilisateur_courant', :'pieces_jointes_complementaires' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 100 def self.openapi_types { :'numero_facture' => :'String', :'date_echeance_paiement' => :'String', :'date_facture' => :'String', :'mode_depot' => :'ModeDepot', :'destinataire' => :'Destinataire', :'fournisseur' => :'Fournisseur', :'cadre_de_facturation' => :'CadreDeFacturation', :'references' => :'References', :'montant_total' => :'MontantTotal', :'lignes_de_poste' => :'Array<LigneDePoste>', :'lignes_de_tva' => :'Array<LigneDeTVA>', :'commentaire' => :'String', :'id_utilisateur_courant' => :'Integer', :'pieces_jointes_complementaires' => :'Array<PieceJointeComplementaire>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 360 def ==(o) return true if self.equal?(o) self.class == o.class && numero_facture == o.numero_facture && date_echeance_paiement == o.date_echeance_paiement && date_facture == o.date_facture && mode_depot == o.mode_depot && destinataire == o.destinataire && fournisseur == o.fournisseur && cadre_de_facturation == o.cadre_de_facturation && references == o.references && montant_total == o.montant_total && lignes_de_poste == o.lignes_de_poste && lignes_de_tva == o.lignes_de_tva && commentaire == o.commentaire && id_utilisateur_courant == o.id_utilisateur_courant && pieces_jointes_complementaires == o.pieces_jointes_complementaires end |
#eql?(o) ⇒ Boolean
381 382 383 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 381 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
387 388 389 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 387 def hash [numero_facture, date_echeance_paiement, date_facture, mode_depot, destinataire, fournisseur, cadre_de_facturation, references, montant_total, lignes_de_poste, lignes_de_tva, commentaire, id_utilisateur_courant, pieces_jointes_complementaires].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 258 259 260 261 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 225 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @numero_facture.nil? invalid_properties.push('invalid value for "numero_facture", numero_facture cannot be nil.') end if @date_echeance_paiement.nil? invalid_properties.push('invalid value for "date_echeance_paiement", date_echeance_paiement cannot be nil.') end if @mode_depot.nil? invalid_properties.push('invalid value for "mode_depot", mode_depot cannot be nil.') end if @destinataire.nil? invalid_properties.push('invalid value for "destinataire", destinataire cannot be nil.') end if @fournisseur.nil? invalid_properties.push('invalid value for "fournisseur", fournisseur cannot be nil.') end if @cadre_de_facturation.nil? invalid_properties.push('invalid value for "cadre_de_facturation", cadre_de_facturation cannot be nil.') end if @references.nil? invalid_properties.push('invalid value for "references", references cannot be nil.') end if @montant_total.nil? invalid_properties.push('invalid value for "montant_total", montant_total cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
416 417 418 419 420 421 422 423 424 425 426 427 428 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 416 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 |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
265 266 267 268 269 270 271 272 273 274 275 276 |
# File 'lib/factpulse/models/facture_factur_x.rb', line 265 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @numero_facture.nil? return false if @date_echeance_paiement.nil? return false if @mode_depot.nil? return false if @destinataire.nil? return false if @fournisseur.nil? return false if @cadre_de_facturation.nil? return false if @references.nil? return false if @montant_total.nil? true end |