Skip to content

create_integration

create_integration(
    provider: Provider,
    input: ProviderInput,
    integration_display_name: str,
    *,
    config_overrides: Optional[SecurityAgentClientConfig] = None,
    kms_key_id: Optional[KmsKeyId] = None,
    tags: Optional[TagMap] = None,
    private_connection_name: Optional[PrivateConnectionName] = None,
) -> CreateIntegrationOutput

Creates a new integration with a third-party provider, such as GitHub, for code review and remediation.

Parameters:

  • provider (Provider) –

    The integration provider.

  • input (ProviderInput) –

    The provider-specific input required to create the integration.

  • integration_display_name (str) –

    The display name for the integration.

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

    The identifier of the AWS KMS key to use for encrypting data associated with the integration.

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

    The tags to associate with the integration.

  • private_connection_name (Optional[PrivateConnectionName], default: None ) –

    The name of an active private connection used to reach a self-hosted provider instance over private networking. Specify this when the instance is not publicly reachable.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • ConflictException –

    The request could not be completed due to a conflict with the current state of the resource.

  • InternalServerException –

    An unexpected error occurred during the processing of your request.

  • ResourceNotFoundException –

    The specified resource was not found. Verify that the resource identifier is correct and that the resource exists in the specified agent space or account.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The input fails to satisfy the constraints specified by the service.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_securityagent/_services/security_agent.py
def create_integration(
    self,
    provider: "capo_securityagent.types.provider.Provider",
    input: "capo_securityagent.types.provider_input.ProviderInput",
    integration_display_name: str,
    *,
    config_overrides: Optional[SecurityAgentClientConfig] = None,
    kms_key_id: Optional["capo_securityagent.types.kms_key_id.KmsKeyId"] = None,
    tags: Optional["capo_securityagent.types.tag_map.TagMap"] = None,
    private_connection_name: Optional[
        "capo_securityagent.types.private_connection_name.PrivateConnectionName"
    ] = None,
) -> "capo_securityagent.types.create_integration_output.CreateIntegrationOutput":
    """<p>Creates a new integration with a third-party provider, such as GitHub, for code review and remediation.</p>

    Args:
        provider: <p>The integration provider.</p>
        input: <p>The provider-specific input required to create the integration.</p>
        integration_display_name: <p>The display name for the integration.</p>
        kms_key_id: <p>The identifier of the AWS KMS key to use for encrypting data associated with the integration.</p>
        tags: <p>The tags to associate with the integration.</p>
        private_connection_name: <p>The name of an active private connection used to reach a self-hosted provider instance over private networking. Specify this when the instance is not publicly reachable.</p>

    Raises:
        capo_securityagent.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_securityagent.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the resource.</p>
        capo_securityagent.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred during the processing of your request.</p>
        capo_securityagent.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found. Verify that the resource identifier is correct and that the resource exists in the specified agent space or account.</p>
        capo_securityagent.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_securityagent.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the service.</p>
        capo_securityagent.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_securityagent.types.create_integration_input.CreateIntegrationInput]",
    ) -> OperationResponse[
        "capo_securityagent.types.create_integration_output.CreateIntegrationOutput"
    ]:
        import capo_securityagent._operations.security_agent.create_integration

        output, http_response = (
            capo_securityagent._operations.security_agent.create_integration.create_integration(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_securityagent.types.create_integration_input.CreateIntegrationInput",
    ) -> dict[str, Any]:
        import capo_securityagent.types.create_integration_input

        return capo_securityagent.types.create_integration_input.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateIntegration", redact_input=_redact_input),
    )
    input_: capo_securityagent.types.create_integration_input.CreateIntegrationInput = {
        "provider": provider,
        "input": input,
        "integration_display_name": integration_display_name,
    }
    if kms_key_id is not None:
        input_["kms_key_id"] = kms_key_id
    if tags is not None:
        input_["tags"] = tags
    if private_connection_name is not None:
        input_["private_connection_name"] = private_connection_name

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output