Skip to content

delete_service_template_version async

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

If no other minor versions of a service template exist, delete a major version of the service template if it's not the Recommended version. Delete the Recommended version of the service template if no other major versions or minor versions of the service template exist. A major version of a service template is a version that isn't backwards compatible.

Delete a minor version of a service template if it's not the Recommended version. Delete a Recommended minor version of the service template if no other minor versions of the service template exist. A minor version of a service template is a version that's backwards compatible.

Parameters:

Raises:

Source code in docs_src/capo_proton/_services/async_proton.py
async def delete_service_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_service_template_version_output.DeleteServiceTemplateVersionOutput":
    """<p>If no other minor versions of a service template exist, delete a major version of the service template if it's not the <code>Recommended</code> version. Delete the <code>Recommended</code> version of the service template if no other major versions or minor versions of the service template exist. A major version of a service template is a version that <i>isn't</i> backwards compatible.</p> <p>Delete a minor version of a service template if it's not the <code>Recommended</code> version. Delete a <code>Recommended</code> minor version of the service template if no other minor versions of the service template exist. A minor version of a service template is a version that's backwards compatible.</p>

    Args:
        template_name: <p>The name of the service template.</p>
        major_version: <p>The service template major version to delete.</p>
        minor_version: <p>The service 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_service_template_version_input.DeleteServiceTemplateVersionInput]",
    ) -> AsyncOperationResponse[
        "capo_proton.types.delete_service_template_version_output.DeleteServiceTemplateVersionOutput"
    ]:
        import capo_proton._operations.aws_proton20200720.delete_service_template_version

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

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

        return capo_proton.types.delete_service_template_version_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "DeleteServiceTemplateVersion", redact_output=_redact_output
        ),
    )
    input_: capo_proton.types.delete_service_template_version_input.DeleteServiceTemplateVersionInput = {
        "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