rancher_client 1.0.4

Rancher API client for Rust using OpenAPI Generator and kube
Documentation
/*
 * 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};

/// IoCattleManagementv3ClusterRoleTemplateBinding : ClusterRoleTemplateBinding is the object representing membership of a subject in a cluster with permissions specified by a given role template.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct IoCattleManagementv3ClusterRoleTemplateBinding {
    /// 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>,
    /// ClusterName is the metadata.name of the cluster to which a subject is added. Must match the namespace. Immutable.
    #[serde(rename = "clusterName")]
    pub cluster_name: String,
    /// GroupName is the name of the group subject added to the cluster. Immutable.
    #[serde(rename = "groupName", skip_serializing_if = "Option::is_none")]
    pub group_name: Option<String>,
    /// GroupPrincipalName is the name of the group principal subject added to the cluster. Immutable.
    #[serde(rename = "groupPrincipalName", skip_serializing_if = "Option::is_none")]
    pub group_principal_name: Option<String>,
    /// 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>,
    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<kube::api::ObjectMeta>,
    /// RoleTemplateName is the name of the role template that defines permissions to perform actions on resources in the cluster. Immutable.
    #[serde(rename = "roleTemplateName")]
    pub role_template_name: String,
    /// UserName is the name of the user subject added to the cluster. Immutable.
    #[serde(rename = "userName", skip_serializing_if = "Option::is_none")]
    pub user_name: Option<String>,
    /// UserPrincipalName is the name of the user principal subject added to the cluster. Immutable.
    #[serde(rename = "userPrincipalName", skip_serializing_if = "Option::is_none")]
    pub user_principal_name: Option<String>,
}

impl IoCattleManagementv3ClusterRoleTemplateBinding {
    /// ClusterRoleTemplateBinding is the object representing membership of a subject in a cluster with permissions specified by a given role template.
    pub fn new(cluster_name: String, role_template_name: String) -> IoCattleManagementv3ClusterRoleTemplateBinding {
        IoCattleManagementv3ClusterRoleTemplateBinding {
            api_version: None,
            cluster_name,
            group_name: None,
            group_principal_name: None,
            kind: None,
            metadata: None,
            role_template_name,
            user_name: None,
            user_principal_name: None,
        }
    }
}