Skip to content

create_agent_space async

create_agent_space(
    name: AgentName,
    *,
    config_overrides: Optional[AsyncSecurityAgentClientConfig] = None,
    description: Optional[str] = None,
    aws_resources: Optional[AWSResources] = None,
    target_domain_ids: Optional[TargetDomainIdList] = None,
    code_review_settings: Optional[CodeReviewSettings] = None,
    kms_key_id: Optional[KmsKeyId] = None,
    tags: Optional[TagMap] = None,
) -> CreateAgentSpaceOutput

Creates a new agent space. An agent space is a dedicated workspace for securing a specific application.

Parameters:

  • name (AgentName) –

    The name of the agent space.

  • description (Optional[str], default: None ) –

    A description of the agent space.

  • aws_resources (Optional[AWSResources], default: None ) –

    The AWS resources to associate with the agent space.

  • target_domain_ids (Optional[TargetDomainIdList], default: None ) –

    The list of target domain identifiers to associate with the agent space.

  • code_review_settings (Optional[CodeReviewSettings], default: None ) –

    The code review settings for the agent space.

  • kms_key_id (Optional[KmsKeyId], default: None ) –

    The identifier of the AWS KMS key to use for encrypting data in the agent space.

  • tags (Optional[TagMap], default: None ) –

    The tags to associate with the agent space.

Raises:

Source code in docs_src/capo_securityagent/_services/async_security_agent.py
async def create_agent_space(
    self,
    name: "capo_securityagent.types.agent_name.AgentName",
    *,
    config_overrides: Optional[AsyncSecurityAgentClientConfig] = None,
    description: Optional[str] = None,
    aws_resources: Optional[
        "capo_securityagent.types.aws_resources.AWSResources"
    ] = None,
    target_domain_ids: Optional[
        "capo_securityagent.types.target_domain_id_list.TargetDomainIdList"
    ] = None,
    code_review_settings: Optional[
        "capo_securityagent.types.code_review_settings.CodeReviewSettings"
    ] = None,
    kms_key_id: Optional["capo_securityagent.types.kms_key_id.KmsKeyId"] = None,
    tags: Optional["capo_securityagent.types.tag_map.TagMap"] = None,
) -> "capo_securityagent.types.create_agent_space_output.CreateAgentSpaceOutput":
    """<p>Creates a new agent space. An agent space is a dedicated workspace for securing a specific application.</p>

    Args:
        name: <p>The name of the agent space.</p>
        description: <p>A description of the agent space.</p>
        aws_resources: <p>The AWS resources to associate with the agent space.</p>
        target_domain_ids: <p>The list of target domain identifiers to associate with the agent space.</p>
        code_review_settings: <p>The code review settings for the agent space.</p>
        kms_key_id: <p>The identifier of the AWS KMS key to use for encrypting data in the agent space.</p>
        tags: <p>The tags to associate with the agent space.</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.create_agent_space_input.CreateAgentSpaceInput]",
    ) -> AsyncOperationResponse[
        "capo_securityagent.types.create_agent_space_output.CreateAgentSpaceOutput"
    ]:
        import capo_securityagent._operations.security_agent.create_agent_space

        (
            output,
            http_response,
        ) = await capo_securityagent._operations.security_agent.create_agent_space.async_create_agent_space(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateAgentSpace")
    )
    input_: capo_securityagent.types.create_agent_space_input.CreateAgentSpaceInput = {
        "name": name
    }
    if description is not None:
        input_["description"] = description
    if aws_resources is not None:
        input_["aws_resources"] = aws_resources
    if target_domain_ids is not None:
        input_["target_domain_ids"] = target_domain_ids
    if code_review_settings is not None:
        input_["code_review_settings"] = code_review_settings
    if kms_key_id is not None:
        input_["kms_key_id"] = kms_key_id
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output