use super::responses::{
CreateCustomSecretIDResponse, GenerateNewSecretIDResponse, ListRolesResponse,
ListSecretIDResponse, ReadAppRoleResponse, ReadRoleIDResponse, ReadSecretIDResponse,
};
use rustify_derive::Endpoint;
#[derive(Builder, Debug, Endpoint)]
#[endpoint(path = "/auth/{self.mount}/login", method = "POST", builder = "true")]
#[builder(setter(into))]
pub struct LoginWithApproleRequest {
#[endpoint(skip)]
pub mount: String,
pub role_id: String,
pub secret_id: String,
}
#[derive(Builder, Debug, Default, Endpoint)]
#[endpoint(
path = "/auth/{self.mount}/role",
method = "LIST",
response = "ListRolesResponse",
builder = "true"
)]
#[builder(setter(into, strip_option), default)]
pub struct ListRolesRequest {
#[endpoint(skip)]
pub mount: String,
}
#[derive(Builder, Debug, Default, Endpoint)]
#[endpoint(
path = "/auth/{self.mount}/role/{self.role_name}",
method = "POST",
builder = "true"
)]
#[builder(setter(into, strip_option), default)]
pub struct SetAppRoleRequest {
#[endpoint(skip)]
pub mount: String,
#[endpoint(skip)]
pub role_name: String,
pub bind_secret_id: Option<bool>,
pub secret_id_bound_cidrs: Option<Vec<String>>,
pub secret_id_num_uses: Option<u64>,
pub secret_id_ttl: Option<String>,
pub enable_local_secret_ids: Option<bool>,
pub token_ttl: Option<String>,
pub token_max_ttl: Option<String>,
pub token_policies: Option<Vec<String>>,
pub token_bound_cidrs: Option<Vec<String>>,
pub token_explicit_max_ttl: Option<String>,
pub token_no_default_policy: Option<bool>,
pub token_num_uses: Option<u64>,
pub token_period: Option<String>,
pub token_type: Option<String>,
}
#[derive(Builder, Debug, Default, Endpoint)]
#[endpoint(
path = "/auth/{self.mount}/role/{self.role_name}",
response = "ReadAppRoleResponse",
builder = "true"
)]
#[builder(setter(into, strip_option), default)]
pub struct ReadAppRoleRequest {
#[endpoint(skip)]
pub mount: String,
#[endpoint(skip)]
pub role_name: String,
}
#[derive(Builder, Debug, Default, Endpoint)]
#[endpoint(
path = "/auth/{self.mount}/role/{self.role_name}",
method = "DELETE",
builder = "true"
)]
#[builder(setter(into, strip_option), default)]
pub struct DeleteAppRoleRequest {
#[endpoint(skip)]
pub mount: String,
#[endpoint(skip)]
pub role_name: String,
}
#[derive(Builder, Debug, Default, Endpoint)]
#[endpoint(
path = "/auth/{self.mount}/role/{self.role_name}/role-id",
response = "ReadRoleIDResponse",
builder = "true"
)]
#[builder(setter(into, strip_option), default)]
pub struct ReadRoleIDRequest {
#[endpoint(skip)]
pub mount: String,
#[endpoint(skip)]
pub role_name: String,
}
#[derive(Builder, Debug, Default, Endpoint)]
#[endpoint(
path = "/auth/{self.mount}/role/{self.role_name}/role-id",
method = "POST",
builder = "true"
)]
#[builder(setter(into, strip_option), default)]
pub struct UpdateRoleIDRequest {
#[endpoint(skip)]
pub mount: String,
#[endpoint(skip)]
pub role_name: String,
pub role_id: String,
}
#[derive(Builder, Debug, Default, Endpoint)]
#[endpoint(
path = "/auth/{self.mount}/role/{self.role_name}/secret-id",
method = "POST",
response = "GenerateNewSecretIDResponse",
builder = "true"
)]
#[builder(setter(into, strip_option), default)]
pub struct GenerateNewSecretIDRequest {
#[endpoint(skip)]
pub mount: String,
#[endpoint(skip)]
pub role_name: String,
pub metadata: Option<String>,
pub cidr_list: Option<Vec<String>>,
pub token_bound_cidrs: Option<Vec<String>>,
}
#[derive(Builder, Debug, Default, Endpoint)]
#[endpoint(
path = "/auth/{self.mount}/role/{self.role_name}/secret-id",
method = "LIST",
response = "ListSecretIDResponse",
builder = "true"
)]
#[builder(setter(into, strip_option), default)]
pub struct ListSecretIDRequest {
#[endpoint(skip)]
pub mount: String,
#[endpoint(skip)]
pub role_name: String,
}
#[derive(Builder, Debug, Default, Endpoint)]
#[endpoint(
path = "/auth/{self.mount}/role/{self.role_name}/secret-id/lookup",
method = "POST",
response = "ReadSecretIDResponse",
builder = "true"
)]
#[builder(setter(into, strip_option), default)]
pub struct ReadSecretIDRequest {
#[endpoint(skip)]
pub mount: String,
#[endpoint(skip)]
pub role_name: String,
pub secret_id: String,
}
#[derive(Builder, Debug, Default, Endpoint)]
#[endpoint(
path = "/auth/{self.mount}/role/{self.role_name}/secret-id/destroy",
method = "POST",
builder = "true"
)]
#[builder(setter(into, strip_option), default)]
pub struct DeleteSecretIDRequest {
#[endpoint(skip)]
pub mount: String,
#[endpoint(skip)]
pub role_name: String,
pub secret_id: String,
}
#[derive(Builder, Debug, Default, Endpoint)]
#[endpoint(
path = "/auth/{self.mount}/role/{self.role_name}/secret-id-accessor/lookup",
method = "POST",
response = "ReadSecretIDResponse",
builder = "true"
)]
#[builder(setter(into, strip_option), default)]
pub struct ReadSecretIDAccessorRequest {
#[endpoint(skip)]
pub mount: String,
#[endpoint(skip)]
pub role_name: String,
pub secret_id_accessor: String,
}
#[derive(Builder, Debug, Default, Endpoint)]
#[endpoint(
path = "/auth/{self.mount}/role/{self.role_name}/secret-id-accessor/destroy",
method = "POST",
builder = "true"
)]
#[builder(setter(into, strip_option), default)]
pub struct DeleteSecretIDAccessorRequest {
#[endpoint(skip)]
pub mount: String,
#[endpoint(skip)]
pub role_name: String,
pub secret_id_accessor: String,
}
#[derive(Builder, Debug, Default, Endpoint)]
#[endpoint(
path = "/auth/{self.mount}/role/{self.role_name}/custom-secret-id",
method = "POST",
response = "CreateCustomSecretIDResponse",
builder = "true"
)]
#[builder(setter(into, strip_option), default)]
pub struct CreateCustomSecretIDRequest {
#[endpoint(skip)]
pub mount: String,
#[endpoint(skip)]
pub role_name: String,
pub secret_id: String,
pub metadata: Option<String>,
pub cidr_list: Option<Vec<String>>,
pub token_bound_cidrs: Option<Vec<String>>,
}
#[derive(Builder, Debug, Default, Endpoint)]
#[endpoint(
path = "/auth/{self.mount}/tidy/secret-id",
method = "POST",
builder = "true"
)]
#[builder(setter(into, strip_option), default)]
pub struct TidyRequest {
#[endpoint(skip)]
pub mount: String,
}