Class: EcfDgii::Generated::Ecf46Transporte

Inherits:
ApiModelBase show all
Defined in:
lib/ecf_dgii/generated/models/ecf46_transporte.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ Ecf46Transporte

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 140

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `EcfDgii::Generated::Ecf46Transporte` 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 `EcfDgii::Generated::Ecf46Transporte`. 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?(:'via_transporte')
    self.via_transporte = attributes[:'via_transporte']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#conductorObject

Returns the value of attribute conductor.



32
33
34
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 32

def conductor
  @conductor
end

#direccion_destinoObject

Returns the value of attribute direccion_destino.



22
23
24
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 22

def direccion_destino
  @direccion_destino
end

#documento_transporteObject

Returns the value of attribute documento_transporte.



34
35
36
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 34

def documento_transporte
  @documento_transporte
end

#fichaObject

Returns the value of attribute ficha.



36
37
38
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 36

def ficha
  @ficha
end

#nombre_compania_transportistaObject

Returns the value of attribute nombre_compania_transportista.



28
29
30
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 28

def nombre_compania_transportista
  @nombre_compania_transportista
end

#numero_albaranObject

Returns the value of attribute numero_albaran.



44
45
46
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 44

def numero_albaran
  @numero_albaran
end

#numero_viajeObject

Returns the value of attribute numero_viaje.



30
31
32
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 30

def numero_viaje
  @numero_viaje
end

#pais_destinoObject

Returns the value of attribute pais_destino.



24
25
26
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 24

def pais_destino
  @pais_destino
end

#pais_origenObject

Returns the value of attribute pais_origen.



20
21
22
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 20

def pais_origen
  @pais_origen
end

#placaObject

Returns the value of attribute placa.



38
39
40
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 38

def placa
  @placa
end

#rnc_identificacion_compania_transportistaObject

Returns the value of attribute rnc_identificacion_compania_transportista.



26
27
28
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 26

def rnc_identificacion_compania_transportista
  @rnc_identificacion_compania_transportista
end

#ruta_transporteObject

Returns the value of attribute ruta_transporte.



40
41
42
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 40

def ruta_transporte
  @ruta_transporte
end

#via_transporteObject

Returns the value of attribute via_transporte.



18
19
20
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 18

def via_transporte
  @via_transporte
end

#zona_transporteObject

Returns the value of attribute zona_transporte.



42
43
44
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 42

def zona_transporte
  @zona_transporte
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



89
90
91
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 89

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



94
95
96
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 94

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 69

def self.attribute_map
  {
    :'via_transporte' => :'viaTransporte',
    :'pais_origen' => :'paisOrigen',
    :'direccion_destino' => :'direccionDestino',
    :'pais_destino' => :'paisDestino',
    :'rnc_identificacion_compania_transportista' => :'rncIdentificacionCompaniaTransportista',
    :'nombre_compania_transportista' => :'nombreCompaniaTransportista',
    :'numero_viaje' => :'numeroViaje',
    :'conductor' => :'conductor',
    :'documento_transporte' => :'documentoTransporte',
    :'ficha' => :'ficha',
    :'placa' => :'placa',
    :'ruta_transporte' => :'rutaTransporte',
    :'zona_transporte' => :'zonaTransporte',
    :'numero_albaran' => :'numeroAlbaran'
  }
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



279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 279

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



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 119

def self.openapi_nullable
  Set.new([
    :'via_transporte',
    :'pais_origen',
    :'direccion_destino',
    :'pais_destino',
    :'rnc_identificacion_compania_transportista',
    :'nombre_compania_transportista',
    :'numero_viaje',
    :'conductor',
    :'documento_transporte',
    :'ficha',
    :'placa',
    :'ruta_transporte',
    :'zona_transporte',
    :'numero_albaran'
  ])
end

.openapi_typesObject

Attribute type mapping.



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 99

def self.openapi_types
  {
    :'via_transporte' => :'ViaTransporteType',
    :'pais_origen' => :'String',
    :'direccion_destino' => :'String',
    :'pais_destino' => :'String',
    :'rnc_identificacion_compania_transportista' => :'String',
    :'nombre_compania_transportista' => :'String',
    :'numero_viaje' => :'String',
    :'conductor' => :'String',
    :'documento_transporte' => :'String',
    :'ficha' => :'String',
    :'placa' => :'String',
    :'ruta_transporte' => :'String',
    :'zona_transporte' => :'String',
    :'numero_albaran' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 245

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      via_transporte == o.via_transporte &&
      pais_origen == o.pais_origen &&
      direccion_destino == o.direccion_destino &&
      pais_destino == o.pais_destino &&
      rnc_identificacion_compania_transportista == o.rnc_identificacion_compania_transportista &&
      nombre_compania_transportista == o.nombre_compania_transportista &&
      numero_viaje == o.numero_viaje &&
      conductor == o.conductor &&
      documento_transporte == o.documento_transporte &&
      ficha == o.ficha &&
      placa == o.placa &&
      ruta_transporte == o.ruta_transporte &&
      zona_transporte == o.zona_transporte &&
      numero_albaran == o.numero_albaran
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


266
267
268
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 266

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



272
273
274
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 272

def hash
  [via_transporte, pais_origen, direccion_destino, pais_destino, rnc_identificacion_compania_transportista, nombre_compania_transportista, numero_viaje, conductor, documento_transporte, ficha, placa, ruta_transporte, zona_transporte, numero_albaran].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



213
214
215
216
217
218
219
220
221
222
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 213

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  pattern = Regexp.new(/^[0-9]{1,20}$/)
  if !@documento_transporte.nil? && @documento_transporte !~ pattern
    invalid_properties.push("invalid value for \"documento_transporte\", must conform to the pattern #{pattern}.")
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



301
302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 301

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

Returns:

  • (Boolean)

    true if the model is valid



226
227
228
229
230
# File 'lib/ecf_dgii/generated/models/ecf46_transporte.rb', line 226

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if !@documento_transporte.nil? && @documento_transporte !~ Regexp.new(/^[0-9]{1,20}$/)
  true
end