jacquard_api/network_slices/slice/
create_o_auth_client.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: network.slices.slice.createOAuthClient
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8#[jacquard_derive::lexicon]
9#[derive(
10    serde::Serialize,
11    serde::Deserialize,
12    Debug,
13    Clone,
14    PartialEq,
15    Eq,
16    bon::Builder,
17    jacquard_derive::IntoStatic
18)]
19#[serde(rename_all = "camelCase")]
20#[builder(start_fn = new)]
21pub struct CreateOAuthClient<'a> {
22    /// Human-readable name of the OAuth client
23    #[serde(borrow)]
24    #[builder(into)]
25    pub client_name: jacquard_common::CowStr<'a>,
26    /// URI of the client application
27    #[serde(skip_serializing_if = "std::option::Option::is_none")]
28    #[builder(into)]
29    #[serde(borrow)]
30    pub client_uri: Option<jacquard_common::types::string::Uri<'a>>,
31    /// OAuth grant types
32    #[serde(skip_serializing_if = "std::option::Option::is_none")]
33    #[builder(into)]
34    #[serde(borrow)]
35    pub grant_types: Option<Vec<jacquard_common::CowStr<'a>>>,
36    /// URI of the client logo
37    #[serde(skip_serializing_if = "std::option::Option::is_none")]
38    #[builder(into)]
39    #[serde(borrow)]
40    pub logo_uri: Option<jacquard_common::types::string::Uri<'a>>,
41    /// URI of the privacy policy
42    #[serde(skip_serializing_if = "std::option::Option::is_none")]
43    #[builder(into)]
44    #[serde(borrow)]
45    pub policy_uri: Option<jacquard_common::types::string::Uri<'a>>,
46    /// Allowed redirect URIs for OAuth flow (must use HTTP or HTTPS)
47    #[serde(borrow)]
48    pub redirect_uris: Vec<jacquard_common::types::string::Uri<'a>>,
49    /// OAuth response types
50    #[serde(skip_serializing_if = "std::option::Option::is_none")]
51    #[builder(into)]
52    #[serde(borrow)]
53    pub response_types: Option<Vec<jacquard_common::CowStr<'a>>>,
54    /// OAuth scope
55    #[serde(skip_serializing_if = "std::option::Option::is_none")]
56    #[builder(into)]
57    #[serde(borrow)]
58    pub scope: Option<jacquard_common::CowStr<'a>>,
59    /// AT-URI of the slice to register the OAuth client for
60    #[serde(borrow)]
61    #[builder(into)]
62    pub slice_uri: jacquard_common::CowStr<'a>,
63    /// URI of the terms of service
64    #[serde(skip_serializing_if = "std::option::Option::is_none")]
65    #[builder(into)]
66    #[serde(borrow)]
67    pub tos_uri: Option<jacquard_common::types::string::Uri<'a>>,
68    #[serde(flatten)]
69    #[serde(borrow)]
70    #[builder(default)]
71    pub extra_data: ::std::collections::BTreeMap<
72        ::jacquard_common::smol_str::SmolStr,
73        ::jacquard_common::types::value::Data<'a>,
74    >,
75}
76
77#[jacquard_derive::lexicon]
78#[derive(
79    serde::Serialize,
80    serde::Deserialize,
81    Debug,
82    Clone,
83    PartialEq,
84    Eq,
85    jacquard_derive::IntoStatic
86)]
87#[serde(rename_all = "camelCase")]
88pub struct CreateOAuthClientOutput<'a> {
89    #[serde(flatten)]
90    #[serde(borrow)]
91    pub value: crate::network_slices::slice::get_o_auth_clients::OauthClientDetails<'a>,
92}
93
94/// Response type for
95///network.slices.slice.createOAuthClient
96pub struct CreateOAuthClientResponse;
97impl jacquard_common::xrpc::XrpcResp for CreateOAuthClientResponse {
98    const NSID: &'static str = "network.slices.slice.createOAuthClient";
99    const ENCODING: &'static str = "application/json";
100    type Output<'de> = CreateOAuthClientOutput<'de>;
101    type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
102}
103
104impl<'a> jacquard_common::xrpc::XrpcRequest for CreateOAuthClient<'a> {
105    const NSID: &'static str = "network.slices.slice.createOAuthClient";
106    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
107        "application/json",
108    );
109    type Response = CreateOAuthClientResponse;
110}
111
112/// Endpoint type for
113///network.slices.slice.createOAuthClient
114pub struct CreateOAuthClientRequest;
115impl jacquard_common::xrpc::XrpcEndpoint for CreateOAuthClientRequest {
116    const PATH: &'static str = "/xrpc/network.slices.slice.createOAuthClient";
117    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
118        "application/json",
119    );
120    type Request<'de> = CreateOAuthClient<'de>;
121    type Response = CreateOAuthClientResponse;
122}