use crate::volcengine::request::operation;
use crate::volcengine::request::operation_config;
use crate::volcengine::request::request;
use crate::volcengine::request::request::RequestVolcengine;
use crate::volcengine::request::response::ApiResponse;
use crate::{service::ecs, volcengine::error::error};
use volcengine_sdk_protobuf::protobuf::ecs_image;
pub struct ApiDescribeImagesEcs;
impl ApiDescribeImagesEcs {
pub async fn new_describe_images(
&self,
ecs: &ecs::Ecs,
request: ecs_image::DescribeImagesReq,
) -> Result<ecs_image::DescribeImagesResp, error::Error> {
self.new_describe_images_request(ecs, request).await
}
async fn new_describe_images_request(
&self,
ecs: &ecs::Ecs,
request: ecs_image::DescribeImagesReq,
) -> Result<ecs_image::DescribeImagesResp, error::Error> {
let request_operation = operation::Operation::builder()
.with_operation_name(
operation_config::operation_name::OperationName::EcsOperation(
operation_config::operation_name_ecs::OperationNameEcs::DescribeImages,
),
)
.with_operation_http_method(
operation_config::operation_http_method::OperationHttpMethod::GET,
)
.with_operation_http_path(
operation_config::operation_http_path::OperationHttpPath::Default,
)
.build()?;
let response = request::Request::builder()
.with_client_info(&ecs.client.client_info)
.with_config(&ecs.client.config)
.with_handles(&ecs.client.handles)
.with_operation(&request_operation)
.build()?
.send(request)
.await?;
let mut resp = volcengine_sdk_protobuf::protobuf::ecs_image::DescribeImagesResp::default();
resp.to_struct(response).await?;
return Ok(resp);
}
}