// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: social.showcase.profile.updateProfile
//
// 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::blob::BlobRef;
use jacquard_common::types::string::UriValue;
use jacquard_derive::{IntoStatic, lexicon};
use serde::{Serialize, Deserialize};
use crate::social_showcase::ProfileView;
use crate::social_showcase::ShowcaseItem;

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct UpdateProfile<'a> {
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub avatar: Option<BlobRef<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub banner: Option<BlobRef<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub bio: Option<CowStr<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub display_name: Option<CowStr<'a>>,
    ///Featured showcase items
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub showcase: Option<Vec<ShowcaseItem<'a>>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub tags: Option<Vec<CowStr<'a>>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub website: Option<UriValue<'a>>,
}


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

/// Response type for social.showcase.profile.updateProfile
pub struct UpdateProfileResponse;
impl jacquard_common::xrpc::XrpcResp for UpdateProfileResponse {
    const NSID: &'static str = "social.showcase.profile.updateProfile";
    const ENCODING: &'static str = "application/json";
    type Output<'de> = UpdateProfileOutput<'de>;
    type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
}

impl<'a> jacquard_common::xrpc::XrpcRequest for UpdateProfile<'a> {
    const NSID: &'static str = "social.showcase.profile.updateProfile";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
        "application/json",
    );
    type Response = UpdateProfileResponse;
}

/// Endpoint type for social.showcase.profile.updateProfile
pub struct UpdateProfileRequest;
impl jacquard_common::xrpc::XrpcEndpoint for UpdateProfileRequest {
    const PATH: &'static str = "/xrpc/social.showcase.profile.updateProfile";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
        "application/json",
    );
    type Request<'de> = UpdateProfile<'de>;
    type Response = UpdateProfileResponse;
}