Skip to content

wait_until_asset_model_not_exists async

wait_until_asset_model_not_exists(
    asset_model_id: CustomID,
    *,
    max_wait_time: float,
    min_delay: float = 3,
    max_delay: float = 120,
    config_overrides: Optional[AsyncIoTSiteWiseClientConfig] = None,
    exclude_properties: Optional[ExcludeProperties] = None,
    asset_model_version: Optional[AssetModelVersionFilter] = None,
) -> ServiceError

Wait for asset_model_not_exists.

Parameters:

  • asset_model_id (CustomID) –

    The ID of the asset model. This can be either the actual ID in UUID format, or else externalId: followed by the external ID, if it has one. For more information, see Referencing objects with external IDs in the IoT SiteWise User Guide.

  • max_wait_time (float) –

    Maximum total seconds to wait before raising WaiterTimeoutError.

  • min_delay (float, default: 3 ) –

    Minimum seconds between operation attempts (spec default 2).

  • max_delay (float, default: 120 ) –

    Maximum seconds between operation attempts (spec default 120).

  • exclude_properties (Optional[ExcludeProperties], default: None ) –

    Whether or not to exclude asset model properties from the response.

  • asset_model_version (Optional[AssetModelVersionFilter], default: None ) –

    The version alias that specifies the latest or active version of the asset model. The details are returned in the response. The default value is LATEST. See Asset model versions in the IoT SiteWise User Guide.

Source code in docs_src/capo_iotsitewise/_services/async_io_t_site_wise.py
async def wait_until_asset_model_not_exists(
    self,
    asset_model_id: "capo_iotsitewise.types.custom_id.CustomID",
    *,
    max_wait_time: float,
    min_delay: float = 3,
    max_delay: float = 120,
    config_overrides: Optional[AsyncIoTSiteWiseClientConfig] = None,
    exclude_properties: Optional[
        "capo_iotsitewise.types.exclude_properties.ExcludeProperties"
    ] = None,
    asset_model_version: Optional[
        "capo_iotsitewise.types.asset_model_version_filter.AssetModelVersionFilter"
    ] = None,
) -> ServiceError:
    """Wait for asset_model_not_exists.

    Args:
        asset_model_id: <p>The ID of the asset model. This can be either the actual ID in UUID format, or else <code>externalId:</code> followed by the external ID, if it has one. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references">Referencing objects with external IDs</a> in the <i>IoT SiteWise User Guide</i>.</p>
        max_wait_time: Maximum total seconds to wait before raising WaiterTimeoutError.
        min_delay: Minimum seconds between operation attempts (spec default 2).
        max_delay: Maximum seconds between operation attempts (spec default 120).
        exclude_properties: <p> Whether or not to exclude asset model properties from the response. </p>
        asset_model_version: <p>The version alias that specifies the latest or active version of the asset model. The details are returned in the response. The default value is <code>LATEST</code>. See <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/model-active-version.html"> Asset model versions</a> in the <i>IoT SiteWise User Guide</i>.</p>
    """
    start = time.monotonic()
    attempt = 0
    while True:
        op_output: "capo_iotsitewise.types.describe_asset_model_response.DescribeAssetModelResponse | None" = None
        op_error: ServiceError | None = None
        try:
            op_output = await self.describe_asset_model(  # noqa: F841
                asset_model_id,
                config_overrides=config_overrides,
                exclude_properties=exclude_properties,
                asset_model_version=asset_model_version,
            )
        except ServiceError as e:
            op_error = e
        if op_error is not None and op_error.code == "ResourceNotFoundException":
            return op_error
        elif op_error is not None:
            raise op_error

        elapsed = time.monotonic() - start
        remaining = max_wait_time - elapsed
        if remaining <= 0:
            raise WaiterTimeoutError("asset_model_not_exists", max_wait_time)
        delay = min(max_delay, min_delay * (2**attempt))
        delay = random.uniform(min_delay, delay)
        delay = min(delay, remaining)
        await anysleep(delay)
        attempt += 1