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};

/// IoCattleManagementv3GlobalRoleBinding : GlobalRoleBinding binds a given subject user or group to a GlobalRole.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct IoCattleManagementv3GlobalRoleBinding {
    /// 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>,
    /// GlobalRoleName is the name of the Global Role that the subject will be bound to. Immutable.
    #[serde(rename = "globalRoleName")]
    pub global_role_name: String,
    /// GroupPrincipalName is the name of the group principal subject to be bound. 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>,
    /// UserName is the name of the user subject to be bound. Immutable.
    #[serde(rename = "userName", skip_serializing_if = "Option::is_none")]
    pub user_name: Option<String>,
}

impl IoCattleManagementv3GlobalRoleBinding {
    /// GlobalRoleBinding binds a given subject user or group to a GlobalRole.
    pub fn new(global_role_name: String) -> IoCattleManagementv3GlobalRoleBinding {
        IoCattleManagementv3GlobalRoleBinding {
            api_version: None,
            global_role_name,
            group_principal_name: None,
            kind: None,
            metadata: None,
            user_name: None,
        }
    }
}