Starts a new code review job for a code review configuration. The job executes the security-focused code analysis defined in the code review.
Parameters:
-
agent_space_id
(str)
–
The unique identifier of the agent space.
-
code_review_id
(str)
–
The unique identifier of the code review to start a job for.
-
diff_source
(Optional[DiffSource], default:
None
)
–
Source of the diff for a differential scan. When present, the job analyzes only the changed lines instead of performing a full scan.
Raises:
Source code in docs_src/capo_securityagent/_services/async_security_agent.py
| async def start_code_review_job(
self,
agent_space_id: str,
code_review_id: str,
*,
config_overrides: Optional[AsyncSecurityAgentClientConfig] = None,
diff_source: Optional["capo_securityagent.types.diff_source.DiffSource"] = None,
) -> (
"capo_securityagent.types.start_code_review_job_output.StartCodeReviewJobOutput"
):
"""<p>Starts a new code review job for a code review configuration. The job executes the security-focused code analysis defined in the code review.</p>
Args:
agent_space_id: <p>The unique identifier of the agent space.</p>
code_review_id: <p>The unique identifier of the code review to start a job for.</p>
diff_source: <p>Source of the diff for a differential scan. When present, the job analyzes only the changed lines instead of performing a full scan.</p>
Raises:
capo_securityagent.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_securityagent.types.start_code_review_job_input.StartCodeReviewJobInput]",
) -> AsyncOperationResponse[
"capo_securityagent.types.start_code_review_job_output.StartCodeReviewJobOutput"
]:
import capo_securityagent._operations.security_agent.start_code_review_job
(
output,
http_response,
) = await capo_securityagent._operations.security_agent.start_code_review_job.async_start_code_review_job(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("StartCodeReviewJob")
)
input_: capo_securityagent.types.start_code_review_job_input.StartCodeReviewJobInput = {
"agent_space_id": agent_space_id,
"code_review_id": code_review_id,
}
if diff_source is not None:
input_["diff_source"] = diff_source
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|