Struct aws_sdk_iot::operation::DetachSecurityProfile
source · pub struct DetachSecurityProfile { /* private fields */ }
Expand description
Operation shape for DetachSecurityProfile
.
This is usually constructed for you using the the fluent builder returned by
detach_security_profile
.
See crate::client::fluent_builders::DetachSecurityProfile
for more details about the operation.
Implementations§
source§impl DetachSecurityProfile
impl DetachSecurityProfile
sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a new builder-style object to manufacture DetachSecurityProfileInput
.
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new DetachSecurityProfile
operation.
Examples found in repository?
src/input.rs (line 20509)
20382 20383 20384 20385 20386 20387 20388 20389 20390 20391 20392 20393 20394 20395 20396 20397 20398 20399 20400 20401 20402 20403 20404 20405 20406 20407 20408 20409 20410 20411 20412 20413 20414 20415 20416 20417 20418 20419 20420 20421 20422 20423 20424 20425 20426 20427 20428 20429 20430 20431 20432 20433 20434 20435 20436 20437 20438 20439 20440 20441 20442 20443 20444 20445 20446 20447 20448 20449 20450 20451 20452 20453 20454 20455 20456 20457 20458 20459 20460 20461 20462 20463 20464 20465 20466 20467 20468 20469 20470 20471 20472 20473 20474 20475 20476 20477 20478 20479 20480 20481 20482 20483 20484 20485 20486 20487 20488 20489 20490 20491 20492 20493 20494 20495 20496 20497 20498 20499 20500 20501 20502 20503 20504 20505 20506 20507 20508 20509 20510 20511 20512 20513 20514 20515 20516 20517
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DetachSecurityProfile,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let mut request = {
fn uri_base(
_input: &crate::input::DetachSecurityProfileInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_117 = &_input.security_profile_name;
let input_117 = input_117.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"security_profile_name",
"cannot be empty or unset",
)
})?;
let security_profile_name = aws_smithy_http::label::fmt_string(
input_117,
aws_smithy_http::label::EncodingStrategy::Default,
);
if security_profile_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"security_profile_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/security-profiles/{securityProfileName}/targets",
securityProfileName = security_profile_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::DetachSecurityProfileInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_118 = &_input.security_profile_target_arn;
let inner_118 = inner_118.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"security_profile_target_arn",
"cannot be empty or unset",
)
})?;
if inner_118.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"security_profile_target_arn",
"cannot be empty or unset",
),
);
}
query.push_kv(
"securityProfileTargetArn",
&aws_smithy_http::query::fmt_string(&inner_118),
);
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DetachSecurityProfileInput,
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(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()));
}
let endpoint_params = aws_endpoint::Params::new(_config.region.clone());
request
.properties_mut()
.insert::<aws_smithy_http::endpoint::Result>(
_config.endpoint_resolver.resolve_endpoint(&endpoint_params),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DetachSecurityProfile::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DetachSecurityProfile",
"iot",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
Trait Implementations§
source§impl Clone for DetachSecurityProfile
impl Clone for DetachSecurityProfile
source§fn clone(&self) -> DetachSecurityProfile
fn clone(&self) -> DetachSecurityProfile
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for DetachSecurityProfile
impl Debug for DetachSecurityProfile
source§impl Default for DetachSecurityProfile
impl Default for DetachSecurityProfile
source§fn default() -> DetachSecurityProfile
fn default() -> DetachSecurityProfile
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for DetachSecurityProfile
impl Send for DetachSecurityProfile
impl Sync for DetachSecurityProfile
impl Unpin for DetachSecurityProfile
impl UnwindSafe for DetachSecurityProfile
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> ParseHttpResponse for Twhere
T: ParseStrictResponse,
impl<T> ParseHttpResponse for Twhere
T: ParseStrictResponse,
§type Output = <T as ParseStrictResponse>::Output
type Output = <T as ParseStrictResponse>::Output
Output type of the HttpResponse. Read more
source§fn parse_unloaded(
&self,
_response: &mut Response
) -> Option<<T as ParseHttpResponse>::Output>
fn parse_unloaded(
&self,
_response: &mut Response
) -> Option<<T as ParseHttpResponse>::Output>
Parse an HTTP request without reading the body. If the body must be provided to proceed,
return
None
Read moresource§fn parse_loaded(
&self,
response: &Response<Bytes>
) -> <T as ParseHttpResponse>::Output
fn parse_loaded(
&self,
response: &Response<Bytes>
) -> <T as ParseHttpResponse>::Output
Parse an HTTP request from a fully loaded body. This is for standard request/response style
APIs like AwsJson 1.0/1.1 and the error path of most streaming APIs Read more