Class: EcfDgii::Generated::EcfResponse

Inherits:
ApiModelBase show all
Defined in:
lib/ecf_dgii/generated/models/ecf_response.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 = {}) ⇒ EcfResponse

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
251
252
253
254
255
256
257
258
259
260
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
# File 'lib/ecf_dgii/generated/models/ecf_response.rb', line 177

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#acecfsObject

ACECFs received from the receptor for this outbound ECF.



63
64
65
# File 'lib/ecf_dgii/generated/models/ecf_response.rb', line 63

def acecfs
  @acecfs
end

#cod_secObject

Returns the value of attribute cod_sec.



46
47
48
# File 'lib/ecf_dgii/generated/models/ecf_response.rb', line 46

def cod_sec
  @cod_sec
end

#dgii_environmentObject

Returns the value of attribute dgii_environment.



60
61
62
# File 'lib/ecf_dgii/generated/models/ecf_response.rb', line 60

def dgii_environment
  @dgii_environment
end

#ecf_contentObject

Returns the value of attribute ecf_content.



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

def ecf_content
  @ecf_content
end

#emisor_receptor_errorsObject

Returns the value of attribute emisor_receptor_errors.



56
57
58
# File 'lib/ecf_dgii/generated/models/ecf_response.rb', line 56

def emisor_receptor_errors
  @emisor_receptor_errors
end

#encfObject

Returns the value of attribute encf.



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

def encf
  @encf
end

#errorsObject

Returns the value of attribute errors.



52
53
54
# File 'lib/ecf_dgii/generated/models/ecf_response.rb', line 52

def errors
  @errors
end

#estatusObject

Returns the value of attribute estatus.



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

def estatus
  @estatus
end

#fecha_emisionObject

Returns the value of attribute fecha_emision.



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

def fecha_emision
  @fecha_emision
end

#fecha_firmaObject

Returns the value of attribute fecha_firma.



48
49
50
# File 'lib/ecf_dgii/generated/models/ecf_response.rb', line 48

def fecha_firma
  @fecha_firma
end

#file_nameObject

Returns the value of attribute file_name.



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

def file_name
  @file_name
end

#impresion_urlObject

Returns the value of attribute impresion_url.



65
66
67
# File 'lib/ecf_dgii/generated/models/ecf_response.rb', line 65

def impresion_url
  @impresion_url
end

#include_ecf_contentObject

Returns the value of attribute include_ecf_content.



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

def include_ecf_content
  @include_ecf_content
end

#mensajeObject

Returns the value of attribute mensaje.



50
51
52
# File 'lib/ecf_dgii/generated/models/ecf_response.rb', line 50

def mensaje
  @mensaje
end

#message_idObject

Returns the value of attribute message_id.



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

def message_id
  @message_id
end

#monto_totalObject

Returns the value of attribute monto_total.



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

def monto_total
  @monto_total
end

#progressObject

Returns the value of attribute progress.



54
55
56
# File 'lib/ecf_dgii/generated/models/ecf_response.rb', line 54

def progress
  @progress
end

#queue_nameObject

Returns the value of attribute queue_name.



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

def queue_name
  @queue_name
end

#rnc_emisorObject

Returns the value of attribute rnc_emisor.



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

def rnc_emisor
  @rnc_emisor
end

#rnc_receptorObject

Returns the value of attribute rnc_receptor.



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

def rnc_receptor
  @rnc_receptor
end

#secuencia_utilizadaObject

Returns the value of attribute secuencia_utilizada.



58
59
60
# File 'lib/ecf_dgii/generated/models/ecf_response.rb', line 58

def secuencia_utilizada
  @secuencia_utilizada
end

#tenant_idObject

Returns the value of attribute tenant_id.



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

def tenant_id
  @tenant_id
end

#timestampObject

Returns the value of attribute timestamp.



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

def timestamp
  @timestamp
end

#tipo_ecfObject

Returns the value of attribute tipo_ecf.



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

def tipo_ecf
  @tipo_ecf
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



120
121
122
# File 'lib/ecf_dgii/generated/models/ecf_response.rb', line 120

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



125
126
127
# File 'lib/ecf_dgii/generated/models/ecf_response.rb', line 125

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/ecf_dgii/generated/models/ecf_response.rb', line 90

def self.attribute_map
  {
    :'message_id' => :'messageId',
    :'timestamp' => :'timestamp',
    :'fecha_emision' => :'fechaEmision',
    :'queue_name' => :'queueName',
    :'include_ecf_content' => :'includeEcfContent',
    :'ecf_content' => :'ecfContent',
    :'tipo_ecf' => :'tipoEcf',
    :'encf' => :'encf',
    :'rnc_emisor' => :'rncEmisor',
    :'rnc_receptor' => :'rncReceptor',
    :'monto_total' => :'montoTotal',
    :'file_name' => :'fileName',
    :'tenant_id' => :'tenantId',
    :'estatus' => :'estatus',
    :'cod_sec' => :'codSec',
    :'fecha_firma' => :'fechaFirma',
    :'mensaje' => :'mensaje',
    :'errors' => :'errors',
    :'progress' => :'progress',
    :'emisor_receptor_errors' => :'emisorReceptorErrors',
    :'secuencia_utilizada' => :'secuenciaUtilizada',
    :'dgii_environment' => :'dgiiEnvironment',
    :'acecfs' => :'acecfs',
    :'impresion_url' => :'impresionUrl'
  }
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



590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
# File 'lib/ecf_dgii/generated/models/ecf_response.rb', line 590

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



