Skip to content

update_network async

update_network(
    network_id: NetworkId,
    network_name: GenericString,
    *,
    config_overrides: Optional[AsyncWickrClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    encryption_key_arn: Optional[GenericString] = None,
) -> UpdateNetworkResponse

Updates the properties of an existing Wickr network, such as its name or encryption key configuration.

Parameters:

  • network_id (NetworkId) –

    The ID of the Wickr network to update.

  • network_name (GenericString) –

    The new name for the network. Must be between 1 and 20 characters.

  • client_token (Optional[ClientToken], default: None ) –

    A unique identifier for this request to ensure idempotency.

  • encryption_key_arn (Optional[GenericString], default: None ) –

    The ARN of the Amazon Web Services KMS customer managed key to use for encrypting sensitive data in the network.

Raises:

  • BadRequestError –

    The request was invalid or malformed. This error occurs when the request parameters do not meet the API requirements, such as invalid field values, missing required parameters, or improperly formatted data.

  • ForbiddenError –

    Access to the requested resource is forbidden. This error occurs when the authenticated user does not have the necessary permissions to perform the requested operation, even though they are authenticated.

  • InternalServerError –

    An unexpected error occurred on the server while processing the request. This indicates a problem with the Wickr service itself rather than with the request. If this error persists, contact Amazon Web Services Support.

  • RateLimitError –

    The request was throttled because too many requests were sent in a short period of time. Wait a moment and retry the request. Consider implementing exponential backoff in your application.

  • ResourceNotFoundError –

    The requested resource could not be found. This error occurs when you try to access or modify a network, user, bot, security group, or other resource that doesn't exist or has been deleted.

  • UnauthorizedError –

    The request was not authenticated or the authentication credentials were invalid. This error occurs when the request lacks valid authentication credentials or the credentials have expired.

  • ValidationError –

    One or more fields in the request failed validation. This error provides detailed information about which fields were invalid and why, allowing you to correct the request and retry.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

Update network name successfully

>>> await client.update_network(network_id='12345678', network_name='Updated Network Name')
Update network - invalid name
>>> await client.update_network(network_id='12345678', network_name='This name is way too long for a network')
Update network - not found
>>> await client.update_network(network_id='99999999', network_name='New Name')
Source code in docs_src/capo_wickr/_services/async_wickr.py
async def update_network(
    self,
    network_id: "capo_wickr.types.network_id.NetworkId",
    network_name: "capo_wickr.types.generic_string.GenericString",
    *,
    config_overrides: Optional[AsyncWickrClientConfig] = None,
    client_token: Optional["capo_wickr.types.client_token.ClientToken"] = None,
    encryption_key_arn: Optional[
        "capo_wickr.types.generic_string.GenericString"
    ] = None,
) -> "capo_wickr.types.update_network_response.UpdateNetworkResponse":
    """<p>Updates the properties of an existing Wickr network, such as its name or encryption key configuration.</p>

    Args:
        network_id: <p>The ID of the Wickr network to update.</p>
        network_name: <p>The new name for the network. Must be between 1 and 20 characters.</p>
        client_token: <p>A unique identifier for this request to ensure idempotency.</p>
        encryption_key_arn: <p>The ARN of the Amazon Web Services KMS customer managed key to use for encrypting sensitive data in the network.</p>

    Raises:
        capo_wickr.errors.bad_request_error.BadRequestError: <p>The request was invalid or malformed. This error occurs when the request parameters do not meet the API requirements, such as invalid field values, missing required parameters, or improperly formatted data.</p>
        capo_wickr.errors.forbidden_error.ForbiddenError: <p>Access to the requested resource is forbidden. This error occurs when the authenticated user does not have the necessary permissions to perform the requested operation, even though they are authenticated.</p>
        capo_wickr.errors.internal_server_error.InternalServerError: <p>An unexpected error occurred on the server while processing the request. This indicates a problem with the Wickr service itself rather than with the request. If this error persists, contact Amazon Web Services Support.</p>
        capo_wickr.errors.rate_limit_error.RateLimitError: <p>The request was throttled because too many requests were sent in a short period of time. Wait a moment and retry the request. Consider implementing exponential backoff in your application.</p>
        capo_wickr.errors.resource_not_found_error.ResourceNotFoundError: <p>The requested resource could not be found. This error occurs when you try to access or modify a network, user, bot, security group, or other resource that doesn't exist or has been deleted.</p>
        capo_wickr.errors.unauthorized_error.UnauthorizedError: <p>The request was not authenticated or the authentication credentials were invalid. This error occurs when the request lacks valid authentication credentials or the credentials have expired.</p>
        capo_wickr.errors.validation_error.ValidationError: <p>One or more fields in the request failed validation. This error provides detailed information about which fields were invalid and why, allowing you to correct the request and retry.</p>
        capo_wickr.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Update network name successfully

        >>> await client.update_network(network_id='12345678', network_name='Updated Network Name')
        Update network - invalid name

        >>> await client.update_network(network_id='12345678', network_name='This name is way too long for a network')
        Update network - not found

        >>> await client.update_network(network_id='99999999', network_name='New Name')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_wickr.types.update_network_request.UpdateNetworkRequest]",
    ) -> AsyncOperationResponse[
        "capo_wickr.types.update_network_response.UpdateNetworkResponse"
    ]:
        import capo_wickr._operations.wickr_admin_api.update_network

        (
            output,
            http_response,
        ) = await capo_wickr._operations.wickr_admin_api.update_network.async_update_network(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateNetwork")
    )
    input_: capo_wickr.types.update_network_request.UpdateNetworkRequest = {
        "network_id": network_id,
        "network_name": network_name,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if encryption_key_arn is not None:
        input_["encryption_key_arn"] = encryption_key_arn

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