Struct aws_sdk_iot1clickprojects::client::Client  
source · pub struct Client { /* private fields */ }Expand description
Client for AWS IoT 1-Click Projects Service
Client for invoking operations on AWS IoT 1-Click Projects Service. Each operation on AWS IoT 1-Click Projects Service 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_iot1clickprojects::Client::new(&config);Occasionally, SDKs may have additional service-specific 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_iot1clickprojects::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 AssociateDeviceWithPlacement operation has
a Client::associate_device_with_placement, 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.associate_device_with_placement()
    .project_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 associate_device_with_placement(
    &self
) -> AssociateDeviceWithPlacementFluentBuilder
 
pub fn associate_device_with_placement( &self ) -> AssociateDeviceWithPlacementFluentBuilder
Constructs a fluent builder for the AssociateDeviceWithPlacement operation.
- The fluent builder is configurable:
- project_name(impl ::std::convert::Into<String>)/- set_project_name(Option<String>):- The name of the project containing the placement in which to associate the device. 
- placement_name(impl ::std::convert::Into<String>)/- set_placement_name(Option<String>):- The name of the placement in which to associate the device. 
- device_id(impl ::std::convert::Into<String>)/- set_device_id(Option<String>):- The ID of the physical device to be associated with the given placement in the project. Note that a mandatory 4 character prefix is required for all - deviceIdvalues.
- device_template_name(impl ::std::convert::Into<String>)/- set_device_template_name(Option<String>):- The device template name to associate with the device ID. 
 
- On success, responds with AssociateDeviceWithPlacementOutput
- On failure, responds with SdkError<AssociateDeviceWithPlacementError>
source§impl Client
 
impl Client
sourcepub fn create_placement(&self) -> CreatePlacementFluentBuilder
 
pub fn create_placement(&self) -> CreatePlacementFluentBuilder
Constructs a fluent builder for the CreatePlacement operation.
- The fluent builder is configurable:
- placement_name(impl ::std::convert::Into<String>)/- set_placement_name(Option<String>):- The name of the placement to be created. 
- project_name(impl ::std::convert::Into<String>)/- set_project_name(Option<String>):- The name of the project in which to create the placement. 
- attributes(HashMap<String, String>)/- set_attributes(Option<HashMap<String, String>>):- Optional user-defined key/value pairs providing contextual data (such as location or function) for the placement. 
 
- On success, responds with CreatePlacementOutput
- On failure, responds with SdkError<CreatePlacementError>
source§impl Client
 
impl Client
sourcepub fn create_project(&self) -> CreateProjectFluentBuilder
 
pub fn create_project(&self) -> CreateProjectFluentBuilder
Constructs a fluent builder for the CreateProject operation.
- The fluent builder is configurable:
- project_name(impl ::std::convert::Into<String>)/- set_project_name(Option<String>):- The name of the project to create. 
- description(impl ::std::convert::Into<String>)/- set_description(Option<String>):- An optional description for the project. 
- placement_template(PlacementTemplate)/- set_placement_template(Option<PlacementTemplate>):- The schema defining the placement to be created. A placement template defines placement default attributes and device templates. You cannot add or remove device templates after the project has been created. However, you can update - callbackOverridesfor the device templates using the- UpdateProjectAPI.
- tags(HashMap<String, String>)/- set_tags(Option<HashMap<String, String>>):- Optional tags (metadata key/value pairs) to be associated with the project. For example, - { {“key1”: “value1”, “key2”: “value2”} }. For more information, see AWS Tagging Strategies.
 
- On success, responds with CreateProjectOutput
- On failure, responds with SdkError<CreateProjectError>
source§impl Client
 
impl Client
sourcepub fn delete_placement(&self) -> DeletePlacementFluentBuilder
 
pub fn delete_placement(&self) -> DeletePlacementFluentBuilder
Constructs a fluent builder for the DeletePlacement operation.
- The fluent builder is configurable:
- placement_name(impl ::std::convert::Into<String>)/- set_placement_name(Option<String>):- The name of the empty placement to delete. 
- project_name(impl ::std::convert::Into<String>)/- set_project_name(Option<String>):- The project containing the empty placement to delete. 
 
- On success, responds with DeletePlacementOutput
- On failure, responds with SdkError<DeletePlacementError>
source§impl Client
 
