use crate::client::Client;
#[allow(unused_imports)]
use crate::enums::*;
use crate::error::Error;
#[allow(unused_imports)]
use crate::models::*;
use serde::Serialize;
pub struct AdminPortalApi<'a> {
pub(crate) client: &'a Client,
}
#[derive(Debug, Clone, Serialize)]
pub struct GenerateLinkParams {
#[serde(skip)]
pub body: GenerateLink,
}
impl GenerateLinkParams {
#[allow(deprecated)]
pub fn new(body: GenerateLink) -> Self {
Self { body }
}
}
impl<'a> AdminPortalApi<'a> {
pub async fn generate_link(
&self,
params: GenerateLinkParams,
) -> Result<PortalLinkResponse, Error> {
self.generate_link_with_options(params, None).await
}
pub async fn generate_link_with_options(
&self,
params: GenerateLinkParams,
options: Option<&crate::RequestOptions>,
) -> Result<PortalLinkResponse, Error> {
let path = "/portal/generate_link".to_string();
let method = http::Method::POST;
self.client
.request_with_body_opts(method, &path, ¶ms, Some(¶ms.body), options)
.await
}
}