Class: KazeClient::CreateJobRequest

Inherits:
Utils::FinalRequest show all
Includes:
Utils::AuthentifiedRequest
Defined in:
lib/kaze_client/request/requests/jobs/create_job_request.rb

Overview

Create a job from the current user to the target company.

Constant Summary

Constants inherited from Request

Request::DEFAULT_HEADERS

Instance Attribute Summary collapse

Attributes included from Utils::AuthentifiedRequest

#token

Attributes inherited from Request

#body, #headers, #method, #query, #url

Instance Method Summary collapse

Methods included from Utils::AuthentifiedRequest

#with_token

Methods inherited from Request

#error_for, #parameters

Constructor Details

#initialize(target_id, workflow) ⇒ CreateJobRequest

Returns a new instance of CreateJobRequest.

Parameters:

  • target_id (String)

    The id of the target company.

  • workflow (Hash)

    The workflow to use to create the job.

Since:

  • 0.1.0



23
24
25
26
27
28
29
30
31
32
# File 'lib/kaze_client/request/requests/jobs/create_job_request.rb', line 23

def initialize(target_id, workflow)
  super(:post, 'api/jobs')

  @target_id = target_id
  @workflow  = workflow
  @body      = {
    target_id: @target_id,
    workflow:  @workflow
  }
end

Instance Attribute Details

#target_idString (readonly)

Returns The id of the target company.

Returns:

  • (String)

    The id of the target company.

Since:

  • 0.1.0



16
17
18
# File 'lib/kaze_client/request/requests/jobs/create_job_request.rb', line 16

def target_id
  @target_id
end

#workflowHash (readonly)

Returns The workflow used to create the job.

Returns:

  • (Hash)

    The workflow used to create the job.

Since:

  • 0.1.0



19
20
21
# File 'lib/kaze_client/request/requests/jobs/create_job_request.rb', line 19

def workflow
  @workflow
end