use std::fmt::Write;
pub mod batch_put_property_values_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) entries: std::option::Option<std::vec::Vec<crate::model::PropertyValueEntry>>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn entries(mut self, input: crate::model::PropertyValueEntry) -> Self {
let mut v = self.entries.unwrap_or_default();
v.push(input);
self.entries = Some(v);
self
}
pub fn set_entries(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::PropertyValueEntry>>,
) -> Self {
self.entries = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::BatchPutPropertyValuesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::BatchPutPropertyValuesInput {
workspace_id: self.workspace_id,
entries: self.entries,
})
}
}
}
impl BatchPutPropertyValuesInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::BatchPutPropertyValues,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::BatchPutPropertyValuesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_1 = &_input.workspace_id;
let input_1 = input_1.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_1,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}/entity-properties",
workspaceId = workspace_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::BatchPutPropertyValuesInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_batch_put_property_values(
&self,
)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("data.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::BatchPutPropertyValues::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"BatchPutPropertyValues",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::batch_put_property_values_input::Builder {
crate::input::batch_put_property_values_input::Builder::default()
}
}
pub mod create_component_type_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) is_singleton: std::option::Option<bool>,
pub(crate) component_type_id: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) property_definitions: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::PropertyDefinitionRequest>,
>,
pub(crate) extends_from: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) functions: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::FunctionRequest>,
>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
pub(crate) property_groups: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::PropertyGroupRequest>,
>,
pub(crate) component_type_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn is_singleton(mut self, input: bool) -> Self {
self.is_singleton = Some(input);
self
}
pub fn set_is_singleton(mut self, input: std::option::Option<bool>) -> Self {
self.is_singleton = input;
self
}
pub fn component_type_id(mut self, input: impl Into<std::string::String>) -> Self {
self.component_type_id = Some(input.into());
self
}
pub fn set_component_type_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.component_type_id = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn property_definitions(
mut self,
k: impl Into<std::string::String>,
v: crate::model::PropertyDefinitionRequest,
) -> Self {
let mut hash_map = self.property_definitions.unwrap_or_default();
hash_map.insert(k.into(), v);
self.property_definitions = Some(hash_map);
self
}
pub fn set_property_definitions(
mut self,
input: std::option::Option<
std::collections::HashMap<
std::string::String,
crate::model::PropertyDefinitionRequest,
>,
>,
) -> Self {
self.property_definitions = input;
self
}
pub fn extends_from(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.extends_from.unwrap_or_default();
v.push(input.into());
self.extends_from = Some(v);
self
}
pub fn set_extends_from(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.extends_from = input;
self
}
pub fn functions(
mut self,
k: impl Into<std::string::String>,
v: crate::model::FunctionRequest,
) -> Self {
let mut hash_map = self.functions.unwrap_or_default();
hash_map.insert(k.into(), v);
self.functions = Some(hash_map);
self
}
pub fn set_functions(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::FunctionRequest>,
>,
) -> Self {
self.functions = input;
self
}
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
pub fn property_groups(
mut self,
k: impl Into<std::string::String>,
v: crate::model::PropertyGroupRequest,
) -> Self {
let mut hash_map = self.property_groups.unwrap_or_default();
hash_map.insert(k.into(), v);
self.property_groups = Some(hash_map);
self
}
pub fn set_property_groups(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::PropertyGroupRequest>,
>,
) -> Self {
self.property_groups = input;
self
}
pub fn component_type_name(mut self, input: impl Into<std::string::String>) -> Self {
self.component_type_name = Some(input.into());
self
}
pub fn set_component_type_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.component_type_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateComponentTypeInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateComponentTypeInput {
workspace_id: self.workspace_id,
is_singleton: self.is_singleton,
component_type_id: self.component_type_id,
description: self.description,
property_definitions: self.property_definitions,
extends_from: self.extends_from,
functions: self.functions,
tags: self.tags,
property_groups: self.property_groups,
component_type_name: self.component_type_name,
})
}
}
}
impl CreateComponentTypeInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateComponentType,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::CreateComponentTypeInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_2 = &_input.workspace_id;
let input_2 = input_2.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_2,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
let input_3 = &_input.component_type_id;
let input_3 = input_3.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"component_type_id",
"cannot be empty or unset",
)
})?;
let component_type_id = aws_smithy_http::label::fmt_string(
input_3,
aws_smithy_http::label::EncodingStrategy::Default,
);
if component_type_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"component_type_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}/component-types/{componentTypeId}",
workspaceId = workspace_id,
componentTypeId = component_type_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateComponentTypeInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_component_type(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::CreateComponentType::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateComponentType",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_component_type_input::Builder {
crate::input::create_component_type_input::Builder::default()
}
}
pub mod create_entity_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) entity_id: std::option::Option<std::string::String>,
pub(crate) entity_name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) components: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::ComponentRequest>,
>,
pub(crate) parent_entity_id: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn entity_id(mut self, input: impl Into<std::string::String>) -> Self {
self.entity_id = Some(input.into());
self
}
pub fn set_entity_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.entity_id = input;
self
}
pub fn entity_name(mut self, input: impl Into<std::string::String>) -> Self {
self.entity_name = Some(input.into());
self
}
pub fn set_entity_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.entity_name = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn components(
mut self,
k: impl Into<std::string::String>,
v: crate::model::ComponentRequest,
) -> Self {
let mut hash_map = self.components.unwrap_or_default();
hash_map.insert(k.into(), v);
self.components = Some(hash_map);
self
}
pub fn set_components(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::ComponentRequest>,
>,
) -> Self {
self.components = input;
self
}
pub fn parent_entity_id(mut self, input: impl Into<std::string::String>) -> Self {
self.parent_entity_id = Some(input.into());
self
}
pub fn set_parent_entity_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.parent_entity_id = input;
self
}
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateEntityInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateEntityInput {
workspace_id: self.workspace_id,
entity_id: self.entity_id,
entity_name: self.entity_name,
description: self.description,
components: self.components,
parent_entity_id: self.parent_entity_id,
tags: self.tags,
})
}
}
}
impl CreateEntityInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateEntity,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::CreateEntityInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_4 = &_input.workspace_id;
let input_4 = input_4.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_4,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}/entities",
workspaceId = workspace_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateEntityInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_entity(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::CreateEntity::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateEntity",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_entity_input::Builder {
crate::input::create_entity_input::Builder::default()
}
}
pub mod create_scene_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) scene_id: std::option::Option<std::string::String>,
pub(crate) content_location: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) capabilities: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn scene_id(mut self, input: impl Into<std::string::String>) -> Self {
self.scene_id = Some(input.into());
self
}
pub fn set_scene_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.scene_id = input;
self
}
pub fn content_location(mut self, input: impl Into<std::string::String>) -> Self {
self.content_location = Some(input.into());
self
}
pub fn set_content_location(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.content_location = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn capabilities(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.capabilities.unwrap_or_default();
v.push(input.into());
self.capabilities = Some(v);
self
}
pub fn set_capabilities(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.capabilities = input;
self
}
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateSceneInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateSceneInput {
workspace_id: self.workspace_id,
scene_id: self.scene_id,
content_location: self.content_location,
description: self.description,
capabilities: self.capabilities,
tags: self.tags,
})
}
}
}
impl CreateSceneInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateScene,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::CreateSceneInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_5 = &_input.workspace_id;
let input_5 = input_5.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_5,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}/scenes",
workspaceId = workspace_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateSceneInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_scene(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::CreateScene::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateScene",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_scene_input::Builder {
crate::input::create_scene_input::Builder::default()
}
}
pub mod create_sync_job_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) sync_source: std::option::Option<std::string::String>,
pub(crate) sync_role: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn sync_source(mut self, input: impl Into<std::string::String>) -> Self {
self.sync_source = Some(input.into());
self
}
pub fn set_sync_source(mut self, input: std::option::Option<std::string::String>) -> Self {
self.sync_source = input;
self
}
pub fn sync_role(mut self, input: impl Into<std::string::String>) -> Self {
self.sync_role = Some(input.into());
self
}
pub fn set_sync_role(mut self, input: std::option::Option<std::string::String>) -> Self {
self.sync_role = input;
self
}
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateSyncJobInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateSyncJobInput {
workspace_id: self.workspace_id,
sync_source: self.sync_source,
sync_role: self.sync_role,
tags: self.tags,
})
}
}
}
impl CreateSyncJobInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateSyncJob,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::CreateSyncJobInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_6 = &_input.workspace_id;
let input_6 = input_6.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_6,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
let input_7 = &_input.sync_source;
let input_7 = input_7.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"sync_source",
"cannot be empty or unset",
)
})?;
let sync_source = aws_smithy_http::label::fmt_string(
input_7,
aws_smithy_http::label::EncodingStrategy::Default,
);
if sync_source.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"sync_source",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}/sync-jobs/{syncSource}",
workspaceId = workspace_id,
syncSource = sync_source
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateSyncJobInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_sync_job(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::CreateSyncJob::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateSyncJob",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_sync_job_input::Builder {
crate::input::create_sync_job_input::Builder::default()
}
}
pub mod create_workspace_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) s3_location: std::option::Option<std::string::String>,
pub(crate) role: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn s3_location(mut self, input: impl Into<std::string::String>) -> Self {
self.s3_location = Some(input.into());
self
}
pub fn set_s3_location(mut self, input: std::option::Option<std::string::String>) -> Self {
self.s3_location = input;
self
}
pub fn role(mut self, input: impl Into<std::string::String>) -> Self {
self.role = Some(input.into());
self
}
pub fn set_role(mut self, input: std::option::Option<std::string::String>) -> Self {
self.role = input;
self
}
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateWorkspaceInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateWorkspaceInput {
workspace_id: self.workspace_id,
description: self.description,
s3_location: self.s3_location,
role: self.role,
tags: self.tags,
})
}
}
}
impl CreateWorkspaceInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateWorkspace,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::CreateWorkspaceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_8 = &_input.workspace_id;
let input_8 = input_8.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_8,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}",
workspaceId = workspace_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateWorkspaceInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_workspace(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::CreateWorkspace::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateWorkspace",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_workspace_input::Builder {
crate::input::create_workspace_input::Builder::default()
}
}
pub mod delete_component_type_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) component_type_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn component_type_id(mut self, input: impl Into<std::string::String>) -> Self {
self.component_type_id = Some(input.into());
self
}
pub fn set_component_type_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.component_type_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteComponentTypeInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteComponentTypeInput {
workspace_id: self.workspace_id,
component_type_id: self.component_type_id,
})
}
}
}
impl DeleteComponentTypeInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteComponentType,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DeleteComponentTypeInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_9 = &_input.workspace_id;
let input_9 = input_9.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_9,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
let input_10 = &_input.component_type_id;
let input_10 = input_10.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"component_type_id",
"cannot be empty or unset",
)
})?;
let component_type_id = aws_smithy_http::label::fmt_string(
input_10,
aws_smithy_http::label::EncodingStrategy::Default,
);
if component_type_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"component_type_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}/component-types/{componentTypeId}",
workspaceId = workspace_id,
componentTypeId = component_type_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteComponentTypeInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteComponentType::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteComponentType",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_component_type_input::Builder {
crate::input::delete_component_type_input::Builder::default()
}
}
pub mod delete_entity_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) entity_id: std::option::Option<std::string::String>,
pub(crate) is_recursive: std::option::Option<bool>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn entity_id(mut self, input: impl Into<std::string::String>) -> Self {
self.entity_id = Some(input.into());
self
}
pub fn set_entity_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.entity_id = input;
self
}
pub fn is_recursive(mut self, input: bool) -> Self {
self.is_recursive = Some(input);
self
}
pub fn set_is_recursive(mut self, input: std::option::Option<bool>) -> Self {
self.is_recursive = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteEntityInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteEntityInput {
workspace_id: self.workspace_id,
entity_id: self.entity_id,
is_recursive: self.is_recursive,
})
}
}
}
impl DeleteEntityInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteEntity,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DeleteEntityInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_11 = &_input.workspace_id;
let input_11 = input_11.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_11,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
let input_12 = &_input.entity_id;
let input_12 = input_12.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"entity_id",
"cannot be empty or unset",
)
})?;
let entity_id = aws_smithy_http::label::fmt_string(
input_12,
aws_smithy_http::label::EncodingStrategy::Default,
);
if entity_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"entity_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}/entities/{entityId}",
workspaceId = workspace_id,
entityId = entity_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::DeleteEntityInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_13) = &_input.is_recursive {
if *inner_13 {
query.push_kv(
"isRecursive",
aws_smithy_types::primitive::Encoder::from(*inner_13).encode(),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteEntityInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteEntity::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteEntity",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_entity_input::Builder {
crate::input::delete_entity_input::Builder::default()
}
}
pub mod delete_scene_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) scene_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn scene_id(mut self, input: impl Into<std::string::String>) -> Self {
self.scene_id = Some(input.into());
self
}
pub fn set_scene_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.scene_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteSceneInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteSceneInput {
workspace_id: self.workspace_id,
scene_id: self.scene_id,
})
}
}
}
impl DeleteSceneInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteScene,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DeleteSceneInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_14 = &_input.workspace_id;
let input_14 = input_14.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_14,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
let input_15 = &_input.scene_id;
let input_15 = input_15.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"scene_id",
"cannot be empty or unset",
)
})?;
let scene_id = aws_smithy_http::label::fmt_string(
input_15,
aws_smithy_http::label::EncodingStrategy::Default,
);
if scene_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"scene_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}/scenes/{sceneId}",
workspaceId = workspace_id,
sceneId = scene_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteSceneInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteScene::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteScene",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_scene_input::Builder {
crate::input::delete_scene_input::Builder::default()
}
}
pub mod delete_sync_job_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) sync_source: std::option::Option<std::string::String>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn sync_source(mut self, input: impl Into<std::string::String>) -> Self {
self.sync_source = Some(input.into());
self
}
pub fn set_sync_source(mut self, input: std::option::Option<std::string::String>) -> Self {
self.sync_source = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteSyncJobInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteSyncJobInput {
workspace_id: self.workspace_id,
sync_source: self.sync_source,
})
}
}
}
impl DeleteSyncJobInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteSyncJob,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DeleteSyncJobInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_16 = &_input.workspace_id;
let input_16 = input_16.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_16,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
let input_17 = &_input.sync_source;
let input_17 = input_17.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"sync_source",
"cannot be empty or unset",
)
})?;
let sync_source = aws_smithy_http::label::fmt_string(
input_17,
aws_smithy_http::label::EncodingStrategy::Default,
);
if sync_source.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"sync_source",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}/sync-jobs/{syncSource}",
workspaceId = workspace_id,
syncSource = sync_source
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteSyncJobInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteSyncJob::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteSyncJob",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_sync_job_input::Builder {
crate::input::delete_sync_job_input::Builder::default()
}
}
pub mod delete_workspace_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteWorkspaceInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteWorkspaceInput {
workspace_id: self.workspace_id,
})
}
}
}
impl DeleteWorkspaceInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteWorkspace,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DeleteWorkspaceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_18 = &_input.workspace_id;
let input_18 = input_18.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_18,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}",
workspaceId = workspace_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteWorkspaceInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteWorkspace::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteWorkspace",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_workspace_input::Builder {
crate::input::delete_workspace_input::Builder::default()
}
}
pub mod execute_query_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) query_statement: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn query_statement(mut self, input: impl Into<std::string::String>) -> Self {
self.query_statement = Some(input.into());
self
}
pub fn set_query_statement(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.query_statement = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ExecuteQueryInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ExecuteQueryInput {
workspace_id: self.workspace_id,
query_statement: self.query_statement,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl ExecuteQueryInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ExecuteQuery,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ExecuteQueryInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/queries/execution").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ExecuteQueryInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_execute_query(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ExecuteQuery::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ExecuteQuery",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::execute_query_input::Builder {
crate::input::execute_query_input::Builder::default()
}
}
pub mod get_component_type_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) component_type_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn component_type_id(mut self, input: impl Into<std::string::String>) -> Self {
self.component_type_id = Some(input.into());
self
}
pub fn set_component_type_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.component_type_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetComponentTypeInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetComponentTypeInput {
workspace_id: self.workspace_id,
component_type_id: self.component_type_id,
})
}
}
}
impl GetComponentTypeInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetComponentType,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetComponentTypeInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_19 = &_input.workspace_id;
let input_19 = input_19.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_19,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
let input_20 = &_input.component_type_id;
let input_20 = input_20.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"component_type_id",
"cannot be empty or unset",
)
})?;
let component_type_id = aws_smithy_http::label::fmt_string(
input_20,
aws_smithy_http::label::EncodingStrategy::Default,
);
if component_type_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"component_type_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}/component-types/{componentTypeId}",
workspaceId = workspace_id,
componentTypeId = component_type_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetComponentTypeInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetComponentType::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetComponentType",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_component_type_input::Builder {
crate::input::get_component_type_input::Builder::default()
}
}
pub mod get_entity_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) entity_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn entity_id(mut self, input: impl Into<std::string::String>) -> Self {
self.entity_id = Some(input.into());
self
}
pub fn set_entity_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.entity_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetEntityInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetEntityInput {
workspace_id: self.workspace_id,
entity_id: self.entity_id,
})
}
}
}
impl GetEntityInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetEntity,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetEntityInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_21 = &_input.workspace_id;
let input_21 = input_21.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_21,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
let input_22 = &_input.entity_id;
let input_22 = input_22.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"entity_id",
"cannot be empty or unset",
)
})?;
let entity_id = aws_smithy_http::label::fmt_string(
input_22,
aws_smithy_http::label::EncodingStrategy::Default,
);
if entity_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"entity_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}/entities/{entityId}",
workspaceId = workspace_id,
entityId = entity_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetEntityInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op =
aws_smithy_http::operation::Operation::new(request, crate::operation::GetEntity::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetEntity",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_entity_input::Builder {
crate::input::get_entity_input::Builder::default()
}
}
pub mod get_pricing_plan_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {}
impl Builder {
pub fn build(
self,
) -> Result<crate::input::GetPricingPlanInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetPricingPlanInput {})
}
}
}
impl GetPricingPlanInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetPricingPlan,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetPricingPlanInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/pricingplan").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetPricingPlanInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetPricingPlan::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetPricingPlan",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_pricing_plan_input::Builder {
crate::input::get_pricing_plan_input::Builder::default()
}
}
pub mod get_property_value_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) component_name: std::option::Option<std::string::String>,
pub(crate) component_type_id: std::option::Option<std::string::String>,
pub(crate) entity_id: std::option::Option<std::string::String>,
pub(crate) selected_properties: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) property_group_name: std::option::Option<std::string::String>,
pub(crate) tabular_conditions: std::option::Option<crate::model::TabularConditions>,
}
impl Builder {
pub fn component_name(mut self, input: impl Into<std::string::String>) -> Self {
self.component_name = Some(input.into());
self
}
pub fn set_component_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.component_name = input;
self
}
pub fn component_type_id(mut self, input: impl Into<std::string::String>) -> Self {
self.component_type_id = Some(input.into());
self
}
pub fn set_component_type_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.component_type_id = input;
self
}
pub fn entity_id(mut self, input: impl Into<std::string::String>) -> Self {
self.entity_id = Some(input.into());
self
}
pub fn set_entity_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.entity_id = input;
self
}
pub fn selected_properties(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.selected_properties.unwrap_or_default();
v.push(input.into());
self.selected_properties = Some(v);
self
}
pub fn set_selected_properties(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.selected_properties = input;
self
}
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn property_group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.property_group_name = Some(input.into());
self
}
pub fn set_property_group_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.property_group_name = input;
self
}
pub fn tabular_conditions(mut self, input: crate::model::TabularConditions) -> Self {
self.tabular_conditions = Some(input);
self
}
pub fn set_tabular_conditions(
mut self,
input: std::option::Option<crate::model::TabularConditions>,
) -> Self {
self.tabular_conditions = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetPropertyValueInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetPropertyValueInput {
component_name: self.component_name,
component_type_id: self.component_type_id,
entity_id: self.entity_id,
selected_properties: self.selected_properties,
workspace_id: self.workspace_id,
max_results: self.max_results,
next_token: self.next_token,
property_group_name: self.property_group_name,
tabular_conditions: self.tabular_conditions,
})
}
}
}
impl GetPropertyValueInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetPropertyValue,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetPropertyValueInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_23 = &_input.workspace_id;
let input_23 = input_23.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_23,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}/entity-properties/value",
workspaceId = workspace_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetPropertyValueInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_get_property_value(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("data.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetPropertyValue::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetPropertyValue",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_property_value_input::Builder {
crate::input::get_property_value_input::Builder::default()
}
}
pub mod get_property_value_history_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) entity_id: std::option::Option<std::string::String>,
pub(crate) component_name: std::option::Option<std::string::String>,
pub(crate) component_type_id: std::option::Option<std::string::String>,
pub(crate) selected_properties: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) property_filters:
std::option::Option<std::vec::Vec<crate::model::PropertyFilter>>,
pub(crate) start_date_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) end_date_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) interpolation: std::option::Option<crate::model::InterpolationParameters>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) order_by_time: std::option::Option<crate::model::OrderByTime>,
pub(crate) start_time: std::option::Option<std::string::String>,
pub(crate) end_time: std::option::Option<std::string::String>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn entity_id(mut self, input: impl Into<std::string::String>) -> Self {
self.entity_id = Some(input.into());
self
}
pub fn set_entity_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.entity_id = input;
self
}
pub fn component_name(mut self, input: impl Into<std::string::String>) -> Self {
self.component_name = Some(input.into());
self
}
pub fn set_component_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.component_name = input;
self
}
pub fn component_type_id(mut self, input: impl Into<std::string::String>) -> Self {
self.component_type_id = Some(input.into());
self
}
pub fn set_component_type_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.component_type_id = input;
self
}
pub fn selected_properties(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.selected_properties.unwrap_or_default();
v.push(input.into());
self.selected_properties = Some(v);
self
}
pub fn set_selected_properties(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.selected_properties = input;
self
}
pub fn property_filters(mut self, input: crate::model::PropertyFilter) -> Self {
let mut v = self.property_filters.unwrap_or_default();
v.push(input);
self.property_filters = Some(v);
self
}
pub fn set_property_filters(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::PropertyFilter>>,
) -> Self {
self.property_filters = input;
self
}
#[deprecated(
note = "This field is deprecated and will throw an error in the future. Use startTime instead."
)]
pub fn start_date_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.start_date_time = Some(input);
self
}
#[deprecated(
note = "This field is deprecated and will throw an error in the future. Use startTime instead."
)]
pub fn set_start_date_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.start_date_time = input;
self
}
#[deprecated(
note = "This field is deprecated and will throw an error in the future. Use endTime instead."
)]
pub fn end_date_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.end_date_time = Some(input);
self
}
#[deprecated(
note = "This field is deprecated and will throw an error in the future. Use endTime instead."
)]
pub fn set_end_date_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.end_date_time = input;
self
}
pub fn interpolation(mut self, input: crate::model::InterpolationParameters) -> Self {
self.interpolation = Some(input);
self
}
pub fn set_interpolation(
mut self,
input: std::option::Option<crate::model::InterpolationParameters>,
) -> Self {
self.interpolation = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn order_by_time(mut self, input: crate::model::OrderByTime) -> Self {
self.order_by_time = Some(input);
self
}
pub fn set_order_by_time(
mut self,
input: std::option::Option<crate::model::OrderByTime>,
) -> Self {
self.order_by_time = input;
self
}
pub fn start_time(mut self, input: impl Into<std::string::String>) -> Self {
self.start_time = Some(input.into());
self
}
pub fn set_start_time(mut self, input: std::option::Option<std::string::String>) -> Self {
self.start_time = input;
self
}
pub fn end_time(mut self, input: impl Into<std::string::String>) -> Self {
self.end_time = Some(input.into());
self
}
pub fn set_end_time(mut self, input: std::option::Option<std::string::String>) -> Self {
self.end_time = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetPropertyValueHistoryInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetPropertyValueHistoryInput {
workspace_id: self.workspace_id,
entity_id: self.entity_id,
component_name: self.component_name,
component_type_id: self.component_type_id,
selected_properties: self.selected_properties,
property_filters: self.property_filters,
start_date_time: self.start_date_time,
end_date_time: self.end_date_time,
interpolation: self.interpolation,
next_token: self.next_token,
max_results: self.max_results,
order_by_time: self.order_by_time,
start_time: self.start_time,
end_time: self.end_time,
})
}
}
}
impl GetPropertyValueHistoryInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetPropertyValueHistory,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetPropertyValueHistoryInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_24 = &_input.workspace_id;
let input_24 = input_24.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_24,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}/entity-properties/history",
workspaceId = workspace_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetPropertyValueHistoryInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_get_property_value_history(
&self,
)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("data.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetPropertyValueHistory::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetPropertyValueHistory",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_property_value_history_input::Builder {
crate::input::get_property_value_history_input::Builder::default()
}
}
pub mod get_scene_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) scene_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn scene_id(mut self, input: impl Into<std::string::String>) -> Self {
self.scene_id = Some(input.into());
self
}
pub fn set_scene_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.scene_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetSceneInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetSceneInput {
workspace_id: self.workspace_id,
scene_id: self.scene_id,
})
}
}
}
impl GetSceneInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetScene,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetSceneInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_25 = &_input.workspace_id;
let input_25 = input_25.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_25,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
let input_26 = &_input.scene_id;
let input_26 = input_26.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"scene_id",
"cannot be empty or unset",
)
})?;
let scene_id = aws_smithy_http::label::fmt_string(
input_26,
aws_smithy_http::label::EncodingStrategy::Default,
);
if scene_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"scene_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}/scenes/{sceneId}",
workspaceId = workspace_id,
sceneId = scene_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetSceneInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op =
aws_smithy_http::operation::Operation::new(request, crate::operation::GetScene::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetScene",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_scene_input::Builder {
crate::input::get_scene_input::Builder::default()
}
}
pub mod get_sync_job_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) sync_source: std::option::Option<std::string::String>,
pub(crate) workspace_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn sync_source(mut self, input: impl Into<std::string::String>) -> Self {
self.sync_source = Some(input.into());
self
}
pub fn set_sync_source(mut self, input: std::option::Option<std::string::String>) -> Self {
self.sync_source = input;
self
}
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetSyncJobInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetSyncJobInput {
sync_source: self.sync_source,
workspace_id: self.workspace_id,
})
}
}
}
impl GetSyncJobInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetSyncJob,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetSyncJobInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_27 = &_input.sync_source;
let input_27 = input_27.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"sync_source",
"cannot be empty or unset",
)
})?;
let sync_source = aws_smithy_http::label::fmt_string(
input_27,
aws_smithy_http::label::EncodingStrategy::Default,
);
if sync_source.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"sync_source",
"cannot be empty or unset",
),
);
}
write!(output, "/sync-jobs/{syncSource}", syncSource = sync_source)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetSyncJobInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_28) = &_input.workspace_id {
{
query.push_kv("workspace", &aws_smithy_http::query::fmt_string(&inner_28));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetSyncJobInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetSyncJob::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetSyncJob",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_sync_job_input::Builder {
crate::input::get_sync_job_input::Builder::default()
}
}
pub mod get_workspace_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetWorkspaceInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetWorkspaceInput {
workspace_id: self.workspace_id,
})
}
}
}
impl GetWorkspaceInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetWorkspace,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetWorkspaceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_29 = &_input.workspace_id;
let input_29 = input_29.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_29,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}",
workspaceId = workspace_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetWorkspaceInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetWorkspace::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetWorkspace",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_workspace_input::Builder {
crate::input::get_workspace_input::Builder::default()
}
}
pub mod list_component_types_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) filters:
std::option::Option<std::vec::Vec<crate::model::ListComponentTypesFilter>>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn filters(mut self, input: crate::model::ListComponentTypesFilter) -> Self {
let mut v = self.filters.unwrap_or_default();
v.push(input);
self.filters = Some(v);
self
}
pub fn set_filters(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::ListComponentTypesFilter>>,
) -> Self {
self.filters = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListComponentTypesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListComponentTypesInput {
workspace_id: self.workspace_id,
filters: self.filters,
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
impl ListComponentTypesInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListComponentTypes,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListComponentTypesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_30 = &_input.workspace_id;
let input_30 = input_30.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_30,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}/component-types-list",
workspaceId = workspace_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListComponentTypesInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_list_component_types(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListComponentTypes::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListComponentTypes",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_component_types_input::Builder {
crate::input::list_component_types_input::Builder::default()
}
}
pub mod list_entities_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) filters: std::option::Option<std::vec::Vec<crate::model::ListEntitiesFilter>>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn filters(mut self, input: crate::model::ListEntitiesFilter) -> Self {
let mut v = self.filters.unwrap_or_default();
v.push(input);
self.filters = Some(v);
self
}
pub fn set_filters(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::ListEntitiesFilter>>,
) -> Self {
self.filters = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListEntitiesInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListEntitiesInput {
workspace_id: self.workspace_id,
filters: self.filters,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl ListEntitiesInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListEntities,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListEntitiesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_31 = &_input.workspace_id;
let input_31 = input_31.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_31,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}/entities-list",
workspaceId = workspace_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListEntitiesInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_list_entities(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListEntities::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListEntities",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_entities_input::Builder {
crate::input::list_entities_input::Builder::default()
}
}
pub mod list_scenes_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListScenesInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListScenesInput {
workspace_id: self.workspace_id,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl ListScenesInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListScenes,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListScenesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_32 = &_input.workspace_id;
let input_32 = input_32.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_32,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}/scenes-list",
workspaceId = workspace_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListScenesInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_list_scenes(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListScenes::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListScenes",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_scenes_input::Builder {
crate::input::list_scenes_input::Builder::default()
}
}
pub mod list_sync_jobs_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListSyncJobsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListSyncJobsInput {
workspace_id: self.workspace_id,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl ListSyncJobsInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListSyncJobs,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListSyncJobsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_33 = &_input.workspace_id;
let input_33 = input_33.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_33,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}/sync-jobs-list",
workspaceId = workspace_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListSyncJobsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_list_sync_jobs(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListSyncJobs::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListSyncJobs",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_sync_jobs_input::Builder {
crate::input::list_sync_jobs_input::Builder::default()
}
}
pub mod list_sync_resources_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) sync_source: std::option::Option<std::string::String>,
pub(crate) filters: std::option::Option<std::vec::Vec<crate::model::SyncResourceFilter>>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn sync_source(mut self, input: impl Into<std::string::String>) -> Self {
self.sync_source = Some(input.into());
self
}
pub fn set_sync_source(mut self, input: std::option::Option<std::string::String>) -> Self {
self.sync_source = input;
self
}
pub fn filters(mut self, input: crate::model::SyncResourceFilter) -> Self {
let mut v = self.filters.unwrap_or_default();
v.push(input);
self.filters = Some(v);
self
}
pub fn set_filters(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::SyncResourceFilter>>,
) -> Self {
self.filters = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListSyncResourcesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListSyncResourcesInput {
workspace_id: self.workspace_id,
sync_source: self.sync_source,
filters: self.filters,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl ListSyncResourcesInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListSyncResources,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListSyncResourcesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_34 = &_input.workspace_id;
let input_34 = input_34.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_34,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
let input_35 = &_input.sync_source;
let input_35 = input_35.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"sync_source",
"cannot be empty or unset",
)
})?;
let sync_source = aws_smithy_http::label::fmt_string(
input_35,
aws_smithy_http::label::EncodingStrategy::Default,
);
if sync_source.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"sync_source",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}/sync-jobs/{syncSource}/resources-list",
workspaceId = workspace_id,
syncSource = sync_source
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListSyncResourcesInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_list_sync_resources(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListSyncResources::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListSyncResources",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_sync_resources_input::Builder {
crate::input::list_sync_resources_input::Builder::default()
}
}
pub mod list_tags_for_resource_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) resource_arn: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListTagsForResourceInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListTagsForResourceInput {
resource_arn: self.resource_arn,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl ListTagsForResourceInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListTagsForResource,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListTagsForResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/tags-list").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListTagsForResourceInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_list_tags_for_resource(
&self,
)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListTagsForResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListTagsForResource",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_tags_for_resource_input::Builder {
crate::input::list_tags_for_resource_input::Builder::default()
}
}
pub mod list_workspaces_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListWorkspacesInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListWorkspacesInput {
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl ListWorkspacesInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListWorkspaces,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListWorkspacesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/workspaces-list").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListWorkspacesInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_list_workspaces(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListWorkspaces::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListWorkspaces",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_workspaces_input::Builder {
crate::input::list_workspaces_input::Builder::default()
}
}
pub mod tag_resource_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) resource_arn: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = input;
self
}
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
pub fn build(
self,
) -> Result<crate::input::TagResourceInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::TagResourceInput {
resource_arn: self.resource_arn,
tags: self.tags,
})
}
}
}
impl TagResourceInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::TagResource,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::TagResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/tags").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::TagResourceInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_tag_resource(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::TagResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"TagResource",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::tag_resource_input::Builder {
crate::input::tag_resource_input::Builder::default()
}
}
pub mod untag_resource_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) resource_arn: std::option::Option<std::string::String>,
pub(crate) tag_keys: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = input;
self
}
pub fn tag_keys(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.tag_keys.unwrap_or_default();
v.push(input.into());
self.tag_keys = Some(v);
self
}
pub fn set_tag_keys(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.tag_keys = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UntagResourceInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UntagResourceInput {
resource_arn: self.resource_arn,
tag_keys: self.tag_keys,
})
}
}
}
impl UntagResourceInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UntagResource,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UntagResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/tags").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::UntagResourceInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_36 = &_input.resource_arn;
let inner_36 = inner_36.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
)
})?;
if inner_36.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
),
);
}
query.push_kv(
"resourceARN",
&aws_smithy_http::query::fmt_string(&inner_36),
);
let inner_37 = &_input.tag_keys;
let inner_37 = inner_37.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"tag_keys",
"cannot be empty or unset",
)
})?;
for inner_38 in inner_37 {
query.push_kv("tagKeys", &aws_smithy_http::query::fmt_string(&inner_38));
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UntagResourceInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UntagResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UntagResource",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::untag_resource_input::Builder {
crate::input::untag_resource_input::Builder::default()
}
}
pub mod update_component_type_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) is_singleton: std::option::Option<bool>,
pub(crate) component_type_id: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) property_definitions: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::PropertyDefinitionRequest>,
>,
pub(crate) extends_from: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) functions: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::FunctionRequest>,
>,
pub(crate) property_groups: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::PropertyGroupRequest>,
>,
pub(crate) component_type_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn is_singleton(mut self, input: bool) -> Self {
self.is_singleton = Some(input);
self
}
pub fn set_is_singleton(mut self, input: std::option::Option<bool>) -> Self {
self.is_singleton = input;
self
}
pub fn component_type_id(mut self, input: impl Into<std::string::String>) -> Self {
self.component_type_id = Some(input.into());
self
}
pub fn set_component_type_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.component_type_id = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn property_definitions(
mut self,
k: impl Into<std::string::String>,
v: crate::model::PropertyDefinitionRequest,
) -> Self {
let mut hash_map = self.property_definitions.unwrap_or_default();
hash_map.insert(k.into(), v);
self.property_definitions = Some(hash_map);
self
}
pub fn set_property_definitions(
mut self,
input: std::option::Option<
std::collections::HashMap<
std::string::String,
crate::model::PropertyDefinitionRequest,
>,
>,
) -> Self {
self.property_definitions = input;
self
}
pub fn extends_from(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.extends_from.unwrap_or_default();
v.push(input.into());
self.extends_from = Some(v);
self
}
pub fn set_extends_from(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.extends_from = input;
self
}
pub fn functions(
mut self,
k: impl Into<std::string::String>,
v: crate::model::FunctionRequest,
) -> Self {
let mut hash_map = self.functions.unwrap_or_default();
hash_map.insert(k.into(), v);
self.functions = Some(hash_map);
self
}
pub fn set_functions(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::FunctionRequest>,
>,
) -> Self {
self.functions = input;
self
}
pub fn property_groups(
mut self,
k: impl Into<std::string::String>,
v: crate::model::PropertyGroupRequest,
) -> Self {
let mut hash_map = self.property_groups.unwrap_or_default();
hash_map.insert(k.into(), v);
self.property_groups = Some(hash_map);
self
}
pub fn set_property_groups(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::PropertyGroupRequest>,
>,
) -> Self {
self.property_groups = input;
self
}
pub fn component_type_name(mut self, input: impl Into<std::string::String>) -> Self {
self.component_type_name = Some(input.into());
self
}
pub fn set_component_type_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.component_type_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateComponentTypeInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateComponentTypeInput {
workspace_id: self.workspace_id,
is_singleton: self.is_singleton,
component_type_id: self.component_type_id,
description: self.description,
property_definitions: self.property_definitions,
extends_from: self.extends_from,
functions: self.functions,
property_groups: self.property_groups,
component_type_name: self.component_type_name,
})
}
}
}
impl UpdateComponentTypeInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateComponentType,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UpdateComponentTypeInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_39 = &_input.workspace_id;
let input_39 = input_39.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_39,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
let input_40 = &_input.component_type_id;
let input_40 = input_40.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"component_type_id",
"cannot be empty or unset",
)
})?;
let component_type_id = aws_smithy_http::label::fmt_string(
input_40,
aws_smithy_http::label::EncodingStrategy::Default,
);
if component_type_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"component_type_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}/component-types/{componentTypeId}",
workspaceId = workspace_id,
componentTypeId = component_type_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateComponentTypeInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_component_type(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateComponentType::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateComponentType",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_component_type_input::Builder {
crate::input::update_component_type_input::Builder::default()
}
}
pub mod update_entity_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) entity_id: std::option::Option<std::string::String>,
pub(crate) entity_name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) component_updates: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::ComponentUpdateRequest>,
>,
pub(crate) parent_entity_update:
std::option::Option<crate::model::ParentEntityUpdateRequest>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn entity_id(mut self, input: impl Into<std::string::String>) -> Self {
self.entity_id = Some(input.into());
self
}
pub fn set_entity_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.entity_id = input;
self
}
pub fn entity_name(mut self, input: impl Into<std::string::String>) -> Self {
self.entity_name = Some(input.into());
self
}
pub fn set_entity_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.entity_name = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn component_updates(
mut self,
k: impl Into<std::string::String>,
v: crate::model::ComponentUpdateRequest,
) -> Self {
let mut hash_map = self.component_updates.unwrap_or_default();
hash_map.insert(k.into(), v);
self.component_updates = Some(hash_map);
self
}
pub fn set_component_updates(
mut self,
input: std::option::Option<
std::collections::HashMap<
std::string::String,
crate::model::ComponentUpdateRequest,
>,
>,
) -> Self {
self.component_updates = input;
self
}
pub fn parent_entity_update(
mut self,
input: crate::model::ParentEntityUpdateRequest,
) -> Self {
self.parent_entity_update = Some(input);
self
}
pub fn set_parent_entity_update(
mut self,
input: std::option::Option<crate::model::ParentEntityUpdateRequest>,
) -> Self {
self.parent_entity_update = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UpdateEntityInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdateEntityInput {
workspace_id: self.workspace_id,
entity_id: self.entity_id,
entity_name: self.entity_name,
description: self.description,
component_updates: self.component_updates,
parent_entity_update: self.parent_entity_update,
})
}
}
}
impl UpdateEntityInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateEntity,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UpdateEntityInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_41 = &_input.workspace_id;
let input_41 = input_41.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_41,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
let input_42 = &_input.entity_id;
let input_42 = input_42.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"entity_id",
"cannot be empty or unset",
)
})?;
let entity_id = aws_smithy_http::label::fmt_string(
input_42,
aws_smithy_http::label::EncodingStrategy::Default,
);
if entity_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"entity_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}/entities/{entityId}",
workspaceId = workspace_id,
entityId = entity_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateEntityInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_entity(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateEntity::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateEntity",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_entity_input::Builder {
crate::input::update_entity_input::Builder::default()
}
}
pub mod update_pricing_plan_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pricing_mode: std::option::Option<crate::model::PricingMode>,
pub(crate) bundle_names: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
pub fn pricing_mode(mut self, input: crate::model::PricingMode) -> Self {
self.pricing_mode = Some(input);
self
}
pub fn set_pricing_mode(
mut self,
input: std::option::Option<crate::model::PricingMode>,
) -> Self {
self.pricing_mode = input;
self
}
pub fn bundle_names(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.bundle_names.unwrap_or_default();
v.push(input.into());
self.bundle_names = Some(v);
self
}
pub fn set_bundle_names(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.bundle_names = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdatePricingPlanInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdatePricingPlanInput {
pricing_mode: self.pricing_mode,
bundle_names: self.bundle_names,
})
}
}
}
impl UpdatePricingPlanInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdatePricingPlan,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UpdatePricingPlanInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/pricingplan").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdatePricingPlanInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_pricing_plan(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdatePricingPlan::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdatePricingPlan",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_pricing_plan_input::Builder {
crate::input::update_pricing_plan_input::Builder::default()
}
}
pub mod update_scene_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) scene_id: std::option::Option<std::string::String>,
pub(crate) content_location: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) capabilities: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn scene_id(mut self, input: impl Into<std::string::String>) -> Self {
self.scene_id = Some(input.into());
self
}
pub fn set_scene_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.scene_id = input;
self
}
pub fn content_location(mut self, input: impl Into<std::string::String>) -> Self {
self.content_location = Some(input.into());
self
}
pub fn set_content_location(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.content_location = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn capabilities(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.capabilities.unwrap_or_default();
v.push(input.into());
self.capabilities = Some(v);
self
}
pub fn set_capabilities(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.capabilities = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UpdateSceneInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdateSceneInput {
workspace_id: self.workspace_id,
scene_id: self.scene_id,
content_location: self.content_location,
description: self.description,
capabilities: self.capabilities,
})
}
}
}
impl UpdateSceneInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateScene,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UpdateSceneInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_43 = &_input.workspace_id;
let input_43 = input_43.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_43,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
let input_44 = &_input.scene_id;
let input_44 = input_44.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"scene_id",
"cannot be empty or unset",
)
})?;
let scene_id = aws_smithy_http::label::fmt_string(
input_44,
aws_smithy_http::label::EncodingStrategy::Default,
);
if scene_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"scene_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}/scenes/{sceneId}",
workspaceId = workspace_id,
sceneId = scene_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateSceneInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_scene(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateScene::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateScene",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_scene_input::Builder {
crate::input::update_scene_input::Builder::default()
}
}
pub mod update_workspace_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) workspace_id: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) role: std::option::Option<std::string::String>,
}
impl Builder {
pub fn workspace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.workspace_id = Some(input.into());
self
}
pub fn set_workspace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.workspace_id = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn role(mut self, input: impl Into<std::string::String>) -> Self {
self.role = Some(input.into());
self
}
pub fn set_role(mut self, input: std::option::Option<std::string::String>) -> Self {
self.role = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UpdateWorkspaceInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdateWorkspaceInput {
workspace_id: self.workspace_id,
description: self.description,
role: self.role,
})
}
}
}
impl UpdateWorkspaceInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateWorkspace,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UpdateWorkspaceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_45 = &_input.workspace_id;
let input_45 = input_45.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
)
})?;
let workspace_id = aws_smithy_http::label::fmt_string(
input_45,
aws_smithy_http::label::EncodingStrategy::Default,
);
if workspace_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"workspace_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/workspaces/{workspaceId}",
workspaceId = workspace_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateWorkspaceInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_workspace(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
let endpoint_prefix = aws_smithy_http::endpoint::EndpointPrefix::new("api.")?;
request.properties_mut().insert(endpoint_prefix);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateWorkspace::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateWorkspace",
"iottwinmaker",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_workspace_input::Builder {
crate::input::update_workspace_input::Builder::default()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateWorkspaceInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub role: std::option::Option<std::string::String>,
}
impl UpdateWorkspaceInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn role(&self) -> std::option::Option<&str> {
self.role.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateSceneInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub scene_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub content_location: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub capabilities: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl UpdateSceneInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn scene_id(&self) -> std::option::Option<&str> {
self.scene_id.as_deref()
}
pub fn content_location(&self) -> std::option::Option<&str> {
self.content_location.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn capabilities(&self) -> std::option::Option<&[std::string::String]> {
self.capabilities.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdatePricingPlanInput {
#[doc(hidden)]
pub pricing_mode: std::option::Option<crate::model::PricingMode>,
#[doc(hidden)]
pub bundle_names: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl UpdatePricingPlanInput {
pub fn pricing_mode(&self) -> std::option::Option<&crate::model::PricingMode> {
self.pricing_mode.as_ref()
}
pub fn bundle_names(&self) -> std::option::Option<&[std::string::String]> {
self.bundle_names.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateEntityInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub entity_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub entity_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub component_updates: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::ComponentUpdateRequest>,
>,
#[doc(hidden)]
pub parent_entity_update: std::option::Option<crate::model::ParentEntityUpdateRequest>,
}
impl UpdateEntityInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn entity_id(&self) -> std::option::Option<&str> {
self.entity_id.as_deref()
}
pub fn entity_name(&self) -> std::option::Option<&str> {
self.entity_name.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn component_updates(
&self,
) -> std::option::Option<
&std::collections::HashMap<std::string::String, crate::model::ComponentUpdateRequest>,
> {
self.component_updates.as_ref()
}
pub fn parent_entity_update(
&self,
) -> std::option::Option<&crate::model::ParentEntityUpdateRequest> {
self.parent_entity_update.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateComponentTypeInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub is_singleton: std::option::Option<bool>,
#[doc(hidden)]
pub component_type_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub property_definitions: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::PropertyDefinitionRequest>,
>,
#[doc(hidden)]
pub extends_from: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub functions: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::FunctionRequest>,
>,
#[doc(hidden)]
pub property_groups: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::PropertyGroupRequest>,
>,
#[doc(hidden)]
pub component_type_name: std::option::Option<std::string::String>,
}
impl UpdateComponentTypeInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn is_singleton(&self) -> std::option::Option<bool> {
self.is_singleton
}
pub fn component_type_id(&self) -> std::option::Option<&str> {
self.component_type_id.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn property_definitions(
&self,
) -> std::option::Option<
&std::collections::HashMap<std::string::String, crate::model::PropertyDefinitionRequest>,
> {
self.property_definitions.as_ref()
}
pub fn extends_from(&self) -> std::option::Option<&[std::string::String]> {
self.extends_from.as_deref()
}
pub fn functions(
&self,
) -> std::option::Option<
&std::collections::HashMap<std::string::String, crate::model::FunctionRequest>,
> {
self.functions.as_ref()
}
pub fn property_groups(
&self,
) -> std::option::Option<
&std::collections::HashMap<std::string::String, crate::model::PropertyGroupRequest>,
> {
self.property_groups.as_ref()
}
pub fn component_type_name(&self) -> std::option::Option<&str> {
self.component_type_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UntagResourceInput {
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tag_keys: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl UntagResourceInput {
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
pub fn tag_keys(&self) -> std::option::Option<&[std::string::String]> {
self.tag_keys.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct TagResourceInput {
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl TagResourceInput {
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListWorkspacesInput {
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListWorkspacesInput {
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListTagsForResourceInput {
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListTagsForResourceInput {
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListSyncResourcesInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sync_source: std::option::Option<std::string::String>,
#[doc(hidden)]
pub filters: std::option::Option<std::vec::Vec<crate::model::SyncResourceFilter>>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListSyncResourcesInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn sync_source(&self) -> std::option::Option<&str> {
self.sync_source.as_deref()
}
pub fn filters(&self) -> std::option::Option<&[crate::model::SyncResourceFilter]> {
self.filters.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListSyncJobsInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListSyncJobsInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListScenesInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListScenesInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListEntitiesInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub filters: std::option::Option<std::vec::Vec<crate::model::ListEntitiesFilter>>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListEntitiesInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn filters(&self) -> std::option::Option<&[crate::model::ListEntitiesFilter]> {
self.filters.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListComponentTypesInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub filters: std::option::Option<std::vec::Vec<crate::model::ListComponentTypesFilter>>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
}
impl ListComponentTypesInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn filters(&self) -> std::option::Option<&[crate::model::ListComponentTypesFilter]> {
self.filters.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetWorkspaceInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
}
impl GetWorkspaceInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetSyncJobInput {
#[doc(hidden)]
pub sync_source: std::option::Option<std::string::String>,
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
}
impl GetSyncJobInput {
pub fn sync_source(&self) -> std::option::Option<&str> {
self.sync_source.as_deref()
}
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetSceneInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub scene_id: std::option::Option<std::string::String>,
}
impl GetSceneInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn scene_id(&self) -> std::option::Option<&str> {
self.scene_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetPropertyValueHistoryInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub entity_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub component_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub component_type_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub selected_properties: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub property_filters: std::option::Option<std::vec::Vec<crate::model::PropertyFilter>>,
#[deprecated(
note = "This field is deprecated and will throw an error in the future. Use startTime instead."
)]
#[doc(hidden)]
pub start_date_time: std::option::Option<aws_smithy_types::DateTime>,
#[deprecated(
note = "This field is deprecated and will throw an error in the future. Use endTime instead."
)]
#[doc(hidden)]
pub end_date_time: std::option::Option<aws_smithy_types::DateTime>,
#[doc(hidden)]
pub interpolation: std::option::Option<crate::model::InterpolationParameters>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub order_by_time: std::option::Option<crate::model::OrderByTime>,
#[doc(hidden)]
pub start_time: std::option::Option<std::string::String>,
#[doc(hidden)]
pub end_time: std::option::Option<std::string::String>,
}
impl GetPropertyValueHistoryInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn entity_id(&self) -> std::option::Option<&str> {
self.entity_id.as_deref()
}
pub fn component_name(&self) -> std::option::Option<&str> {
self.component_name.as_deref()
}
pub fn component_type_id(&self) -> std::option::Option<&str> {
self.component_type_id.as_deref()
}
pub fn selected_properties(&self) -> std::option::Option<&[std::string::String]> {
self.selected_properties.as_deref()
}
pub fn property_filters(&self) -> std::option::Option<&[crate::model::PropertyFilter]> {
self.property_filters.as_deref()
}
#[deprecated(
note = "This field is deprecated and will throw an error in the future. Use startTime instead."
)]
pub fn start_date_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.start_date_time.as_ref()
}
#[deprecated(
note = "This field is deprecated and will throw an error in the future. Use endTime instead."
)]
pub fn end_date_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.end_date_time.as_ref()
}
pub fn interpolation(&self) -> std::option::Option<&crate::model::InterpolationParameters> {
self.interpolation.as_ref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn order_by_time(&self) -> std::option::Option<&crate::model::OrderByTime> {
self.order_by_time.as_ref()
}
pub fn start_time(&self) -> std::option::Option<&str> {
self.start_time.as_deref()
}
pub fn end_time(&self) -> std::option::Option<&str> {
self.end_time.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetPropertyValueInput {
#[doc(hidden)]
pub component_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub component_type_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub entity_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub selected_properties: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub property_group_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tabular_conditions: std::option::Option<crate::model::TabularConditions>,
}
impl GetPropertyValueInput {
pub fn component_name(&self) -> std::option::Option<&str> {
self.component_name.as_deref()
}
pub fn component_type_id(&self) -> std::option::Option<&str> {
self.component_type_id.as_deref()
}
pub fn entity_id(&self) -> std::option::Option<&str> {
self.entity_id.as_deref()
}
pub fn selected_properties(&self) -> std::option::Option<&[std::string::String]> {
self.selected_properties.as_deref()
}
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn property_group_name(&self) -> std::option::Option<&str> {
self.property_group_name.as_deref()
}
pub fn tabular_conditions(&self) -> std::option::Option<&crate::model::TabularConditions> {
self.tabular_conditions.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetPricingPlanInput {}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetEntityInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub entity_id: std::option::Option<std::string::String>,
}
impl GetEntityInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn entity_id(&self) -> std::option::Option<&str> {
self.entity_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetComponentTypeInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub component_type_id: std::option::Option<std::string::String>,
}
impl GetComponentTypeInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn component_type_id(&self) -> std::option::Option<&str> {
self.component_type_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ExecuteQueryInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub query_statement: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ExecuteQueryInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn query_statement(&self) -> std::option::Option<&str> {
self.query_statement.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteWorkspaceInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
}
impl DeleteWorkspaceInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteSyncJobInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sync_source: std::option::Option<std::string::String>,
}
impl DeleteSyncJobInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn sync_source(&self) -> std::option::Option<&str> {
self.sync_source.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteSceneInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub scene_id: std::option::Option<std::string::String>,
}
impl DeleteSceneInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn scene_id(&self) -> std::option::Option<&str> {
self.scene_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteEntityInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub entity_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub is_recursive: std::option::Option<bool>,
}
impl DeleteEntityInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn entity_id(&self) -> std::option::Option<&str> {
self.entity_id.as_deref()
}
pub fn is_recursive(&self) -> std::option::Option<bool> {
self.is_recursive
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteComponentTypeInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub component_type_id: std::option::Option<std::string::String>,
}
impl DeleteComponentTypeInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn component_type_id(&self) -> std::option::Option<&str> {
self.component_type_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateWorkspaceInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub s3_location: std::option::Option<std::string::String>,
#[doc(hidden)]
pub role: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl CreateWorkspaceInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn s3_location(&self) -> std::option::Option<&str> {
self.s3_location.as_deref()
}
pub fn role(&self) -> std::option::Option<&str> {
self.role.as_deref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateSyncJobInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sync_source: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sync_role: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl CreateSyncJobInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn sync_source(&self) -> std::option::Option<&str> {
self.sync_source.as_deref()
}
pub fn sync_role(&self) -> std::option::Option<&str> {
self.sync_role.as_deref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateSceneInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub scene_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub content_location: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub capabilities: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl CreateSceneInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn scene_id(&self) -> std::option::Option<&str> {
self.scene_id.as_deref()
}
pub fn content_location(&self) -> std::option::Option<&str> {
self.content_location.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn capabilities(&self) -> std::option::Option<&[std::string::String]> {
self.capabilities.as_deref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateEntityInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub entity_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub entity_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub components: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::ComponentRequest>,
>,
#[doc(hidden)]
pub parent_entity_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl CreateEntityInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn entity_id(&self) -> std::option::Option<&str> {
self.entity_id.as_deref()
}
pub fn entity_name(&self) -> std::option::Option<&str> {
self.entity_name.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn components(
&self,
) -> std::option::Option<
&std::collections::HashMap<std::string::String, crate::model::ComponentRequest>,
> {
self.components.as_ref()
}
pub fn parent_entity_id(&self) -> std::option::Option<&str> {
self.parent_entity_id.as_deref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateComponentTypeInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub is_singleton: std::option::Option<bool>,
#[doc(hidden)]
pub component_type_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub property_definitions: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::PropertyDefinitionRequest>,
>,
#[doc(hidden)]
pub extends_from: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub functions: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::FunctionRequest>,
>,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
#[doc(hidden)]
pub property_groups: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::PropertyGroupRequest>,
>,
#[doc(hidden)]
pub component_type_name: std::option::Option<std::string::String>,
}
impl CreateComponentTypeInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn is_singleton(&self) -> std::option::Option<bool> {
self.is_singleton
}
pub fn component_type_id(&self) -> std::option::Option<&str> {
self.component_type_id.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn property_definitions(
&self,
) -> std::option::Option<
&std::collections::HashMap<std::string::String, crate::model::PropertyDefinitionRequest>,
> {
self.property_definitions.as_ref()
}
pub fn extends_from(&self) -> std::option::Option<&[std::string::String]> {
self.extends_from.as_deref()
}
pub fn functions(
&self,
) -> std::option::Option<
&std::collections::HashMap<std::string::String, crate::model::FunctionRequest>,
> {
self.functions.as_ref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
pub fn property_groups(
&self,
) -> std::option::Option<
&std::collections::HashMap<std::string::String, crate::model::PropertyGroupRequest>,
> {
self.property_groups.as_ref()
}
pub fn component_type_name(&self) -> std::option::Option<&str> {
self.component_type_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct BatchPutPropertyValuesInput {
#[doc(hidden)]
pub workspace_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub entries: std::option::Option<std::vec::Vec<crate::model::PropertyValueEntry>>,
}
impl BatchPutPropertyValuesInput {
pub fn workspace_id(&self) -> std::option::Option<&str> {
self.workspace_id.as_deref()
}
pub fn entries(&self) -> std::option::Option<&[crate::model::PropertyValueEntry]> {
self.entries.as_deref()
}
}