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

#[allow(unused_imports)]
use alloc::collections::BTreeMap;

#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::CowStr;
use jacquard_derive::{IntoStatic, lexicon};
use serde::{Serialize, Deserialize};
use crate::at_inlay::Response;

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct Greeting<'a> {
    ///Name to greet.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub name: Option<CowStr<'a>>,
}


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

/// Response type for mov.danabra.Greeting
pub struct GreetingResponse;
impl jacquard_common::xrpc::XrpcResp for GreetingResponse {
    const NSID: &'static str = "mov.danabra.Greeting";
    const ENCODING: &'static str = "application/json";
    type Output<'de> = GreetingOutput<'de>;
    type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
}

impl<'a> jacquard_common::xrpc::XrpcRequest for Greeting<'a> {
    const NSID: &'static str = "mov.danabra.Greeting";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
        "application/json",
    );
    type Response = GreetingResponse;
}

/// Endpoint type for mov.danabra.Greeting
pub struct GreetingRequest;
impl jacquard_common::xrpc::XrpcEndpoint for GreetingRequest {
    const PATH: &'static str = "/xrpc/mov.danabra.Greeting";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
        "application/json",
    );
    type Request<'de> = Greeting<'de>;
    type Response = GreetingResponse;
}