/// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (HostPlatform == null) { throw new ValidationException(ValidationRules.CannotBeNull, "HostPlatform"); } if (KubernetesClusterInfo == null) { throw new ValidationException(ValidationRules.CannotBeNull, "KubernetesClusterInfo"); } if (KubernetesRoleResources == null) { throw new ValidationException(ValidationRules.CannotBeNull, "KubernetesRoleResources"); } if (RoleStatus == null) { throw new ValidationException(ValidationRules.CannotBeNull, "RoleStatus"); } if (KubernetesClusterInfo != null) { KubernetesClusterInfo.Validate(); } if (KubernetesRoleResources != null) { KubernetesRoleResources.Validate(); } }
/// <summary> /// Initializes a new instance of the KubernetesRole class. /// </summary> /// <param name="hostPlatform">Host OS supported by the Kubernetes /// role. Possible values include: 'Windows', 'Linux'</param> /// <param name="kubernetesClusterInfo">Kubernetes cluster /// configuration</param> /// <param name="kubernetesRoleResources">Kubernetes role /// resources</param> /// <param name="roleStatus">Role status. Possible values include: /// 'Enabled', 'Disabled'</param> /// <param name="id">The path ID that uniquely identifies the /// object.</param> /// <param name="name">The object name.</param> /// <param name="type">The hierarchical type of the object.</param> /// <param name="systemData">Role configured on ASE resource</param> /// <param name="provisioningState">State of Kubernetes deployment. /// Possible values include: 'Invalid', 'Creating', 'Created', /// 'Updating', 'Reconfiguring', 'Failed', 'Deleting'</param> /// <param name="hostPlatformType">Platform where the runtime is /// hosted. Possible values include: 'KubernetesCluster', /// 'LinuxVM'</param> public KubernetesRole(string hostPlatform, KubernetesClusterInfo kubernetesClusterInfo, KubernetesRoleResources kubernetesRoleResources, string roleStatus, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string provisioningState = default(string), string hostPlatformType = default(string)) : base(id, name, type, systemData) { HostPlatform = hostPlatform; ProvisioningState = provisioningState; HostPlatformType = hostPlatformType; KubernetesClusterInfo = kubernetesClusterInfo; KubernetesRoleResources = kubernetesRoleResources; RoleStatus = roleStatus; CustomInit(); }