// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: network.slices.slice.updateOAuthClient
//
// 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, BosStr, DefaultStr, FromStaticStr};
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::string::UriValue;
use jacquard_common::types::value::Data;
use jacquard_derive::IntoStatic;
use serde::{Serialize, Deserialize};
use crate::network_slices::slice::get_o_auth_clients::OauthClientDetails;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct UpdateOAuthClient<S: BosStr = DefaultStr> {
    ///OAuth client ID to update
    pub client_id: S,
    ///New human-readable name of the OAuth client
    #[serde(skip_serializing_if = "Option::is_none")]
    pub client_name: Option<S>,
    ///New URI of the client application
    #[serde(skip_serializing_if = "Option::is_none")]
    pub client_uri: Option<UriValue<S>>,
    ///New URI of the client logo
    #[serde(skip_serializing_if = "Option::is_none")]
    pub logo_uri: Option<UriValue<S>>,
    ///New URI of the privacy policy
    #[serde(skip_serializing_if = "Option::is_none")]
    pub policy_uri: Option<UriValue<S>>,
    ///New allowed redirect URIs for OAuth flow
    #[serde(skip_serializing_if = "Option::is_none")]
    pub redirect_uris: Option<Vec<UriValue<S>>>,
    ///New OAuth scope
    #[serde(skip_serializing_if = "Option::is_none")]
    pub scope: Option<S>,
    ///New URI of the terms of service
    #[serde(skip_serializing_if = "Option::is_none")]
    pub tos_uri: Option<UriValue<S>>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct UpdateOAuthClientOutput<S: BosStr = DefaultStr> {
    #[serde(flatten)]
    pub value: OauthClientDetails<S>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/** Response marker for the `network.slices.slice.updateOAuthClient` procedure.

Implements `jacquard_common::xrpc::XrpcResp`; successful bodies decode as `Self::Output<S>`, which is `UpdateOAuthClientOutput<S>` for this endpoint.*/
pub struct UpdateOAuthClientResponse;
impl jacquard_common::xrpc::XrpcResp for UpdateOAuthClientResponse {
    const NSID: &'static str = "network.slices.slice.updateOAuthClient";
    const ENCODING: &'static str = "application/json";
    type Output<S: BosStr> = UpdateOAuthClientOutput<S>;
    type Err = jacquard_common::xrpc::GenericError;
}

impl<S: BosStr> jacquard_common::xrpc::XrpcRequest for UpdateOAuthClient<S> {
    const NSID: &'static str = "network.slices.slice.updateOAuthClient";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
        "application/json",
    );
    type Response = UpdateOAuthClientResponse;
}

/** Endpoint marker for the `network.slices.slice.updateOAuthClient` procedure.

Path: `/xrpc/network.slices.slice.updateOAuthClient`. The request payload type is `UpdateOAuthClient<S>`; send that request with `jacquard::Client` or use this marker through lower-level `XrpcEndpoint` APIs.*/
pub struct UpdateOAuthClientRequest;
impl jacquard_common::xrpc::XrpcEndpoint for UpdateOAuthClientRequest {
    const PATH: &'static str = "/xrpc/network.slices.slice.updateOAuthClient";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
        "application/json",
    );
    type Request<S: BosStr> = UpdateOAuthClient<S>;
    type Response = UpdateOAuthClientResponse;
}