1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*
* Kubernetes
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: v1.27.5+k3s1
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// IoCattleManagementv3RoleTemplate : RoleTemplate holds configuration for a template that is used to create kubernetes Roles and ClusterRoles (in the rbac.authorization.k8s.io group) for a cluster or project.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct IoCattleManagementv3RoleTemplate {
/// Administrative if false, and context is set to cluster this RoleTemplate will not grant access to \"CatalogTemplates\" and \"CatalogTemplateVersions\" for any project in the cluster. Default is false.
#[serde(rename = "administrative", skip_serializing_if = "Option::is_none")]
pub administrative: Option<bool>,
/// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
#[serde(rename = "apiVersion", skip_serializing_if = "Option::is_none")]
pub api_version: Option<String>,
/// Builtin if true specifies that this RoleTemplate was created by Rancher and is immutable. Default to false.
#[serde(rename = "builtin", skip_serializing_if = "Option::is_none")]
pub builtin: Option<bool>,
/// ClusterCreatorDefault if true, a binding with this RoleTemplate will be created for a users when they create a new cluster. ClusterCreatorDefault is only evaluated if the context of the RoleTemplate is set to cluster. Default to false.
#[serde(rename = "clusterCreatorDefault", skip_serializing_if = "Option::is_none")]
pub cluster_creator_default: Option<bool>,
/// Context describes if the roleTemplate applies to clusters or projects. Valid values are \"project\", \"cluster\" or \"\".
#[serde(rename = "context", skip_serializing_if = "Option::is_none")]
pub context: Option<Context>,
/// Description holds text that describes the resource.
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
/// DisplayName is the human-readable name displayed in the UI for this resource.
#[serde(rename = "displayName", skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
/// External if true specifies that rules for this RoleTemplate should be gathered from a ClusterRole with the matching name. If set to true the Rules on the template will not be evaluated. External's value is only evaluated if the RoleTemplate's context is set to \"cluster\" Default to false.
#[serde(rename = "external", skip_serializing_if = "Option::is_none")]
pub external: Option<bool>,
/// Hidden if true informs the Rancher UI not to display this RoleTemplate. Default to false.
#[serde(rename = "hidden", skip_serializing_if = "Option::is_none")]
pub hidden: Option<bool>,
/// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
#[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
pub kind: Option<String>,
/// Locked if true, new bindings will not be able to use this RoleTemplate. Default to false.
#[serde(rename = "locked", skip_serializing_if = "Option::is_none")]
pub locked: Option<bool>,
#[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
pub metadata: Option<kube::api::ObjectMeta>,
/// ProjectCreatorDefault if true, a binding with this RoleTemplate will be created for a user when they create a new project. ProjectCreatorDefault is only evaluated if the context of the RoleTemplate is set to project. Default to false.
#[serde(rename = "projectCreatorDefault", skip_serializing_if = "Option::is_none")]
pub project_creator_default: Option<bool>,
/// RoleTemplateNames list of RoleTemplate names that this RoleTemplate will inherit. This RoleTemplate will grant all rules defined in an inherited RoleTemplate. Inherited RoleTemplates must already exist.
#[serde(rename = "roleTemplateNames", skip_serializing_if = "Option::is_none")]
pub role_template_names: Option<Vec<String>>,
/// Rules hold all the PolicyRules for this RoleTemplate.
#[serde(rename = "rules", skip_serializing_if = "Option::is_none")]
pub rules: Option<Vec<models::IoCattleManagementv3GlobalRoleRulesInner>>,
}
impl IoCattleManagementv3RoleTemplate {
/// RoleTemplate holds configuration for a template that is used to create kubernetes Roles and ClusterRoles (in the rbac.authorization.k8s.io group) for a cluster or project.
pub fn new() -> IoCattleManagementv3RoleTemplate {
IoCattleManagementv3RoleTemplate {
administrative: None,
api_version: None,
builtin: None,
cluster_creator_default: None,
context: None,
description: None,
display_name: None,
external: None,
hidden: None,
kind: None,
locked: None,
metadata: None,
project_creator_default: None,
role_template_names: None,
rules: None,
}
}
}
/// Context describes if the roleTemplate applies to clusters or projects. Valid values are \"project\", \"cluster\" or \"\".
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Context {
#[serde(rename = "project")]
Project,
#[serde(rename = "cluster")]
Cluster,
#[serde(rename = "")]
Empty,
}
impl Default for Context {
fn default() -> Context {
Self::Project
}
}