Skip to content

update_dependency async

update_dependency(
    service_arn: Arn,
    dependency_id: Uuid,
    *,
    config_overrides: Optional[Asyncresiliencehubv2ClientConfig] = None,
    criticality: Optional[DependencyCriticality] = None,
    comment: Optional[str] = None,
) -> UpdateDependencyResponse

Updates a dependency classification.

Parameters:

  • dependency_id (Uuid) –

    The identifier of the dependency to update.

  • criticality (Optional[DependencyCriticality], default: None ) –

    The updated criticality level of the dependency.

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

    A comment about the dependency.

Raises:

Source code in docs_src/capo_resiliencehubv2/_services/async_resiliencehubv2.py
async def update_dependency(
    self,
    service_arn: "capo_resiliencehubv2.types.arn.Arn",
    dependency_id: "capo_resiliencehubv2.types.uuid.Uuid",
    *,
    config_overrides: Optional[Asyncresiliencehubv2ClientConfig] = None,
    criticality: Optional[
        "capo_resiliencehubv2.types.dependency_criticality.DependencyCriticality"
    ] = None,
    comment: Optional[str] = None,
) -> (
    "capo_resiliencehubv2.types.update_dependency_response.UpdateDependencyResponse"
):
    """<p>Updates a dependency classification.</p>

    Args:
        dependency_id: <p>The identifier of the dependency to update.</p>
        criticality: <p>The updated criticality level of the dependency.</p>
        comment: <p>A comment about the dependency.</p>

    Raises:
        capo_resiliencehubv2.errors.access_denied_exception.AccessDeniedException: <p>Access denied — caller lacks required permissions.</p>
        capo_resiliencehubv2.errors.conflict_exception.ConflictException: <p>Conflict — resource already exists.</p>
        capo_resiliencehubv2.errors.internal_server_exception.InternalServerException: <p>Internal service error.</p>
        capo_resiliencehubv2.errors.resource_not_found_exception.ResourceNotFoundException: <p>Resource not found.</p>
        capo_resiliencehubv2.errors.validation_exception.ValidationException: <p>Validation error — invalid input parameters.</p>
        capo_resiliencehubv2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_resiliencehubv2.types.update_dependency_request.UpdateDependencyRequest]",
    ) -> AsyncOperationResponse[
        "capo_resiliencehubv2.types.update_dependency_response.UpdateDependencyResponse"
    ]:
        import capo_resiliencehubv2._operations.ngrh_service_core.update_dependency

        (
            output,
            http_response,
        ) = await capo_resiliencehubv2._operations.ngrh_service_core.update_dependency.async_update_dependency(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateDependency")
    )
    input_: capo_resiliencehubv2.types.update_dependency_request.UpdateDependencyRequest = {
        "service_arn": service_arn,
        "dependency_id": dependency_id,
    }
    if criticality is not None:
        input_["criticality"] = criticality
    if comment is not None:
        input_["comment"] = comment

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