Class: Apiddress::BatchStatusResponse

Inherits:
Data
  • Object
show all
Defined in:
lib/apiddress/models.rb

Overview

Current state of an asynchronous batch job.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#batch_idObject (readonly)

Returns the value of attribute batch_id

Returns:

  • (Object)

    the current value of batch_id



103
104
105
# File 'lib/apiddress/models.rb', line 103

def batch_id
  @batch_id
end

#completed_atObject (readonly)

Returns the value of attribute completed_at

Returns:

  • (Object)

    the current value of completed_at



103
104
105
# File 'lib/apiddress/models.rb', line 103

def completed_at
  @completed_at
end

#created_atObject (readonly)

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



103
104
105
# File 'lib/apiddress/models.rb', line 103

def created_at
  @created_at
end

#processed_countObject (readonly)

Returns the value of attribute processed_count

Returns:

  • (Object)

    the current value of processed_count



103
104
105
# File 'lib/apiddress/models.rb', line 103

def processed_count
  @processed_count
end

#resultsObject (readonly)

Returns the value of attribute results

Returns:

  • (Object)

    the current value of results



103
104
105
# File 'lib/apiddress/models.rb', line 103

def results
  @results
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



103
104
105
# File 'lib/apiddress/models.rb', line 103

def status
  @status
end

#submitted_countObject (readonly)

Returns the value of attribute submitted_count

Returns:

  • (Object)

    the current value of submitted_count



103
104
105
# File 'lib/apiddress/models.rb', line 103

def 
  @submitted_count
end

Class Method Details

.from_hash(data) ⇒ Object



114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/apiddress/models.rb', line 114

def self.from_hash(data)
  raw_results = data["results"]
  new(
    batch_id:        data["batch_id"],
    status:          data["status"],
    submitted_count: data["submitted_count"].to_i,
    processed_count: data["processed_count"].to_i,
    created_at:      data["created_at"],
    completed_at:    data["completed_at"],
    results:         raw_results.nil? ? nil : raw_results.map { |item| ValidateEmailResponse.from_hash(item) },
  )
end