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 SectionsApi<'a> {
pub(crate) client: &'a Client,
}
#[derive(Debug, Clone, Serialize)]
pub struct ListParams {
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub page: Option<i64>,
}
impl Default for ListParams {
#[allow(deprecated)]
fn default() -> Self {
Self {
limit: Some(15),
page: Some(1),
}
}
}
#[derive(Debug, Clone, Serialize)]
pub struct CreateParams {
#[serde(skip)]
pub body: SdkCreateSectionRequestApplicationJson,
}
impl CreateParams {
#[allow(deprecated)]
pub fn new(body: SdkCreateSectionRequestApplicationJson) -> Self {
Self { body }
}
}
#[derive(Debug, Clone, Serialize)]
pub struct ReplaceParams {
#[serde(skip)]
pub body: SdkReplaceSectionRequestApplicationJson,
}
impl ReplaceParams {
#[allow(deprecated)]
pub fn new(body: SdkReplaceSectionRequestApplicationJson) -> Self {
Self { body }
}
}
#[derive(Debug, Clone, Serialize)]
pub struct UpdateParams {
#[serde(skip)]
pub body: SdkUpdateSectionRequestApplicationJson,
}
impl UpdateParams {
#[allow(deprecated)]
pub fn new(body: SdkUpdateSectionRequestApplicationJson) -> Self {
Self { body }
}
}
#[derive(Debug, Clone, Serialize)]
pub struct ReplaceOrderParams {
#[serde(skip)]
pub body: SdkReplaceSectionOrderRequestApplicationJson,
}
impl ReplaceOrderParams {
#[allow(deprecated)]
pub fn new(body: SdkReplaceSectionOrderRequestApplicationJson) -> Self {
Self { body }
}
}
#[derive(Debug, Clone, Serialize)]
pub struct ReplaceProductsParams {
#[serde(skip)]
pub body: SdkReplaceSectionOrderRequestApplicationJson,
}
impl ReplaceProductsParams {
#[allow(deprecated)]
pub fn new(body: SdkReplaceSectionOrderRequestApplicationJson) -> Self {
Self { body }
}
}
#[derive(Debug, Clone, Serialize)]
pub struct ReplaceGroupsParams {
#[serde(skip)]
pub body: SdkReplaceSectionOrderRequestApplicationJson,
}
impl ReplaceGroupsParams {
#[allow(deprecated)]
pub fn new(body: SdkReplaceSectionOrderRequestApplicationJson) -> Self {
Self { body }
}
}
#[derive(Debug, Clone, Serialize)]
pub struct SearchParams {
#[serde(skip)]
pub body: SdkSearchSectionsRequestApplicationJson,
}
impl SearchParams {
#[allow(deprecated)]
pub fn new(body: SdkSearchSectionsRequestApplicationJson) -> Self {
Self { body }
}
}
#[derive(Debug, Clone, Serialize)]
pub struct BatchCreateParams {
#[serde(skip)]
pub body: SdkBatchCreateSectionsRequestApplicationJson,
}
impl BatchCreateParams {
#[allow(deprecated)]
pub fn new(body: SdkBatchCreateSectionsRequestApplicationJson) -> Self {
Self { body }
}
}
#[derive(Debug, Clone, Serialize)]
pub struct BatchUpdateParams {
#[serde(skip)]
pub body: SdkBatchUpdateSectionsRequestApplicationJson,
}
impl BatchUpdateParams {
#[allow(deprecated)]
pub fn new(body: SdkBatchUpdateSectionsRequestApplicationJson) -> Self {
Self { body }
}
}
#[derive(Debug, Clone, Serialize)]
pub struct BatchDeleteParams {
#[serde(skip)]
pub body: SdkBatchDeleteCouponsRequestApplicationJson,
}
impl BatchDeleteParams {
#[allow(deprecated)]
pub fn new(body: SdkBatchDeleteCouponsRequestApplicationJson) -> Self {
Self { body }
}
}
#[derive(Debug, Clone, Serialize)]
pub struct V2ListSectionsParams {
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub page: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
}
impl Default for V2ListSectionsParams {
#[allow(deprecated)]
fn default() -> Self {
Self {
limit: Some(15),
page: Some(1),
x_store: Default::default(),
}
}
}
#[derive(Debug, Clone, Serialize)]
pub struct V2CreateSectionParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
#[serde(skip)]
pub body: SdkV2CreateSectionRequestApplicationJson,
}
impl V2CreateSectionParams {
#[allow(deprecated)]
pub fn new(body: SdkV2CreateSectionRequestApplicationJson) -> Self {
Self {
x_store: Default::default(),
body,
}
}
}
#[derive(Debug, Clone, Serialize)]
pub struct V2SearchSectionsParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
#[serde(skip)]
pub body: SdkV2SearchSectionsRequestApplicationJson,
}
impl V2SearchSectionsParams {
#[allow(deprecated)]
pub fn new(body: SdkV2SearchSectionsRequestApplicationJson) -> Self {
Self {
x_store: Default::default(),
body,
}
}
}
#[derive(Debug, Clone, Default, Serialize)]
pub struct V2GetSectionParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
}
#[derive(Debug, Clone, Serialize)]
pub struct V2ReplaceSectionParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
#[serde(skip)]
pub body: SdkV2ReplaceSectionRequestApplicationJson,
}
impl V2ReplaceSectionParams {
#[allow(deprecated)]
pub fn new(body: SdkV2ReplaceSectionRequestApplicationJson) -> Self {
Self {
x_store: Default::default(),
body,
}
}
}
#[derive(Debug, Clone, Serialize)]
pub struct V2UpdateSectionParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
#[serde(skip)]
pub body: SdkV2UpdateSectionRequestApplicationJson,
}
impl V2UpdateSectionParams {
#[allow(deprecated)]
pub fn new(body: SdkV2UpdateSectionRequestApplicationJson) -> Self {
Self {
x_store: Default::default(),
body,
}
}
}
#[derive(Debug, Clone, Default, Serialize)]
pub struct V2DeleteSectionParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
}
#[derive(Debug, Clone, Serialize)]
pub struct V2BatchCreateSectionsParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
#[serde(skip)]
pub body: SdkV2BatchCreateSectionsRequestApplicationJson,
}
impl V2BatchCreateSectionsParams {
#[allow(deprecated)]
pub fn new(body: SdkV2BatchCreateSectionsRequestApplicationJson) -> Self {
Self {
x_store: Default::default(),
body,
}
}
}
#[derive(Debug, Clone, Serialize)]
pub struct V2BatchUpdateSectionsParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
#[serde(skip)]
pub body: SdkV2BatchUpdateSectionsRequestApplicationJson,
}
impl V2BatchUpdateSectionsParams {
#[allow(deprecated)]
pub fn new(body: SdkV2BatchUpdateSectionsRequestApplicationJson) -> Self {
Self {
x_store: Default::default(),
body,
}
}
}
#[derive(Debug, Clone, Serialize)]
pub struct V2BatchDeleteSectionsParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
#[serde(skip)]
pub body: SdkV2BatchDeleteSectionsRequestApplicationJson,
}
impl V2BatchDeleteSectionsParams {
#[allow(deprecated)]
pub fn new(body: SdkV2BatchDeleteSectionsRequestApplicationJson) -> Self {
Self {
x_store: Default::default(),
body,
}
}
}
#[derive(Debug, Clone, Serialize)]
pub struct V2ReplaceSectionOrderParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
#[serde(skip)]
pub body: SdkV2ReplaceSectionOrderRequestApplicationJson,
}
impl V2ReplaceSectionOrderParams {
#[allow(deprecated)]
pub fn new(body: SdkV2ReplaceSectionOrderRequestApplicationJson) -> Self {
Self {
x_store: Default::default(),
body,
}
}
}
#[derive(Debug, Clone, Serialize)]
pub struct V2ReplaceSectionProductsParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
#[serde(skip)]
pub body: SdkV2ReplaceSectionProductsRequestApplicationJson,
}
impl V2ReplaceSectionProductsParams {
#[allow(deprecated)]
pub fn new(body: SdkV2ReplaceSectionProductsRequestApplicationJson) -> Self {
Self {
x_store: Default::default(),
body,
}
}
}
#[derive(Debug, Clone, Serialize)]
pub struct V2ReplaceSectionGroupsParams {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "X-STORE")]
pub x_store: Option<String>,
#[serde(skip)]
pub body: SdkV2ReplaceSectionGroupsRequestApplicationJson,
}
impl V2ReplaceSectionGroupsParams {
#[allow(deprecated)]
pub fn new(body: SdkV2ReplaceSectionGroupsRequestApplicationJson) -> Self {
Self {
x_store: Default::default(),
body,
}
}
}
impl<'a> SectionsApi<'a> {
pub async fn list(
&self,
params: ListParams,
) -> Result<SdkListSectionsResponseValue200ApplicationJson, Error> {
self.list_with_options(params, None).await
}
pub async fn list_with_options(
&self,
params: ListParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkListSectionsResponseValue200ApplicationJson, Error> {
self.list_raw(params, options)
.await
.map(|response| response.data)
}
pub async fn list_raw(
&self,
params: ListParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkListSectionsResponseValue200ApplicationJson>, Error> {
let path = "/v1/sections".to_string();
let method = http::Method::GET;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("listSections".to_string());
let options = Some(&merged);
self.client
.request_with_query_schema_opts_raw(method, &path, ¶ms, options, "GET /v1/sections")
.await
}
pub async fn create(
&self,
params: CreateParams,
) -> Result<SdkCreateSectionResponseValue201ApplicationJson, Error> {
self.create_with_options(params, None).await
}
pub async fn create_with_options(
&self,
params: CreateParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkCreateSectionResponseValue201ApplicationJson, Error> {
self.create_raw(params, options)
.await
.map(|response| response.data)
}
pub async fn create_raw(
&self,
params: CreateParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkCreateSectionResponseValue201ApplicationJson>, Error> {
let path = "/v1/sections".to_string();
let method = http::Method::POST;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("createSection".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"POST /v1/sections",
)
.await
}
pub async fn get(
&self,
section: &str,
) -> Result<SdkGetSectionResponseValue200ApplicationJson, Error> {
self.get_with_options(section, None).await
}
pub async fn get_with_options(
&self,
section: &str,
options: Option<&crate::RequestOptions>,
) -> Result<SdkGetSectionResponseValue200ApplicationJson, Error> {
self.get_raw(section, options)
.await
.map(|response| response.data)
}
pub async fn get_raw(
&self,
section: &str,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkGetSectionResponseValue200ApplicationJson>, Error> {
let section = crate::client::path_segment(section);
let path = format!("/v1/sections/{section}");
let method = http::Method::GET;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("getSection".to_string());
let options = Some(&merged);
self.client
.request_with_query_schema_opts_raw(
method,
&path,
&(),
options,
"GET /v1/sections/{section}",
)
.await
}
pub async fn replace(
&self,
section: &str,
params: ReplaceParams,
) -> Result<SdkReplaceSectionResponseValue200ApplicationJson, Error> {
self.replace_with_options(section, params, None).await
}
pub async fn replace_with_options(
&self,
section: &str,
params: ReplaceParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkReplaceSectionResponseValue200ApplicationJson, Error> {
self.replace_raw(section, params, options)
.await
.map(|response| response.data)
}
pub async fn replace_raw(
&self,
section: &str,
params: ReplaceParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkReplaceSectionResponseValue200ApplicationJson>, Error> {
let section = crate::client::path_segment(section);
let path = format!("/v1/sections/{section}");
let method = http::Method::PUT;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("replaceSection".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"PUT /v1/sections/{section}",
)
.await
}
pub async fn update(
&self,
section: &str,
params: UpdateParams,
) -> Result<SdkUpdateSectionResponseValue200ApplicationJson, Error> {
self.update_with_options(section, params, None).await
}
pub async fn update_with_options(
&self,
section: &str,
params: UpdateParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkUpdateSectionResponseValue200ApplicationJson, Error> {
self.update_raw(section, params, options)
.await
.map(|response| response.data)
}
pub async fn update_raw(
&self,
section: &str,
params: UpdateParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkUpdateSectionResponseValue200ApplicationJson>, Error> {
let section = crate::client::path_segment(section);
let path = format!("/v1/sections/{section}");
let method = http::Method::PATCH;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("updateSection".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"PATCH /v1/sections/{section}",
)
.await
}
pub async fn delete(
&self,
section: &str,
) -> Result<SdkDeleteSectionResponseValue200ApplicationJson, Error> {
self.delete_with_options(section, None).await
}
pub async fn delete_with_options(
&self,
section: &str,
options: Option<&crate::RequestOptions>,
) -> Result<SdkDeleteSectionResponseValue200ApplicationJson, Error> {
self.delete_raw(section, options)
.await
.map(|response| response.data)
}
pub async fn delete_raw(
&self,
section: &str,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkDeleteSectionResponseValue200ApplicationJson>, Error> {
let section = crate::client::path_segment(section);
let path = format!("/v1/sections/{section}");
let method = http::Method::DELETE;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("deleteSection".to_string());
let options = Some(&merged);
self.client
.request_with_query_schema_opts_raw(
method,
&path,
&(),
options,
"DELETE /v1/sections/{section}",
)
.await
}
pub async fn replace_order(
&self,
params: ReplaceOrderParams,
) -> Result<SdkReplaceSectionOrderResponseValue200ApplicationJson, Error> {
self.replace_order_with_options(params, None).await
}
pub async fn replace_order_with_options(
&self,
params: ReplaceOrderParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkReplaceSectionOrderResponseValue200ApplicationJson, Error> {
self.replace_order_raw(params, options)
.await
.map(|response| response.data)
}
pub async fn replace_order_raw(
&self,
params: ReplaceOrderParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkReplaceSectionOrderResponseValue200ApplicationJson>, Error>
{
let path = "/v1/sections/order".to_string();
let method = http::Method::PUT;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("replaceSectionOrder".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"PUT /v1/sections/order",
)
.await
}
pub async fn replace_products(
&self,
section: &str,
params: ReplaceProductsParams,
) -> Result<SdkReplaceSectionProductsResponseValue200ApplicationJson, Error> {
self.replace_products_with_options(section, params, None)
.await
}
pub async fn replace_products_with_options(
&self,
section: &str,
params: ReplaceProductsParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkReplaceSectionProductsResponseValue200ApplicationJson, Error> {
self.replace_products_raw(section, params, options)
.await
.map(|response| response.data)
}
pub async fn replace_products_raw(
&self,
section: &str,
params: ReplaceProductsParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkReplaceSectionProductsResponseValue200ApplicationJson>, Error>
{
let section = crate::client::path_segment(section);
let path = format!("/v1/sections/{section}/products");
let method = http::Method::PUT;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("replaceSectionProducts".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"PUT /v1/sections/{section}/products",
)
.await
}
pub async fn replace_groups(
&self,
section: &str,
params: ReplaceGroupsParams,
) -> Result<SdkReplaceSectionGroupsResponseValue200ApplicationJson, Error> {
self.replace_groups_with_options(section, params, None)
.await
}
pub async fn replace_groups_with_options(
&self,
section: &str,
params: ReplaceGroupsParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkReplaceSectionGroupsResponseValue200ApplicationJson, Error> {
self.replace_groups_raw(section, params, options)
.await
.map(|response| response.data)
}
pub async fn replace_groups_raw(
&self,
section: &str,
params: ReplaceGroupsParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkReplaceSectionGroupsResponseValue200ApplicationJson>, Error>
{
let section = crate::client::path_segment(section);
let path = format!("/v1/sections/{section}/groups");
let method = http::Method::PUT;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("replaceSectionGroups".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"PUT /v1/sections/{section}/groups",
)
.await
}
pub async fn search(
&self,
params: SearchParams,
) -> Result<SdkSearchSectionsResponseValue200ApplicationJson, Error> {
self.search_with_options(params, None).await
}
pub async fn search_with_options(
&self,
params: SearchParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkSearchSectionsResponseValue200ApplicationJson, Error> {
self.search_raw(params, options)
.await
.map(|response| response.data)
}
pub async fn search_raw(
&self,
params: SearchParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkSearchSectionsResponseValue200ApplicationJson>, Error> {
let path = "/v1/sections/search".to_string();
let method = http::Method::POST;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("searchSections".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"POST /v1/sections/search",
)
.await
}
pub async fn batch_create(
&self,
params: BatchCreateParams,
) -> Result<SdkBatchCreateSectionsResponseValue200ApplicationJson, Error> {
self.batch_create_with_options(params, None).await
}
pub async fn batch_create_with_options(
&self,
params: BatchCreateParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkBatchCreateSectionsResponseValue200ApplicationJson, Error> {
self.batch_create_raw(params, options)
.await
.map(|response| response.data)
}
pub async fn batch_create_raw(
&self,
params: BatchCreateParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkBatchCreateSectionsResponseValue200ApplicationJson>, Error>
{
let path = "/v1/sections/batch".to_string();
let method = http::Method::POST;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("batchCreateSections".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"POST /v1/sections/batch",
)
.await
}
pub async fn batch_update(
&self,
params: BatchUpdateParams,
) -> Result<SdkBatchUpdateSectionsResponseValue200ApplicationJson, Error> {
self.batch_update_with_options(params, None).await
}
pub async fn batch_update_with_options(
&self,
params: BatchUpdateParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkBatchUpdateSectionsResponseValue200ApplicationJson, Error> {
self.batch_update_raw(params, options)
.await
.map(|response| response.data)
}
pub async fn batch_update_raw(
&self,
params: BatchUpdateParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkBatchUpdateSectionsResponseValue200ApplicationJson>, Error>
{
let path = "/v1/sections/batch".to_string();
let method = http::Method::PATCH;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("batchUpdateSections".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"PATCH /v1/sections/batch",
)
.await
}
pub async fn batch_delete(
&self,
params: BatchDeleteParams,
) -> Result<SdkBatchDeleteSectionsResponseValue200ApplicationJson, Error> {
self.batch_delete_with_options(params, None).await
}
pub async fn batch_delete_with_options(
&self,
params: BatchDeleteParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkBatchDeleteSectionsResponseValue200ApplicationJson, Error> {
self.batch_delete_raw(params, options)
.await
.map(|response| response.data)
}
pub async fn batch_delete_raw(
&self,
params: BatchDeleteParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkBatchDeleteSectionsResponseValue200ApplicationJson>, Error>
{
let path = "/v1/sections/batch".to_string();
let method = http::Method::DELETE;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("batchDeleteSections".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"DELETE /v1/sections/batch",
)
.await
}
pub async fn v_2_list_sections(
&self,
params: V2ListSectionsParams,
) -> Result<SdkV2ListSectionsResponseValue200ApplicationJson, Error> {
self.v_2_list_sections_with_options(params, None).await
}
pub async fn v_2_list_sections_with_options(
&self,
params: V2ListSectionsParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkV2ListSectionsResponseValue200ApplicationJson, Error> {
self.v_2_list_sections_raw(params, options)
.await
.map(|response| response.data)
}
pub async fn v_2_list_sections_raw(
&self,
params: V2ListSectionsParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkV2ListSectionsResponseValue200ApplicationJson>, Error> {
let path = "/v2/sections".to_string();
let method = http::Method::GET;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("v2ListSections".to_string());
let options = Some(&merged);
self.client
.request_with_query_schema_opts_raw(method, &path, ¶ms, options, "GET /v2/sections")
.await
}
pub async fn v_2_create_section(
&self,
params: V2CreateSectionParams,
) -> Result<SdkV2CreateSectionResponseValue201ApplicationJson, Error> {
self.v_2_create_section_with_options(params, None).await
}
pub async fn v_2_create_section_with_options(
&self,
params: V2CreateSectionParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkV2CreateSectionResponseValue201ApplicationJson, Error> {
self.v_2_create_section_raw(params, options)
.await
.map(|response| response.data)
}
pub async fn v_2_create_section_raw(
&self,
params: V2CreateSectionParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkV2CreateSectionResponseValue201ApplicationJson>, Error> {
let path = "/v2/sections".to_string();
let method = http::Method::POST;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = true;
merged.operation_id = Some("v2CreateSection".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"POST /v2/sections",
)
.await
}
pub async fn v_2_search_sections(
&self,
params: V2SearchSectionsParams,
) -> Result<SdkV2SearchSectionsResponseValue200ApplicationJson, Error> {
self.v_2_search_sections_with_options(params, None).await
}
pub async fn v_2_search_sections_with_options(
&self,
params: V2SearchSectionsParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkV2SearchSectionsResponseValue200ApplicationJson, Error> {
self.v_2_search_sections_raw(params, options)
.await
.map(|response| response.data)
}
pub async fn v_2_search_sections_raw(
&self,
params: V2SearchSectionsParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkV2SearchSectionsResponseValue200ApplicationJson>, Error> {
let path = "/v2/sections/search".to_string();
let method = http::Method::POST;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = true;
merged.operation_id = Some("v2SearchSections".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"POST /v2/sections/search",
)
.await
}
pub async fn v_2_get_section(
&self,
section: &str,
params: V2GetSectionParams,
) -> Result<SdkV2GetSectionResponseValue200ApplicationJson, Error> {
self.v_2_get_section_with_options(section, params, None)
.await
}
pub async fn v_2_get_section_with_options(
&self,
section: &str,
params: V2GetSectionParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkV2GetSectionResponseValue200ApplicationJson, Error> {
self.v_2_get_section_raw(section, params, options)
.await
.map(|response| response.data)
}
pub async fn v_2_get_section_raw(
&self,
section: &str,
params: V2GetSectionParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkV2GetSectionResponseValue200ApplicationJson>, Error> {
let section = crate::client::path_segment(section);
let path = format!("/v2/sections/{section}");
let method = http::Method::GET;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("v2GetSection".to_string());
let options = Some(&merged);
self.client
.request_with_query_schema_opts_raw(
method,
&path,
¶ms,
options,
"GET /v2/sections/{section}",
)
.await
}
pub async fn v_2_replace_section(
&self,
section: &str,
params: V2ReplaceSectionParams,
) -> Result<SdkV2ReplaceSectionResponseValue200ApplicationJson, Error> {
self.v_2_replace_section_with_options(section, params, None)
.await
}
pub async fn v_2_replace_section_with_options(
&self,
section: &str,
params: V2ReplaceSectionParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkV2ReplaceSectionResponseValue200ApplicationJson, Error> {
self.v_2_replace_section_raw(section, params, options)
.await
.map(|response| response.data)
}
pub async fn v_2_replace_section_raw(
&self,
section: &str,
params: V2ReplaceSectionParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkV2ReplaceSectionResponseValue200ApplicationJson>, Error> {
let section = crate::client::path_segment(section);
let path = format!("/v2/sections/{section}");
let method = http::Method::PUT;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("v2ReplaceSection".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"PUT /v2/sections/{section}",
)
.await
}
pub async fn v_2_update_section(
&self,
section: &str,
params: V2UpdateSectionParams,
) -> Result<SdkV2UpdateSectionResponseValue200ApplicationJson, Error> {
self.v_2_update_section_with_options(section, params, None)
.await
}
pub async fn v_2_update_section_with_options(
&self,
section: &str,
params: V2UpdateSectionParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkV2UpdateSectionResponseValue200ApplicationJson, Error> {
self.v_2_update_section_raw(section, params, options)
.await
.map(|response| response.data)
}
pub async fn v_2_update_section_raw(
&self,
section: &str,
params: V2UpdateSectionParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkV2UpdateSectionResponseValue200ApplicationJson>, Error> {
let section = crate::client::path_segment(section);
let path = format!("/v2/sections/{section}");
let method = http::Method::PATCH;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("v2UpdateSection".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"PATCH /v2/sections/{section}",
)
.await
}
pub async fn v_2_delete_section(
&self,
section: &str,
params: V2DeleteSectionParams,
) -> Result<SdkV2DeleteSectionResponseValue200ApplicationJson, Error> {
self.v_2_delete_section_with_options(section, params, None)
.await
}
pub async fn v_2_delete_section_with_options(
&self,
section: &str,
params: V2DeleteSectionParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkV2DeleteSectionResponseValue200ApplicationJson, Error> {
self.v_2_delete_section_raw(section, params, options)
.await
.map(|response| response.data)
}
pub async fn v_2_delete_section_raw(
&self,
section: &str,
params: V2DeleteSectionParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkV2DeleteSectionResponseValue200ApplicationJson>, Error> {
let section = crate::client::path_segment(section);
let path = format!("/v2/sections/{section}");
let method = http::Method::DELETE;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("v2DeleteSection".to_string());
let options = Some(&merged);
self.client
.request_with_query_schema_opts_raw(
method,
&path,
¶ms,
options,
"DELETE /v2/sections/{section}",
)
.await
}
pub async fn v_2_batch_create_sections(
&self,
params: V2BatchCreateSectionsParams,
) -> Result<SdkV2BatchCreateSectionsResponseValue200ApplicationJson, Error> {
self.v_2_batch_create_sections_with_options(params, None)
.await
}
pub async fn v_2_batch_create_sections_with_options(
&self,
params: V2BatchCreateSectionsParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkV2BatchCreateSectionsResponseValue200ApplicationJson, Error> {
self.v_2_batch_create_sections_raw(params, options)
.await
.map(|response| response.data)
}
pub async fn v_2_batch_create_sections_raw(
&self,
params: V2BatchCreateSectionsParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkV2BatchCreateSectionsResponseValue200ApplicationJson>, Error>
{
let path = "/v2/sections/batch".to_string();
let method = http::Method::POST;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = true;
merged.operation_id = Some("v2BatchCreateSections".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"POST /v2/sections/batch",
)
.await
}
pub async fn v_2_batch_update_sections(
&self,
params: V2BatchUpdateSectionsParams,
) -> Result<SdkV2BatchUpdateSectionsResponseValue200ApplicationJson, Error> {
self.v_2_batch_update_sections_with_options(params, None)
.await
}
pub async fn v_2_batch_update_sections_with_options(
&self,
params: V2BatchUpdateSectionsParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkV2BatchUpdateSectionsResponseValue200ApplicationJson, Error> {
self.v_2_batch_update_sections_raw(params, options)
.await
.map(|response| response.data)
}
pub async fn v_2_batch_update_sections_raw(
&self,
params: V2BatchUpdateSectionsParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkV2BatchUpdateSectionsResponseValue200ApplicationJson>, Error>
{
let path = "/v2/sections/batch".to_string();
let method = http::Method::PATCH;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = true;
merged.operation_id = Some("v2BatchUpdateSections".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"PATCH /v2/sections/batch",
)
.await
}
pub async fn v_2_batch_delete_sections(
&self,
params: V2BatchDeleteSectionsParams,
) -> Result<SdkV2BatchDeleteSectionsResponseValue200ApplicationJson, Error> {
self.v_2_batch_delete_sections_with_options(params, None)
.await
}
pub async fn v_2_batch_delete_sections_with_options(
&self,
params: V2BatchDeleteSectionsParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkV2BatchDeleteSectionsResponseValue200ApplicationJson, Error> {
self.v_2_batch_delete_sections_raw(params, options)
.await
.map(|response| response.data)
}
pub async fn v_2_batch_delete_sections_raw(
&self,
params: V2BatchDeleteSectionsParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkV2BatchDeleteSectionsResponseValue200ApplicationJson>, Error>
{
let path = "/v2/sections/batch".to_string();
let method = http::Method::DELETE;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("v2BatchDeleteSections".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"DELETE /v2/sections/batch",
)
.await
}
pub async fn v_2_replace_section_order(
&self,
params: V2ReplaceSectionOrderParams,
) -> Result<SdkV2ReplaceSectionOrderResponseValue200ApplicationJson, Error> {
self.v_2_replace_section_order_with_options(params, None)
.await
}
pub async fn v_2_replace_section_order_with_options(
&self,
params: V2ReplaceSectionOrderParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkV2ReplaceSectionOrderResponseValue200ApplicationJson, Error> {
self.v_2_replace_section_order_raw(params, options)
.await
.map(|response| response.data)
}
pub async fn v_2_replace_section_order_raw(
&self,
params: V2ReplaceSectionOrderParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkV2ReplaceSectionOrderResponseValue200ApplicationJson>, Error>
{
let path = "/v2/sections/order".to_string();
let method = http::Method::PUT;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("v2ReplaceSectionOrder".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"PUT /v2/sections/order",
)
.await
}
pub async fn v_2_replace_section_products(
&self,
section: &str,
params: V2ReplaceSectionProductsParams,
) -> Result<SdkV2ReplaceSectionProductsResponseValue200ApplicationJson, Error> {
self.v_2_replace_section_products_with_options(section, params, None)
.await
}
pub async fn v_2_replace_section_products_with_options(
&self,
section: &str,
params: V2ReplaceSectionProductsParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkV2ReplaceSectionProductsResponseValue200ApplicationJson, Error> {
self.v_2_replace_section_products_raw(section, params, options)
.await
.map(|response| response.data)
}
pub async fn v_2_replace_section_products_raw(
&self,
section: &str,
params: V2ReplaceSectionProductsParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkV2ReplaceSectionProductsResponseValue200ApplicationJson>, Error>
{
let section = crate::client::path_segment(section);
let path = format!("/v2/sections/{section}/products");
let method = http::Method::PUT;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("v2ReplaceSectionProducts".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"PUT /v2/sections/{section}/products",
)
.await
}
pub async fn v_2_replace_section_groups(
&self,
section: &str,
params: V2ReplaceSectionGroupsParams,
) -> Result<SdkV2ReplaceSectionGroupsResponseValue200ApplicationJson, Error> {
self.v_2_replace_section_groups_with_options(section, params, None)
.await
}
pub async fn v_2_replace_section_groups_with_options(
&self,
section: &str,
params: V2ReplaceSectionGroupsParams,
options: Option<&crate::RequestOptions>,
) -> Result<SdkV2ReplaceSectionGroupsResponseValue200ApplicationJson, Error> {
self.v_2_replace_section_groups_raw(section, params, options)
.await
.map(|response| response.data)
}
pub async fn v_2_replace_section_groups_raw(
&self,
section: &str,
params: V2ReplaceSectionGroupsParams,
options: Option<&crate::RequestOptions>,
) -> Result<crate::RawResponse<SdkV2ReplaceSectionGroupsResponseValue200ApplicationJson>, Error>
{
let section = crate::client::path_segment(section);
let path = format!("/v2/sections/{section}/groups");
let method = http::Method::PUT;
let mut merged = options.cloned().unwrap_or_default();
merged.idempotency_supported = false;
merged.operation_id = Some("v2ReplaceSectionGroups".to_string());
let options = Some(&merged);
self.client
.request_with_body_schema_opts_raw(
method,
&path,
¶ms,
Some(¶ms.body),
options,
"PUT /v2/sections/{section}/groups",
)
.await
}
}