// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: com.atproto.identity.signPlcOperation
//
// 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_common::types::value::Data;
use jacquard_derive::{IntoStatic, lexicon};
use serde::{Serialize, Deserialize};

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct SignPlcOperation<'a> {
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub also_known_as: Option<Vec<CowStr<'a>>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub rotation_keys: Option<Vec<CowStr<'a>>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub services: Option<Data<'a>>,
    ///A token received through com.atproto.identity.requestPlcOperationSignature
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub token: Option<CowStr<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub verification_methods: Option<Data<'a>>,
}


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct SignPlcOperationOutput<'a> {
    ///A signed DID PLC operation.
    #[serde(borrow)]
    pub operation: Data<'a>,
}

/// Response type for com.atproto.identity.signPlcOperation
pub struct SignPlcOperationResponse;
impl jacquard_common::xrpc::XrpcResp for SignPlcOperationResponse {
    const NSID: &'static str = "com.atproto.identity.signPlcOperation";
    const ENCODING: &'static str = "application/json";
    type Output<'de> = SignPlcOperationOutput<'de>;
    type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
}

impl<'a> jacquard_common::xrpc::XrpcRequest for SignPlcOperation<'a> {
    const NSID: &'static str = "com.atproto.identity.signPlcOperation";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
        "application/json",
    );
    type Response = SignPlcOperationResponse;
}

/// Endpoint type for com.atproto.identity.signPlcOperation
pub struct SignPlcOperationRequest;
impl jacquard_common::xrpc::XrpcEndpoint for SignPlcOperationRequest {
    const PATH: &'static str = "/xrpc/com.atproto.identity.signPlcOperation";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
        "application/json",
    );
    type Request<'de> = SignPlcOperation<'de>;
    type Response = SignPlcOperationResponse;
}