impl Client
sourcepub fn delete_project(&self) -> DeleteProjectFluentBuilder
 
pub fn delete_project(&self) -> DeleteProjectFluentBuilder
Constructs a fluent builder for the DeleteProject operation.
- The fluent builder is configurable:
- project_name(impl ::std::convert::Into<String>)/- set_project_name(Option<String>):- The name of the empty project to delete. 
 
- On success, responds with DeleteProjectOutput
- On failure, responds with SdkError<DeleteProjectError>
source§impl Client
 
impl Client
sourcepub fn describe_placement(&self) -> DescribePlacementFluentBuilder
 
pub fn describe_placement(&self) -> DescribePlacementFluentBuilder
Constructs a fluent builder for the DescribePlacement operation.
- The fluent builder is configurable:
- placement_name(impl ::std::convert::Into<String>)/- set_placement_name(Option<String>):- The name of the placement within a project. 
- project_name(impl ::std::convert::Into<String>)/- set_project_name(Option<String>):- The project containing the placement to be described. 
 
- On success, responds with DescribePlacementOutputwith field(s):- placement(Option<PlacementDescription>):- An object describing the placement. 
 
- On failure, responds with SdkError<DescribePlacementError>
source§impl Client
 
impl Client
sourcepub fn describe_project(&self) -> DescribeProjectFluentBuilder
 
pub fn describe_project(&self) -> DescribeProjectFluentBuilder
Constructs a fluent builder for the DescribeProject operation.
- The fluent builder is configurable:
- project_name(impl ::std::convert::Into<String>)/- set_project_name(Option<String>):- The name of the project to be described. 
 
- On success, responds with DescribeProjectOutputwith field(s):- project(Option<ProjectDescription>):- An object describing the project. 
 
- On failure, responds with SdkError<DescribeProjectError>
source§impl Client
 
impl Client
sourcepub fn disassociate_device_from_placement(
    &self
) -> DisassociateDeviceFromPlacementFluentBuilder
 
pub fn disassociate_device_from_placement( &self ) -> DisassociateDeviceFromPlacementFluentBuilder
Constructs a fluent builder for the DisassociateDeviceFromPlacement operation.
- The fluent builder is configurable:
- project_name(impl ::std::convert::Into<String>)/- set_project_name(Option<String>):- The name of the project that contains the placement. 
- placement_name(impl ::std::convert::Into<String>)/- set_placement_name(Option<String>):- The name of the placement that the device should be removed from. 
- device_template_name(impl ::std::convert::Into<String>)/- set_device_template_name(Option<String>):- The device ID that should be removed from the placement. 
 
- On success, responds with DisassociateDeviceFromPlacementOutput
- On failure, responds with SdkError<DisassociateDeviceFromPlacementError>
source§impl Client
 
impl Client
sourcepub fn get_devices_in_placement(&self) -> GetDevicesInPlacementFluentBuilder
 
pub fn get_devices_in_placement(&self) -> GetDevicesInPlacementFluentBuilder
Constructs a fluent builder for the GetDevicesInPlacement operation.
- The fluent builder is configurable:
- project_name(impl ::std::convert::Into<String>)/- set_project_name(Option<String>):- The name of the project containing the placement. 
- placement_name(impl ::std::convert::Into<String>)/- set_placement_name(Option<String>):- The name of the placement to get the devices from. 
 
- On success, responds with GetDevicesInPlacementOutputwith field(s):- devices(Option<HashMap<String, String>>):- An object containing the devices (zero or more) within the placement. 
 
- On failure, responds with SdkError<GetDevicesInPlacementError>
source§impl Client
 
impl Client
sourcepub fn list_placements(&self) -> ListPlacementsFluentBuilder
 
pub fn list_placements(&self) -> ListPlacementsFluentBuilder
Constructs a fluent builder for the ListPlacements operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
- project_name(impl ::std::convert::Into<String>)/- set_project_name(Option<String>):- The project containing the placements to be listed. 
- next_token(impl ::std::convert::Into<String>)/- set_next_token(Option<String>):- The token to retrieve the next set of results. 
- max_results(i32)/- set_max_results(Option<i32>):- The maximum number of results to return per request. If not set, a default value of 100 is used. 
 
- On success, responds with ListPlacementsOutputwith field(s):- placements(Option<Vec<PlacementSummary>>):- An object listing the requested placements. 
- next_token(Option<String>):- The token used to retrieve the next set of results - will be effectively empty if there are no further results. 
 
