lib/ionoscloud/models/kubernetes_cluster_properties.rb in ionoscloud-5.1.1 vs lib/ionoscloud/models/kubernetes_cluster_properties.rb in ionoscloud-5.1.2

- old
+ new

@@ -13,43 +13,53 @@ require 'date' require 'time' module Ionoscloud class KubernetesClusterProperties + # A Kubernetes Cluster Name. Valid Kubernetes Cluster name must be 63 characters or less and must be empty or begin and end with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. attr_accessor :name + # The kubernetes version in which a cluster is running. This imposes restrictions on what kubernetes versions can be run in a cluster's nodepools. Additionally, not all kubernetes versions are viable upgrade targets for all prior versions. attr_accessor :k8s_version + attr_accessor :maintenance_window + # List of available versions for upgrading the cluster attr_accessor :available_upgrade_versions + # List of versions that may be used for node pools under this cluster attr_accessor :viable_node_pool_versions - # The indicator if the cluster is public or private. Be aware that setting it to false is currently in beta phase. - attr_accessor :public # Access to the K8s API server is restricted to these CIDRs. Cluster-internal traffic is not affected by this restriction. If no allowlist is specified, access is not restricted. If an IP without subnet mask is provided, the default value will be used: 32 for IPv4 and 128 for IPv6. attr_accessor :api_subnet_allow_list + # List of S3 bucket configured for K8s usage. For now it contains only one S3 bucket used to store K8s API audit logs attr_accessor :s3_buckets # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'name' => :'name', + :'k8s_version' => :'k8sVersion', + :'maintenance_window' => :'maintenanceWindow', + :'available_upgrade_versions' => :'availableUpgradeVersions', + :'viable_node_pool_versions' => :'viableNodePoolVersions', - :'public' => :'public', + :'api_subnet_allow_list' => :'apiSubnetAllowList', + :'s3_buckets' => :'s3Buckets' } end # Returns all the JSON keys this model knows about @@ -58,24 +68,37 @@ end # Attribute type mapping. def self.openapi_types { + :'name' => :'String', + :'k8s_version' => :'String', + :'maintenance_window' => :'KubernetesMaintenanceWindow', + :'available_upgrade_versions' => :'Array<String>', + :'viable_node_pool_versions' => :'Array<String>', - :'public' => :'Boolean', + :'api_subnet_allow_list' => :'Array<String>', + :'s3_buckets' => :'Array<S3Bucket>' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + + + + + + + ]) end # Initializes the object # @param [Hash] attributes Model attributes in the form of hash @@ -89,85 +112,98 @@ if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Ionoscloud::KubernetesClusterProperties`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } + if attributes.key?(:'name') self.name = attributes[:'name'] end + if attributes.key?(:'k8s_version') self.k8s_version = attributes[:'k8s_version'] end + if attributes.key?(:'maintenance_window') self.maintenance_window = attributes[:'maintenance_window'] end - if attributes.key?(:'available_upgrade_versions') - if (value = attributes[:'available_upgrade_versions']).is_a?(Array) - self.available_upgrade_versions = value - end - end - if attributes.key?(:'viable_node_pool_versions') - if (value = attributes[:'viable_node_pool_versions']).is_a?(Array) - self.viable_node_pool_versions = value - end + if attributes.key?(:'available_upgrade_versions') && (value = attributes[:'available_upgrade_versions']).is_a?(Array) + self.available_upgrade_versions = value end - if attributes.key?(:'public') - self.public = attributes[:'public'] - else - self.public = true + + if attributes.key?(:'viable_node_pool_versions') && (value = attributes[:'viable_node_pool_versions']).is_a?(Array) + self.viable_node_pool_versions = value end - if attributes.key?(:'api_subnet_allow_list') - if (value = attributes[:'api_subnet_allow_list']).is_a?(Array) - self.api_subnet_allow_list = value - end + + if attributes.key?(:'api_subnet_allow_list') && (value = attributes[:'api_subnet_allow_list']).is_a?(Array) + self.api_subnet_allow_list = value end - if attributes.key?(:'s3_buckets') - if (value = attributes[:'s3_buckets']).is_a?(Array) - self.s3_buckets = value - end + + if attributes.key?(:'s3_buckets') && (value = attributes[:'s3_buckets']).is_a?(Array) + self.s3_buckets = value end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end + + + + + + invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + return false if @name.nil? + + + + + + true end + + + + + + + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - name == o.name && - k8s_version == o.k8s_version && - maintenance_window == o.maintenance_window && - available_upgrade_versions == o.available_upgrade_versions && - viable_node_pool_versions == o.viable_node_pool_versions && - public == o.public && - api_subnet_allow_list == o.api_subnet_allow_list && - s3_buckets == o.s3_buckets + name == o.name && + k8s_version == o.k8s_version && + maintenance_window == o.maintenance_window && + available_upgrade_versions == o.available_upgrade_versions && + viable_node_pool_versions == o.viable_node_pool_versions && + api_subnet_allow_list == o.api_subnet_allow_list && + s3_buckets == o.s3_buckets end # @see the `==` method # @param [Object] Object to be compared def eql?(o) @@ -175,10 +211,10 @@ end # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [name, k8s_version, maintenance_window, available_upgrade_versions, viable_node_pool_versions, public, api_subnet_allow_list, s3_buckets].hash + [name, k8s_version, maintenance_window, available_upgrade_versions, viable_node_pool_versions, api_subnet_allow_list, s3_buckets].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself