// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: tools.ozone.set.upsertSet
//
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.

#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_derive::IntoStatic;
use serde::{Serialize, Deserialize};
use crate::tools_ozone::set::Set;
use crate::tools_ozone::set::SetView;

#[jacquard_derive::lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct UpsertSet<'a> {
    #[serde(flatten)]
    #[serde(borrow)]
    pub value: Set<'a>,
}


#[jacquard_derive::lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct UpsertSetOutput<'a> {
    #[serde(flatten)]
    #[serde(borrow)]
    pub value: SetView<'a>,
}

/// Response type for tools.ozone.set.upsertSet
pub struct UpsertSetResponse;
impl jacquard_common::xrpc::XrpcResp for UpsertSetResponse {
    const NSID: &'static str = "tools.ozone.set.upsertSet";
    const ENCODING: &'static str = "application/json";
    type Output<'de> = UpsertSetOutput<'de>;
    type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
}

impl<'a> jacquard_common::xrpc::XrpcRequest for UpsertSet<'a> {
    const NSID: &'static str = "tools.ozone.set.upsertSet";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
        "application/json",
    );
    type Response = UpsertSetResponse;
}

/// Endpoint type for tools.ozone.set.upsertSet
pub struct UpsertSetRequest;
impl jacquard_common::xrpc::XrpcEndpoint for UpsertSetRequest {
    const PATH: &'static str = "/xrpc/tools.ozone.set.upsertSet";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
        "application/json",
    );
    type Request<'de> = UpsertSet<'de>;
    type Response = UpsertSetResponse;
}