- On failure, responds with SdkError<ListPlacementsError>
source§impl Client
 
impl Client
sourcepub fn list_projects(&self) -> ListProjectsFluentBuilder
 
pub fn list_projects(&self) -> ListProjectsFluentBuilder
Constructs a fluent builder for the ListProjects operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
- next_token(impl ::std::convert::Into<String>)/- set_next_token(Option<String>):- The token to retrieve the next set of results. 
- max_results(i32)/- set_max_results(Option<i32>):- The maximum number of results to return per request. If not set, a default value of 100 is used. 
 
- On success, responds with ListProjectsOutputwith field(s):- projects(Option<Vec<ProjectSummary>>):- An object containing the list of projects. 
- next_token(Option<String>):- The token used to retrieve the next set of results - will be effectively empty if there are no further results. 
 
- On failure, responds with SdkError<ListProjectsError>
source§impl Client
 
impl Client
Constructs a fluent builder for the ListTagsForResource operation.
- The fluent builder is configurable:
- resource_arn(impl ::std::convert::Into<String>)/- set_resource_arn(Option<String>):- The ARN of the resource whose tags you want to list. 
 
- On success, responds with ListTagsForResourceOutputwith field(s):- tags(Option<HashMap<String, String>>):- The tags (metadata key/value pairs) which you have assigned to the 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 ::std::convert::Into<String>)/- set_resource_arn(Option<String>):- The ARN of the resouce for which tag(s) should be added or modified. 
- tags(HashMap<String, String>)/- set_tags(Option<HashMap<String, String>>):- The new or modifying tag(s) for the resource. See AWS IoT 1-Click Service Limits for the maximum number of tags allowed per 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 ::std::convert::Into<String>)/- set_resource_arn(Option<String>):- The ARN of the resource whose tag you want to remove. 
- tag_keys(Vec<String>)/- set_tag_keys(Option<Vec<String>>):- The keys of those tags which you want to remove. 
 
- On success, responds with UntagResourceOutput
- On failure, responds with SdkError<UntagResourceError>
source§impl Client
 
impl Client
sourcepub fn update_placement(&self) -> UpdatePlacementFluentBuilder
 
pub fn update_placement(&self) -> UpdatePlacementFluentBuilder
Constructs a fluent builder for the UpdatePlacement operation.
- The fluent builder is configurable:
- placement_name(impl ::std::convert::Into<String>)/- set_placement_name(Option<String>):- The name of the placement to update. 
- project_name(impl ::std::convert::Into<String>)/- set_project_name(Option<String>):- The name of the project containing the placement to be updated. 
- attributes(HashMap<String, String>)/- set_attributes(Option<HashMap<String, String>>):- The user-defined object of attributes used to update the placement. The maximum number of key/value pairs is 50. 
 
- On success, responds with UpdatePlacementOutput
- On failure, responds with SdkError<UpdatePlacementError>
source§impl Client
 
impl Client
sourcepub fn update_project(&self) -> UpdateProjectFluentBuilder
 
pub fn update_project(&self) -> UpdateProjectFluentBuilder
Constructs a fluent builder for the UpdateProject operation.
- The fluent builder is configurable:
- project_name(impl ::std::convert::Into<String>)/- set_project_name(Option<String>):- The name of the project to be updated. 
- description(impl ::std::convert::Into<String>)/- set_description(Option<String>):- An optional user-defined description for the project. 
- placement_template(PlacementTemplate)/- set_placement_template(Option<PlacementTemplate>):- An object defining the project update. Once a project has been created, you cannot add device template names to the project. However, for a given - placementTemplate, you can update the associated- callbackOverridesfor the device definition using this API.
 
- On success, responds with UpdateProjectOutput
- On failure, responds with SdkError<UpdateProjectError>
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 if the confis missing an async sleep implementation. If you experience this panic, set thesleep_implon the Config passed into this function to fix it.
- This method will panic if the confis missing an HTTP connector. If you experience this panic, set thehttp_connectoron the Config passed into this function to fix it.
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_configis missing an async sleep implementation. If you experience this panic, set thesleep_implon the Config passed into this function to fix it.
- This method will panic if the sdk_configis missing an HTTP connector. If you experience this panic, set thehttp_connectoron the Config passed into this function to fix it.