Struct aws_sdk_workspacesthinclient::client::Client
source · pub struct Client { /* private fields */ }
Expand description
Client for Amazon WorkSpaces Thin Client
Client for invoking operations on Amazon WorkSpaces Thin Client. Each operation on Amazon WorkSpaces Thin Client is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
§Constructing a Client
A Config
is required to construct a client. For most use cases, the aws-config
crate should be used to automatically resolve this config using
aws_config::load_from_env()
, since this will resolve an SdkConfig
which can be shared
across multiple different AWS SDK clients. This config resolution process can be customized
by calling aws_config::from_env()
instead, which returns a ConfigLoader
that uses
the builder pattern to customize the default config.
In the simplest case, creating a client looks as follows:
let config = aws_config::load_from_env().await;
let client = aws_sdk_workspacesthinclient::Client::new(&config);
Occasionally, SDKs may have additional service-specific values that can be set on the Config
that
is absent from SdkConfig
, or slightly different settings for a specific client may be desired.
The Config
struct implements From<&SdkConfig>
, so setting these specific settings can be
done as follows:
let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_workspacesthinclient::config::Builder::from(&sdk_config)
.some_service_specific_setting("value")
.build();
See the aws-config
docs and Config
for more information on customizing configuration.
Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.
§Using the Client
A client has a function for every operation that can be performed by the service.
For example, the CreateEnvironment
operation has
a Client::create_environment
, function which returns a builder for that operation.
The fluent builder ultimately has a send()
function that returns an async future that
returns a result, as illustrated below:
let result = client.create_environment()
.name("example")
.send()
.await;
The underlying HTTP requests that get made by this can be modified with the customize_operation
function on the fluent builder. See the customize
module for more
information.
Implementations§
source§impl Client
impl Client
sourcepub fn create_environment(&self) -> CreateEnvironmentFluentBuilder
pub fn create_environment(&self) -> CreateEnvironmentFluentBuilder
Constructs a fluent builder for the CreateEnvironment
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:
required: falseThe name for the environment.
desktop_arn(impl Into<String>)
/set_desktop_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the desktop to stream from Amazon WorkSpaces, WorkSpaces Web, or AppStream 2.0.
desktop_endpoint(impl Into<String>)
/set_desktop_endpoint(Option<String>)
:
required: falseThe URL for the identity provider login (only for environments that use AppStream 2.0).
software_set_update_schedule(SoftwareSetUpdateSchedule)
/set_software_set_update_schedule(Option<SoftwareSetUpdateSchedule>)
:
required: falseAn option to define if software updates should be applied within a maintenance window.
maintenance_window(MaintenanceWindow)
/set_maintenance_window(Option<MaintenanceWindow>)
:
required: falseA specification for a time window to apply software updates.
software_set_update_mode(SoftwareSetUpdateMode)
/set_software_set_update_mode(Option<SoftwareSetUpdateMode>)
:
required: falseAn option to define which software updates to apply.
desired_software_set_id(impl Into<String>)
/set_desired_software_set_id(Option<String>)
:
required: falseThe ID of the software set to apply.
kms_key_arn(impl Into<String>)
/set_kms_key_arn(Option<String>)
:
required: falseThe Amazon Resource Name (ARN) of the Key Management Service key to use to encrypt the environment.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseSpecifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a UUID type of value.
If you don’t provide this value, then Amazon Web Services generates a random one for you.
If you retry the operation with the same
ClientToken
, but with different parameters, the retry fails with anIdempotentParameterMismatch
error.tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap::<String, String>>)
:
required: falseA map of the key-value pairs of the tag or tags to assign to the resource.
- On success, responds with
CreateEnvironmentOutput
with field(s):environment(Option<EnvironmentSummary>)
:Describes an environment.
- On failure, responds with
SdkError<CreateEnvironmentError>
source§impl Client
impl Client
sourcepub fn delete_device(&self) -> DeleteDeviceFluentBuilder
pub fn delete_device(&self) -> DeleteDeviceFluentBuilder
Constructs a fluent builder for the DeleteDevice
operation.
- The fluent builder is configurable:
id(impl Into<String>)
/set_id(Option<String>)
:
required: trueThe ID of the device to delete.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseSpecifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a UUID type of value.
If you don’t provide this value, then Amazon Web Services generates a random one for you.
If you retry the operation with the same
ClientToken
, but with different parameters, the retry fails with anIdempotentParameterMismatch
error.
- On success, responds with
DeleteDeviceOutput
- On failure, responds with
SdkError<DeleteDeviceError>
source§impl Client
impl Client
sourcepub fn delete_environment(&self) -> DeleteEnvironmentFluentBuilder
pub fn delete_environment(&self) -> DeleteEnvironmentFluentBuilder
Constructs a fluent builder for the DeleteEnvironment
operation.
- The fluent builder is configurable:
id(impl Into<String>)
/set_id(Option<String>)
:
required: trueThe ID of the environment to delete.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseSpecifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a UUID type of value.
If you don’t provide this value, then Amazon Web Services generates a random one for you.
If you retry the operation with the same
ClientToken
, but with different parameters, the retry fails with anIdempotentParameterMismatch
error.
- On success, responds with
DeleteEnvironmentOutput
- On failure, responds with
SdkError<DeleteEnvironmentError>
source§impl Client
impl Client
sourcepub fn deregister_device(&self) -> DeregisterDeviceFluentBuilder
pub fn deregister_device(&self) -> DeregisterDeviceFluentBuilder
Constructs a fluent builder for the DeregisterDevice
operation.
- The fluent builder is configurable:
id(impl Into<String>)
/set_id(Option<String>)
:
required: trueThe ID of the device to deregister.
target_device_status(TargetDeviceStatus)
/set_target_device_status(Option<TargetDeviceStatus>)
:
required: falseThe desired new status for the device.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseSpecifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a UUID type of value.
If you don’t provide this value, then Amazon Web Services generates a random one for you.
If you retry the operation with the same
ClientToken
, but with different parameters, the retry fails with anIdempotentParameterMismatch
error.
- On success, responds with
DeregisterDeviceOutput
- On failure, responds with
SdkError<DeregisterDeviceError>
source§impl Client
impl Client
sourcepub fn get_device(&self) -> GetDeviceFluentBuilder
pub fn get_device(&self) -> GetDeviceFluentBuilder
Constructs a fluent builder for the GetDevice
operation.
- The fluent builder is configurable:
id(impl Into<String>)
/set_id(Option<String>)
:
required: trueThe ID of the device for which to return information.
- On success, responds with
GetDeviceOutput
with field(s):device(Option<Device>)
:Describes an device.
- On failure, responds with
SdkError<GetDeviceError>
source§impl Client
impl Client
sourcepub fn get_environment(&self) -> GetEnvironmentFluentBuilder
pub fn get_environment(&self) -> GetEnvironmentFluentBuilder
Constructs a fluent builder for the GetEnvironment
operation.
- The fluent builder is configurable:
id(impl Into<String>)
/set_id(Option<String>)
:
required: trueThe ID of the environment for which to return information.
- On success, responds with
GetEnvironmentOutput
with field(s):environment(Option<Environment>)
:Describes an environment.
- On failure, responds with
SdkError<GetEnvironmentError>
source§impl Client
impl Client
sourcepub fn get_software_set(&self) -> GetSoftwareSetFluentBuilder
pub fn get_software_set(&self) -> GetSoftwareSetFluentBuilder
Constructs a fluent builder for the GetSoftwareSet
operation.
- The fluent builder is configurable:
id(impl Into<String>)
/set_id(Option<String>)
:
required: trueThe ID of the software set for which to return information.
- On success, responds with
GetSoftwareSetOutput
with field(s):software_set(Option<SoftwareSet>)
:Describes a software set.
- On failure, responds with
SdkError<GetSoftwareSetError>
source§impl Client
impl Client
sourcepub fn list_devices(&self) -> ListDevicesFluentBuilder
pub fn list_devices(&self) -> ListDevicesFluentBuilder
Constructs a fluent builder for the ListDevices
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseIf
nextToken
is returned, there are more results available. The value ofnextToken
is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results that are returned per call. You can use
nextToken
to obtain further pages of results.This is only an upper limit. The actual number of results returned per call might be fewer than the specified maximum.
- On success, responds with
ListDevicesOutput
with field(s):devices(Option<Vec::<DeviceSummary>>)
:Describes devices.
next_token(Option<String>)
:If
nextToken
is returned, there are more results available. The value ofnextToken
is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.
- On failure, responds with
SdkError<ListDevicesError>
source§impl Client
impl Client
sourcepub fn list_environments(&self) -> ListEnvironmentsFluentBuilder
pub fn list_environments(&self) -> ListEnvironmentsFluentBuilder
Constructs a fluent builder for the ListEnvironments
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseIf
nextToken
is returned, there are more results available. The value ofnextToken
is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results that are returned per call. You can use
nextToken
to obtain further pages of results.This is only an upper limit. The actual number of results returned per call might be fewer than the specified maximum.
- On success, responds with
ListEnvironmentsOutput
with field(s):environments(Option<Vec::<EnvironmentSummary>>)
:Describes environments.
next_token(Option<String>)
:If
nextToken
is returned, there are more results available. The value ofnextToken
is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.
- On failure, responds with
SdkError<ListEnvironmentsError>
source§impl Client
impl Client
sourcepub fn list_software_sets(&self) -> ListSoftwareSetsFluentBuilder
pub fn list_software_sets(&self) -> ListSoftwareSetsFluentBuilder
Constructs a fluent builder for the ListSoftwareSets
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseIf
nextToken
is returned, there are more results available. The value ofnextToken
is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results that are returned per call. You can use
nextToken
to obtain further pages of results.This is only an upper limit. The actual number of results returned per call might be fewer than the specified maximum.
- On success, responds with
ListSoftwareSetsOutput
with field(s):software_sets(Option<Vec::<SoftwareSetSummary>>)
:Describes software sets.
next_token(Option<String>)
:If
nextToken
is returned, there are more results available. The value ofnextToken
is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.
- On failure, responds with
SdkError<ListSoftwareSetsError>
source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the resource for which you want to retrieve tags.
- On success, responds with
ListTagsForResourceOutput
with field(s):tags(Option<HashMap::<String, String>>)
:A map of the key-value pairs for the tag or tags assigned to the specified resource.
- On failure, responds with
SdkError<ListTagsForResourceError>
source§impl Client
impl Client
sourcepub fn tag_resource(&self) -> TagResourceFluentBuilder
pub fn tag_resource(&self) -> TagResourceFluentBuilder
Constructs a fluent builder for the TagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the resource that you want to tag.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap::<String, String>>)
:
required: trueA map of the key-value pairs of the tag or tags to assign to the resource.
- On success, responds with
TagResourceOutput
- On failure, responds with
SdkError<TagResourceError>
source§impl Client
impl Client
sourcepub fn untag_resource(&self) -> UntagResourceFluentBuilder
pub fn untag_resource(&self) -> UntagResourceFluentBuilder
Constructs a fluent builder for the UntagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the resource that you want to untag.
tag_keys(impl Into<String>)
/set_tag_keys(Option<Vec::<String>>)
:
required: trueThe keys of the key-value pairs for the tag or tags you want to remove from the specified resource.
- On success, responds with
UntagResourceOutput
- On failure, responds with
SdkError<UntagResourceError>
source§impl Client
impl Client
sourcepub fn update_device(&self) -> UpdateDeviceFluentBuilder
pub fn update_device(&self) -> UpdateDeviceFluentBuilder
Constructs a fluent builder for the UpdateDevice
operation.
- The fluent builder is configurable:
id(impl Into<String>)
/set_id(Option<String>)
:
required: trueThe ID of the device to update.
name(impl Into<String>)
/set_name(Option<String>)
:
required: falseThe name of the device to update.
desired_software_set_id(impl Into<String>)
/set_desired_software_set_id(Option<String>)
:
required: falseThe ID of the software set to apply.
software_set_update_schedule(SoftwareSetUpdateSchedule)
/set_software_set_update_schedule(Option<SoftwareSetUpdateSchedule>)
:
required: falseAn option to define if software updates should be applied within a maintenance window.
- On success, responds with
UpdateDeviceOutput
with field(s):device(Option<DeviceSummary>)
:Describes a device.
- On failure, responds with
SdkError<UpdateDeviceError>
source§impl Client
impl Client
sourcepub fn update_environment(&self) -> UpdateEnvironmentFluentBuilder
pub fn update_environment(&self) -> UpdateEnvironmentFluentBuilder
Constructs a fluent builder for the UpdateEnvironment
operation.
- The fluent builder is configurable:
id(impl Into<String>)
/set_id(Option<String>)
:
required: trueThe ID of the environment to update.
name(impl Into<String>)
/set_name(Option<String>)
:
required: falseThe name of the environment to update.
desktop_arn(impl Into<String>)
/set_desktop_arn(Option<String>)
:
required: falseThe Amazon Resource Name (ARN) of the desktop to stream from Amazon WorkSpaces, WorkSpaces Web, or AppStream 2.0.
desktop_endpoint(impl Into<String>)
/set_desktop_endpoint(Option<String>)
:
required: falseThe URL for the identity provider login (only for environments that use AppStream 2.0).
software_set_update_schedule(SoftwareSetUpdateSchedule)
/set_software_set_update_schedule(Option<SoftwareSetUpdateSchedule>)
:
required: falseAn option to define if software updates should be applied within a maintenance window.
maintenance_window(MaintenanceWindow)
/set_maintenance_window(Option<MaintenanceWindow>)
:
required: falseA specification for a time window to apply software updates.
software_set_update_mode(SoftwareSetUpdateMode)
/set_software_set_update_mode(Option<SoftwareSetUpdateMode>)
:
required: falseAn option to define which software updates to apply.
desired_software_set_id(impl Into<String>)
/set_desired_software_set_id(Option<String>)
:
required: falseThe ID of the software set to apply.
- On success, responds with
UpdateEnvironmentOutput
with field(s):environment(Option<EnvironmentSummary>)
:Describes an environment.
- On failure, responds with
SdkError<UpdateEnvironmentError>
source§impl Client
impl Client
sourcepub fn update_software_set(&self) -> UpdateSoftwareSetFluentBuilder
pub fn update_software_set(&self) -> UpdateSoftwareSetFluentBuilder
Constructs a fluent builder for the UpdateSoftwareSet
operation.
- The fluent builder is configurable:
id(impl Into<String>)
/set_id(Option<String>)
:
required: trueThe ID of the software set to update.
validation_status(SoftwareSetValidationStatus)
/set_validation_status(Option<SoftwareSetValidationStatus>)
:
required: trueAn option to define if the software set has been validated.
- On success, responds with
UpdateSoftwareSetOutput
- On failure, responds with
SdkError<UpdateSoftwareSetError>
source§impl Client
impl Client
sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config
.
§Panics
This method will panic in the following cases:
- Retries or timeouts are enabled without a
sleep_impl
configured. - Identity caching is enabled without a
sleep_impl
andtime_source
configured. - No
behavior_version
is provided.
The panic message for each of these will have instructions on how to resolve them.
source§impl Client
impl Client
sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
§Panics
- This method will panic if the
sdk_config
is missing an async sleep implementation. If you experience this panic, set thesleep_impl
on the Config passed into this function to fix it. - This method will panic if the
sdk_config
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it. - This method will panic if no
BehaviorVersion
is provided. If you experience this panic, setbehavior_version
on the Config or enable thebehavior-version-latest
Cargo feature.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more