Class: NeverBounce::API::Request::JobsStart

Inherits:
Base
  • Object
show all
Defined in:
lib/never_bounce/api/request/jobs_start.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#api_key, #api_url, #api_version, #headers, #user_agent

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#to_curl, #to_httparty

Instance Attribute Details

#allow_manual_reviewBoolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/never_bounce/api/request/jobs_start.rb', line 15

def allow_manual_review
  @allow_manual_review
end

#job_idInteger

Returns:

  • (Integer)


9
10
11
# File 'lib/never_bounce/api/request/jobs_start.rb', line 9

def job_id
  @job_id
end

#run_sampleBoolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/never_bounce/api/request/jobs_start.rb', line 12

def run_sample
  @run_sample
end

Class Method Details

.http_methodSymbol

Returns:

  • (Symbol)


18
19
20
# File 'lib/never_bounce/api/request/jobs_start.rb', line 18

def self.http_method
  :post
end

.pathString

Returns:

  • (String)


23
24
25
# File 'lib/never_bounce/api/request/jobs_start.rb', line 23

def self.path
  "jobs/start"
end

.response_klassResponse::JobsStart

Returns:



28
29
30
# File 'lib/never_bounce/api/request/jobs_start.rb', line 28

def self.response_klass
  Response::JobsStart
end

Instance Method Details

#mode_hHash

Return a ready-to-merge mode attributes hash.

Returns:

  • (Hash)


34
35
36
37
38
39
40
41
42
43
44
# File 'lib/never_bounce/api/request/jobs_start.rb', line 34

def mode_h
  @mode_h ||= {}.tap do |_|
    unless (v = run_sample).nil?
      _[:run_sample] = v
    end

    unless (v = allow_manual_review).nil?
      _[:allow_manual_review] = v
    end
  end
end

#to_hHash

Returns:

  • (Hash)


47
48
49
50
51
52
# File 'lib/never_bounce/api/request/jobs_start.rb', line 47

def to_h
  {
    job_id: require_attr(:job_id),
    key: require_attr(:api_key),
  }.merge(mode_h)
end