Skip to content

renew_offering async

renew_offering(
    offering_id: OfferingIdentifier,
    quantity: Integer,
    *,
    config_overrides: Optional[AsyncDeviceFarmClientConfig] = None,
) -> RenewOfferingResult

Explicitly sets the quantity of devices to renew for an offering, starting from the effectiveDate of the next period. The API returns a NotEligible error if the user is not permitted to invoke the operation. If you must be able to invoke this operation, contact [email protected].

Parameters:

  • offering_id (OfferingIdentifier) –

    The ID of a request to renew an offering.

  • quantity (Integer) –

    The quantity requested in an offering renewal.

Raises:

Source code in docs_src/capo_device_farm/_services/async_device_farm.py
async def renew_offering(
    self,
    offering_id: "capo_device_farm.types.offering_identifier.OfferingIdentifier",
    quantity: "capo_device_farm.types.integer.Integer",
    *,
    config_overrides: Optional[AsyncDeviceFarmClientConfig] = None,
) -> "capo_device_farm.types.renew_offering_result.RenewOfferingResult":
    """<p>Explicitly sets the quantity of devices to renew for an offering, starting from the <code>effectiveDate</code> of the next period. The API returns a <code>NotEligible</code> error if the user is not permitted to invoke the operation. If you must be able to invoke this operation, contact <a href="mailto:[email protected]">[email protected]</a>.</p>

    Args:
        offering_id: <p>The ID of a request to renew an offering.</p>
        quantity: <p>The quantity requested in an offering renewal.</p>

    Raises:
        capo_device_farm.errors.argument_exception.ArgumentException: <p>An invalid argument was specified.</p>
        capo_device_farm.errors.limit_exceeded_exception.LimitExceededException: <p>A limit was exceeded.</p>
        capo_device_farm.errors.not_eligible_exception.NotEligibleException: <p>Exception gets thrown when a user is not eligible to perform the specified transaction.</p>
        capo_device_farm.errors.not_found_exception.NotFoundException: <p>The specified entity was not found.</p>
        capo_device_farm.errors.service_account_exception.ServiceAccountException: <p>There was a problem with the service account.</p>
        capo_device_farm.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_device_farm.types.renew_offering_request.RenewOfferingRequest]",
    ) -> AsyncOperationResponse[
        "capo_device_farm.types.renew_offering_result.RenewOfferingResult"
    ]:
        import capo_device_farm._operations.device_farm_20150623.renew_offering

        (
            output,
            http_response,
        ) = await capo_device_farm._operations.device_farm_20150623.renew_offering.async_renew_offering(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RenewOffering")
    )
    input_: capo_device_farm.types.renew_offering_request.RenewOfferingRequest = {
        "offering_id": offering_id,
        "quantity": quantity,
    }

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