use crate::client::Client;
#[allow(unused_imports)]
use crate::enums::*;
use crate::error::Error;
#[allow(unused_imports)]
use crate::models::*;
#[allow(unused_imports)]
use serde::Serialize;
pub struct VariantDeliverableFoldersApi<'a> {
pub(crate) client: &'a Client,
}
#[derive(Debug, Clone, Default, Serialize)]
pub struct ListParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
}
#[derive(Debug, Clone, Serialize)]
pub struct CreateParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
#[serde(skip)]
pub body: SdkCreateVariantDeliverableFolderRequestApplicationJson,
}
impl CreateParams {
#[allow(deprecated)]
pub fn new(body: SdkCreateVariantDeliverableFolderRequestApplicationJson) -> Self {
Self {
x_store: Default::default(),
body,
}
}
}
#[derive(Debug, Clone, Default, Serialize)]
pub struct GetParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
}
#[derive(Debug, Clone, Serialize)]
pub struct ReplaceParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
#[serde(skip)]
pub body: SdkReplaceVariantDeliverableFolderSettingsRequestApplicationJson,
}
impl ReplaceParams {
#[allow(deprecated)]
pub fn new(body: SdkReplaceVariantDeliverableFolderSettingsRequestApplicationJson) -> Self {
Self {
x_store: Default::default(),
body,
}
}
}
#[derive(Debug, Clone, Serialize)]
pub struct UpdateParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
#[serde(skip)]
pub body: SdkUpdateVariantDeliverableFolderRequestApplicationJson,
}
impl UpdateParams {
#[allow(deprecated)]
pub fn new(body: SdkUpdateVariantDeliverableFolderRequestApplicationJson) -> Self {
Self {
x_store: Default::default(),
body,
}
}
}
#[derive(Debug, Clone, Default, Serialize)]
pub struct DeleteParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
}
impl<'a> VariantDeliverableFoldersApi<'a> {
pub async fn list(
&self,
product: &str,
variant: &str,
params: ListParams,
) -> Result<SdkListVariantDeliverableFoldersResponseValue200ApplicationJson, Error> {
self.list_with_options(product, variant, params, None).await
}
pub async fn list_with_options(
&self,
product: &str,
variant: &str,
params: ListParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkListVariantDeliverableFoldersResponseValue200ApplicationJson, Error> {
self.list_raw(product, variant, params, options)
.await
.map(|response| response.data)
}
pub async fn list_raw(
&self,
product: &str,
variant: &str,
params: ListParams,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<SdkListVariantDeliverableFoldersResponseValue200ApplicationJson>,
Error,
> {
let product = crate::client::path_segment(product);
let variant = crate::client::path_segment(variant);
let path = format!("/v2/products/{product}/variants/{variant}/deliverable/folders");
let method = http::Method::GET;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("listVariantDeliverableFolders".to_string());
let options = Some(&merged);
self.client
.request_with_query_schema_opts_raw(
method,
&path,
¶ms,
options,
"GET /v2/products/{product}/variants/{variant}/deliverable/folders",
)
.await
}
pub async fn create(
&self,
product: &str,
variant: &str,
params: CreateParams,
) -> Result<SdkCreateVariantDeliverableFolderResponseValue201ApplicationJson, Error> {
self.create_with_options(product, variant, params, None)
.await
}
pub async fn create_with_options(
&self,
product: &str,
variant: &str,
params: CreateParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkCreateVariantDeliverableFolderResponseValue201ApplicationJson, Error> {
self.create_raw(product, variant, params, options)
.await
.map(|response| response.data)
}
pub async fn create_raw(
&self,
product: &str,
variant: &str,
params: CreateParams,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<SdkCreateVariantDeliverableFolderResponseValue201ApplicationJson>,
Error,
> {
let product = crate::client::path_segment(product);
let variant = crate::client::path_segment(variant);
let path = format!("/v2/products/{product}/variants/{variant}/deliverable/folders");
let method = http::Method::POST;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("createVariantDeliverableFolder".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"POST /v2/products/{product}/variants/{variant}/deliverable/folders",
)
.await
}
pub async fn get(
&self,
product: &str,
variant: &str,
folder: &str,
params: GetParams,
) -> Result<SdkGetVariantDeliverableFolderResponseValue200ApplicationJson, Error> {
self.get_with_options(product, variant, folder, params, None)
.await
}
pub async fn get_with_options(
&self,
product: &str,
variant: &str,
folder: &str,
params: GetParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkGetVariantDeliverableFolderResponseValue200ApplicationJson, Error> {
self.get_raw(product, variant, folder, params, options)
.await
.map(|response| response.data)
}
pub async fn get_raw(
&self,
product: &str,
variant: &str,
folder: &str,
params: GetParams,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<SdkGetVariantDeliverableFolderResponseValue200ApplicationJson>,
Error,
> {
let product = crate::client::path_segment(product);
let variant = crate::client::path_segment(variant);
let folder = crate::client::path_segment(folder);
let path =
format!("/v2/products/{product}/variants/{variant}/deliverable/folders/{folder}");
let method = http::Method::GET;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("getVariantDeliverableFolder".to_string());
let options = Some(&merged);
self.client
.request_with_query_schema_opts_raw(
method,
&path,
¶ms,
options,
"GET /v2/products/{product}/variants/{variant}/deliverable/folders/{folder}",
)
.await
}
pub async fn replace(
&self,
product: &str,
variant: &str,
folder: &str,
params: ReplaceParams,
) -> Result<SdkReplaceVariantDeliverableFolderSettingsResponseValue200ApplicationJson, Error>
{
self.replace_with_options(product, variant, folder, params, None)
.await
}
pub async fn replace_with_options(
&self,
product: &str,
variant: &str,
folder: &str,
params: ReplaceParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkReplaceVariantDeliverableFolderSettingsResponseValue200ApplicationJson, Error>
{
self.replace_raw(product, variant, folder, params, options)
.await
.map(|response| response.data)
}
pub async fn replace_raw(
&self,
product: &str,
variant: &str,
folder: &str,
params: ReplaceParams,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<
SdkReplaceVariantDeliverableFolderSettingsResponseValue200ApplicationJson,
>,
Error,
> {
let product = crate::client::path_segment(product);
let variant = crate::client::path_segment(variant);
let folder = crate::client::path_segment(folder);
let path =
format!("/v2/products/{product}/variants/{variant}/deliverable/folders/{folder}");
let method = http::Method::PUT;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("replaceVariantDeliverableFolderSettings".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"PUT /v2/products/{product}/variants/{variant}/deliverable/folders/{folder}",
)
.await
}
pub async fn update(
&self,
product: &str,
variant: &str,
folder: &str,
params: UpdateParams,
) -> Result<SdkUpdateVariantDeliverableFolderResponseValue200ApplicationJson, Error> {
self.update_with_options(product, variant, folder, params, None)
.await
}
pub async fn update_with_options(
&self,
product: &str,
variant: &str,
folder: &str,
params: UpdateParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkUpdateVariantDeliverableFolderResponseValue200ApplicationJson, Error> {
self.update_raw(product, variant, folder, params, options)
.await
.map(|response| response.data)
}
pub async fn update_raw(
&self,
product: &str,
variant: &str,
folder: &str,
params: UpdateParams,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<SdkUpdateVariantDeliverableFolderResponseValue200ApplicationJson>,
Error,
> {
let product = crate::client::path_segment(product);
let variant = crate::client::path_segment(variant);
let folder = crate::client::path_segment(folder);
let path =
format!("/v2/products/{product}/variants/{variant}/deliverable/folders/{folder}");
let method = http::Method::PATCH;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("updateVariantDeliverableFolder".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"PATCH /v2/products/{product}/variants/{variant}/deliverable/folders/{folder}",
)
.await
}
pub async fn delete(
&self,
product: &str,
variant: &str,
folder: &str,
params: DeleteParams,
) -> Result<SdkDeleteVariantDeliverableFolderResponseValue200ApplicationJson, Error> {
self.delete_with_options(product, variant, folder, params, None)
.await
}
pub async fn delete_with_options(
&self,
product: &str,
variant: &str,
folder: &str,
params: DeleteParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkDeleteVariantDeliverableFolderResponseValue200ApplicationJson, Error> {
self.delete_raw(product, variant, folder, params, options)
.await
.map(|response| response.data)
}
pub async fn delete_raw(
&self,
product: &str,
variant: &str,
folder: &str,
params: DeleteParams,
options: Option<&crate::RequestOptions>,
) -> Result<
crate::RawResponse<SdkDeleteVariantDeliverableFolderResponseValue200ApplicationJson>,
Error,
> {
let product = crate::client::path_segment(product);
let variant = crate::client::path_segment(variant);
let folder = crate::client::path_segment(folder);
let path =
format!("/v2/products/{product}/variants/{variant}/deliverable/folders/{folder}");
let method = http::Method::DELETE;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("deleteVariantDeliverableFolder".to_string());
let options = Some(&merged);
self.client
.request_with_query_schema_opts_raw(
method,
&path,
¶ms,
options,
"DELETE /v2/products/{product}/variants/{variant}/deliverable/folders/{folder}",
)
.await
}
}