Skip to content

update_integration

update_integration(
    integration_id: IntegrationId,
    webhook_action: WebhookAction,
    *,
    config_overrides: Optional[SecurityAgentClientConfig] = None,
) -> UpdateIntegrationOutput

Creates an integration's webhook, or rotates the HMAC signing secret of an existing one. The secret is returned only once, in this response, and cannot be retrieved again.

Parameters:

  • integration_id (IntegrationId) –

    The ID of the integration whose webhook you want to create or rotate.

  • webhook_action (WebhookAction) –

    The action to perform on the integration's webhook.

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 update_integration(
    self,
    integration_id: "capo_securityagent.types.integration_id.IntegrationId",
    webhook_action: "capo_securityagent.types.webhook_action.WebhookAction",
    *,
    config_overrides: Optional[SecurityAgentClientConfig] = None,
) -> "capo_securityagent.types.update_integration_output.UpdateIntegrationOutput":
    """<p>Creates an integration's webhook, or rotates the HMAC signing secret of an existing one. The secret is returned only once, in this response, and cannot be retrieved again.</p>

    Args:
        integration_id: <p>The ID of the integration whose webhook you want to create or rotate.</p>
        webhook_action: <p>The action to perform on the integration's webhook.</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.update_integration_input.UpdateIntegrationInput]",
    ) -> OperationResponse[
        "capo_securityagent.types.update_integration_output.UpdateIntegrationOutput"
    ]:
        import capo_securityagent._operations.security_agent.update_integration

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

    def _redact_output(
        output: "capo_securityagent.types.update_integration_output.UpdateIntegrationOutput",
    ) -> dict[str, Any]:
        import capo_securityagent.types.update_integration_output

        return capo_securityagent.types.update_integration_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateIntegration", redact_output=_redact_output),
    )
    input_: capo_securityagent.types.update_integration_input.UpdateIntegrationInput = {
        "integration_id": integration_id,
        "webhook_action": webhook_action,
    }

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