Skip to content

delete_environment_template_version async

delete_environment_template_version(
    template_name: ResourceName,
    major_version: TemplateVersionPart,
    minor_version: TemplateVersionPart,
    *,
    config_overrides: Optional[AsyncProtonClientConfig] = None,
) -> DeleteEnvironmentTemplateVersionOutput

If no other minor versions of an environment template exist, delete a major version of the environment template if it's not the Recommended version. Delete the Recommended version of the environment template if no other major versions or minor versions of the environment template exist. A major version of an environment template is a version that's not backward compatible.

Delete a minor version of an environment template if it isn't the Recommended version. Delete a Recommended minor version of the environment template if no other minor versions of the environment template exist. A minor version of an environment template is a version that's backward compatible.

Parameters:

  • template_name (ResourceName) –

    The name of the environment template.

  • major_version (TemplateVersionPart) –

    The environment template major version to delete.

  • minor_version (TemplateVersionPart) –

    The environment template minor version to delete.

Raises:

Source code in docs_src/capo_proton/_services/async_proton.py
async def delete_environment_template_version(
    self,
    template_name: "capo_proton.types.resource_name.ResourceName",
    major_version: "capo_proton.types.template_version_part.TemplateVersionPart",
    minor_version: "capo_proton.types.template_version_part.TemplateVersionPart",
    *,
    config_overrides: Optional[AsyncProtonClientConfig] = None,
) -> "capo_proton.types.delete_environment_template_version_output.DeleteEnvironmentTemplateVersionOutput":
    """<p>If no other minor versions of an environment template exist, delete a major version of the environment template if it's not the <code>Recommended</code> version. Delete the <code>Recommended</code> version of the environment template if no other major versions or minor versions of the environment template exist. A major version of an environment template is a version that's not backward compatible.</p> <p>Delete a minor version of an environment template if it <i>isn't</i> the <code>Recommended</code> version. Delete a <code>Recommended</code> minor version of the environment template if no other minor versions of the environment template exist. A minor version of an environment template is a version that's backward compatible.</p>

    Args:
        template_name: <p>The name of the environment template.</p>
        major_version: <p>The environment template major version to delete.</p>
        minor_version: <p>The environment template minor version to delete.</p>

    Raises:
        capo_proton.errors.access_denied_exception.AccessDeniedException: <p>There <i>isn't</i> sufficient access for performing this action.</p>
        capo_proton.errors.conflict_exception.ConflictException: <p>The request <i>couldn't</i> be made due to a conflicting operation or resource.</p>
        capo_proton.errors.internal_server_exception.InternalServerException: <p>The request failed to register with the service.</p>
        capo_proton.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource <i>wasn't</i> found.</p>
        capo_proton.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_proton.errors.validation_exception.ValidationException: <p>The input is invalid or an out-of-range value was supplied for the input parameter.</p>
        capo_proton.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_proton.types.delete_environment_template_version_input.DeleteEnvironmentTemplateVersionInput]",
    ) -> AsyncOperationResponse[
        "capo_proton.types.delete_environment_template_version_output.DeleteEnvironmentTemplateVersionOutput"
    ]:
        import capo_proton._operations.aws_proton20200720.delete_environment_template_version

        (
            output,
            http_response,
        ) = await capo_proton._operations.aws_proton20200720.delete_environment_template_version.async_delete_environment_template_version(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_proton.types.delete_environment_template_version_output.DeleteEnvironmentTemplateVersionOutput",
    ) -> dict[str, Any]:
        import capo_proton.types.delete_environment_template_version_output

        return capo_proton.types.delete_environment_template_version_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "DeleteEnvironmentTemplateVersion", redact_output=_redact_output
        ),
    )
    input_: capo_proton.types.delete_environment_template_version_input.DeleteEnvironmentTemplateVersionInput = {
        "template_name": template_name,
        "major_version": major_version,
        "minor_version": minor_version,
    }

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