160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/ecf_dgii/generated/models/ecf_response.rb', line 160

def self.openapi_nullable
  Set.new([
    :'rnc_receptor',
    :'file_name',
    :'estatus',
    :'cod_sec',
    :'fecha_firma',
    :'mensaje',
    :'errors',
    :'emisor_receptor_errors',
    :'secuencia_utilizada',
    :'impresion_url'
  ])
end

.openapi_typesObject

Attribute type mapping.



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

def self.openapi_types
  {
    :'message_id' => :'String',
    :'timestamp' => :'Time',
    :'fecha_emision' => :'Date',
    :'queue_name' => :'String',
    :'include_ecf_content' => :'Boolean',
    :'ecf_content' => :'String',
    :'tipo_ecf' => :'AllTipoECFTypes',
    :'encf' => :'String',
    :'rnc_emisor' => :'String',
    :'rnc_receptor' => :'String',
    :'monto_total' => :'SearchEcfsAmountFromParameter',
    :'file_name' => :'String',
    :'tenant_id' => :'String',
    :'estatus' => :'EcfEstado',
    :'cod_sec' => :'String',
    :'fecha_firma' => :'Time',
    :'mensaje' => :'String',
    :'errors' => :'String',
    :'progress' => :'EcfProgress',
    :'emisor_receptor_errors' => :'String',
    :'secuencia_utilizada' => :'Boolean',
    :'dgii_environment' => :'DGIIEnvironment',
    :'acecfs' => :'Array<AcecfSummaryDto>',
    :'impresion_url' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      message_id == o.message_id &&
      timestamp == o.timestamp &&
      fecha_emision == o.fecha_emision &&
      queue_name == o.queue_name &&
      include_ecf_content == o.include_ecf_content &&
      ecf_content == o.ecf_content &&
      tipo_ecf == o.tipo_ecf &&
      encf == o.encf &&
      rnc_emisor == o.rnc_emisor &&
      rnc_receptor == o.rnc_receptor &&
      monto_total == o.monto_total &&
      file_name == o.file_name &&
      tenant_id == o.tenant_id &&
      estatus == o.estatus &&
      cod_sec == o.cod_sec &&
      fecha_firma == o.fecha_firma &&
      mensaje == o.mensaje &&
      errors == o.errors &&
      progress == o.progress &&
      emisor_receptor_errors == o.emisor_receptor_errors &&
      secuencia_utilizada == o.secuencia_utilizada &&
      dgii_environment == o.dgii_environment &&
      acecfs == o.acecfs &&
      impresion_url == o.impresion_url
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


577
578
579
# File 'lib/ecf_dgii/generated/models/ecf_response.rb', line 577

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



583
584
585
# File 'lib/ecf_dgii/generated/models/ecf_response.rb', line 583

def hash
  [message_id, timestamp, fecha_emision, queue_name, include_ecf_content, ecf_content, tipo_ecf, encf, rnc_emisor, rnc_receptor, monto_total, file_name, tenant_id, estatus, cod_sec, fecha_firma, mensaje, errors, progress, emisor_receptor_errors, secuencia_utilizada, dgii_environment, acecfs, impresion_url].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @message_id.nil?
    invalid_properties.push('invalid value for "message_id", message_id cannot be nil.')
  end

  if @timestamp.nil?
    invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
  end

  if @fecha_emision.nil?
    invalid_properties.push('invalid value for "fecha_emision", fecha_emision cannot be nil.')
  end

  if @queue_name.nil?
    invalid_properties.push('invalid value for "queue_name", queue_name cannot be nil.')
  end

  if @include_ecf_content.nil?
    invalid_properties.push('invalid value for "include_ecf_content", include_ecf_content cannot be nil.')
  end

  if @ecf_content.nil?
    invalid_properties.push('invalid value for "ecf_content", ecf_content cannot be nil.')
  end

  if @tipo_ecf.nil?
    invalid_properties.push('invalid value for "tipo_ecf", tipo_ecf cannot be nil.')
  end

  if @encf.nil?
    invalid_properties.push('invalid value for "encf", encf cannot be nil.')
  end

  if @rnc_emisor.nil?
    invalid_properties.push('invalid value for "rnc_emisor", rnc_emisor cannot be nil.')
  end

  if @monto_total.nil?
    invalid_properties.push('invalid value for "monto_total", monto_total cannot be nil.')
  end

  if @tenant_id.nil?
    invalid_properties.push('invalid value for "tenant_id", tenant_id cannot be nil.')
  end

  if @progress.nil?
    invalid_properties.push('invalid value for "progress", progress cannot be nil.')
  end

  if @dgii_environment.nil?
    invalid_properties.push('invalid value for "dgii_environment", dgii_environment cannot be nil.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



612
613
614
615
616
617
618
619
620
621
622
623
624
# File 'lib/ecf_dgii/generated/models/ecf_response.rb', line 612

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



396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
# File 'lib/ecf_dgii/generated/models/ecf_response.rb', line 396

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @message_id.nil?
  return false if @timestamp.nil?
  return false if @fecha_emision.nil?
  return false if @queue_name.nil?
  return false if @include_ecf_content.nil?
  return false if @ecf_content.nil?
  return false if @tipo_ecf.nil?
  return false if @encf.nil?
  return false if @rnc_emisor.nil?
  return false if @monto_total.nil?
  return false if @tenant_id.nil?
  return false if @progress.nil?
  return false if @dgii_environment.nil?
  true
end