Skip to content

cancel_contact async

cancel_contact(
    contact_id: Uuid,
    *,
    config_overrides: Optional[AsyncGroundStationClientConfig] = None,
) -> ContactIdResponse

Cancels or stops a contact with a specified contact ID based on its position in the contact lifecycle.

For contacts that:

  • Have yet to start, the contact will be cancelled.

  • Have started but have yet to finish, the contact will be stopped.

Parameters:

  • contact_id (Uuid) –

    UUID of a contact.

Raises:

Source code in docs_src/capo_groundstation/_services/async_ground_station.py
async def cancel_contact(
    self,
    contact_id: "capo_groundstation.types.uuid.Uuid",
    *,
    config_overrides: Optional[AsyncGroundStationClientConfig] = None,
) -> "capo_groundstation.types.contact_id_response.ContactIdResponse":
    """<p>Cancels or stops a contact with a specified contact ID based on its position in the <a href="https://docs.aws.amazon.com/ground-station/latest/ug/contacts.lifecycle.html">contact lifecycle</a>.</p> <p>For contacts that:</p> <ul> <li> <p>Have yet to start, the contact will be cancelled.</p> </li> <li> <p>Have started but have yet to finish, the contact will be stopped.</p> </li> </ul>

    Args:
        contact_id: <p>UUID of a contact.</p>

    Raises:
        capo_groundstation.errors.dependency_exception.DependencyException: <p>Dependency encountered an error.</p>
        capo_groundstation.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more parameters are not valid.</p>
        capo_groundstation.errors.resource_not_found_exception.ResourceNotFoundException: <p>Resource was not found.</p>
        capo_groundstation.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_groundstation.types.cancel_contact_request.CancelContactRequest]",
    ) -> AsyncOperationResponse[
        "capo_groundstation.types.contact_id_response.ContactIdResponse"
    ]:
        import capo_groundstation._operations.ground_station.cancel_contact

        (
            output,
            http_response,
        ) = await capo_groundstation._operations.ground_station.cancel_contact.async_cancel_contact(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CancelContact")
    )
    input_: capo_groundstation.types.cancel_contact_request.CancelContactRequest = {
        "contact_id": contact_id
    }

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