# frozen_string_literal: true

# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Auto-generated by gapic-generator-ruby. DO NOT EDIT!


module Google
  module Cloud
    module ManagedKafka
      module V1
        # An Apache Kafka cluster deployed in a location.
        # @!attribute [rw] gcp_config
        #   @return [::Google::Cloud::ManagedKafka::V1::GcpConfig]
        #     Required. Configuration properties for a Kafka cluster deployed to Google
        #     Cloud Platform.
        # @!attribute [rw] name
        #   @return [::String]
        #     Identifier. The name of the cluster. Structured like:
        #     projects/\\{project_number}/locations/\\{location}/clusters/\\{cluster_id}
        # @!attribute [r] create_time
        #   @return [::Google::Protobuf::Timestamp]
        #     Output only. The time when the cluster was created.
        # @!attribute [r] update_time
        #   @return [::Google::Protobuf::Timestamp]
        #     Output only. The time when the cluster was last updated.
        # @!attribute [rw] labels
        #   @return [::Google::Protobuf::Map{::String => ::String}]
        #     Optional. Labels as key value pairs.
        # @!attribute [rw] capacity_config
        #   @return [::Google::Cloud::ManagedKafka::V1::CapacityConfig]
        #     Required. Capacity configuration for the Kafka cluster.
        # @!attribute [rw] rebalance_config
        #   @return [::Google::Cloud::ManagedKafka::V1::RebalanceConfig]
        #     Optional. Rebalance configuration for the Kafka cluster.
        # @!attribute [r] state
        #   @return [::Google::Cloud::ManagedKafka::V1::Cluster::State]
        #     Output only. The current state of the cluster.
        class Cluster
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # @!attribute [rw] key
          #   @return [::String]
          # @!attribute [rw] value
          #   @return [::String]
          class LabelsEntry
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # The state of the cluster.
          module State
            # A state was not specified.
            STATE_UNSPECIFIED = 0

            # The cluster is being created.
            CREATING = 1

            # The cluster is active.
            ACTIVE = 2

            # The cluster is being deleted.
            DELETING = 3
          end
        end

        # A capacity configuration of a Kafka cluster.
        # @!attribute [rw] vcpu_count
        #   @return [::Integer]
        #     Required. The number of vCPUs to provision for the cluster. Minimum: 3.
        # @!attribute [rw] memory_bytes
        #   @return [::Integer]
        #     Required. The memory to provision for the cluster in bytes.
        #     The CPU:memory ratio (vCPU:GiB) must be between 1:1 and 1:8.
        #     Minimum: 3221225472 (3 GiB).
        class CapacityConfig
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # Defines rebalancing behavior of a Kafka cluster.
        # @!attribute [rw] mode
        #   @return [::Google::Cloud::ManagedKafka::V1::RebalanceConfig::Mode]
        #     Optional. The rebalance behavior for the cluster.
        #     When not specified, defaults to `NO_REBALANCE`.
        class RebalanceConfig
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # The partition rebalance mode for the cluster.
          module Mode
            # A mode was not specified. Do not use.
            MODE_UNSPECIFIED = 0

            # Do not rebalance automatically.
            NO_REBALANCE = 1

            # Automatically rebalance topic partitions among brokers when the
            # cluster is scaled up.
            AUTO_REBALANCE_ON_SCALE_UP = 2
          end
        end

        # The configuration of a Virtual Private Cloud (VPC) network that can access
        # the Kafka cluster.
        # @!attribute [rw] subnet
        #   @return [::String]
        #     Required. Name of the VPC subnet in which to create Private Service Connect
        #     (PSC) endpoints for the Kafka brokers and bootstrap address. Structured
        #     like: projects/\\{project}/regions/\\{region}/subnetworks/\\{subnet_id}
        #
        #     The subnet must be located in the same region as the Kafka cluster. The
        #     project may differ. Multiple subnets from the same parent network must not
        #     be specified.
        #
        #     The CIDR range of the subnet must be within the IPv4 address ranges for
        #     private networks, as specified in RFC 1918.
        class NetworkConfig
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # The configuration of access to the Kafka cluster.
        # @!attribute [rw] network_configs
        #   @return [::Array<::Google::Cloud::ManagedKafka::V1::NetworkConfig>]
        #     Required. Virtual Private Cloud (VPC) networks that must be granted direct
        #     access to the Kafka cluster. Minimum of 1 network is required. Maximum 10
        #     networks can be specified.
        class AccessConfig
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # Configuration properties for a Kafka cluster deployed to Google Cloud
        # Platform.
        # @!attribute [rw] access_config
        #   @return [::Google::Cloud::ManagedKafka::V1::AccessConfig]
        #     Required. Access configuration for the Kafka cluster.
        # @!attribute [rw] kms_key
        #   @return [::String]
        #     Optional. Immutable. The Cloud KMS Key name to use for encryption. The key
        #     must be located in the same region as the cluster and cannot be changed.
        #     Structured like:
        #     projects/\\{project}/locations/\\{location}/keyRings/\\{key_ring}/cryptoKeys/\\{crypto_key}.
        #     Note that the project component only accepts a project ID, and not a
        #     project number.
        class GcpConfig
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # A Kafka topic in a given cluster.
        # @!attribute [rw] name
        #   @return [::String]
        #     Identifier. The name of the topic. The `topic` segment is used when
        #     connecting directly to the cluster. Structured like:
        #     projects/\\{project}/locations/\\{location}/clusters/\\{cluster}/topics/\\{topic}
        # @!attribute [rw] partition_count
        #   @return [::Integer]
        #     Required. The number of partitions this topic has. The partition count can
        #     only be increased, not decreased. Please note that if partitions are
        #     increased for a topic that has a key, the partitioning logic or the
        #     ordering of the messages will be affected.
        # @!attribute [rw] replication_factor
        #   @return [::Integer]
        #     Required. Immutable. The number of replicas of each partition. A
        #     replication factor of 3 is recommended for high availability.
        # @!attribute [rw] configs
        #   @return [::Google::Protobuf::Map{::String => ::String}]
        #     Optional. Configurations for the topic that are overridden from the cluster
        #     defaults. The key of the map is a Kafka topic property name, for example:
        #     `cleanup.policy`, `compression.type`.
        class Topic
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # @!attribute [rw] key
          #   @return [::String]
          # @!attribute [rw] value
          #   @return [::String]
          class ConfigsEntry
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end

        # Metadata for a consumer group corresponding to a specific topic.
        # @!attribute [rw] partitions
        #   @return [::Google::Protobuf::Map{::Integer => ::Google::Cloud::ManagedKafka::V1::ConsumerPartitionMetadata}]
        #     Optional. Metadata for this consumer group and topic for all partition
        #     indexes it has metadata for.
        class ConsumerTopicMetadata
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # @!attribute [rw] key
          #   @return [::Integer]
          # @!attribute [rw] value
          #   @return [::Google::Cloud::ManagedKafka::V1::ConsumerPartitionMetadata]
          class PartitionsEntry
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end

        # Metadata for a consumer group corresponding to a specific partition.
        # @!attribute [rw] offset
        #   @return [::Integer]
        #     Required. The offset for this partition, or 0 if no offset has been
        #     committed.
        # @!attribute [rw] metadata
        #   @return [::String]
        #     Optional. The associated metadata for this partition, or empty if it does
        #     not exist.
        class ConsumerPartitionMetadata
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # A Kafka consumer group in a given cluster.
        # @!attribute [rw] name
        #   @return [::String]
        #     Identifier. The name of the consumer group. The `consumer_group` segment is
        #     used when connecting directly to the cluster. Structured like:
        #     projects/\\{project}/locations/\\{location}/clusters/\\{cluster}/consumerGroups/\\{consumer_group}
        # @!attribute [rw] topics
        #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::ManagedKafka::V1::ConsumerTopicMetadata}]
        #     Optional. Metadata for this consumer group for all topics it has metadata
        #     for. The key of the map is a topic name, structured like:
        #     projects/\\{project}/locations/\\{location}/clusters/\\{cluster}/topics/\\{topic}
        class ConsumerGroup
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # @!attribute [rw] key
          #   @return [::String]
          # @!attribute [rw] value
          #   @return [::Google::Cloud::ManagedKafka::V1::ConsumerTopicMetadata]
          class TopicsEntry
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end

        # Represents the metadata of the long-running operation.
        # @!attribute [r] create_time
        #   @return [::Google::Protobuf::Timestamp]
        #     Output only. The time the operation was created.
        # @!attribute [r] end_time
        #   @return [::Google::Protobuf::Timestamp]
        #     Output only. The time the operation finished running.
        # @!attribute [r] target
        #   @return [::String]
        #     Output only. Server-defined resource path for the target of the operation.
        # @!attribute [r] verb
        #   @return [::String]
        #     Output only. Name of the verb executed by the operation.
        # @!attribute [r] status_message
        #   @return [::String]
        #     Output only. Human-readable status of the operation, if any.
        # @!attribute [r] requested_cancellation
        #   @return [::Boolean]
        #     Output only. Identifies whether the user has requested cancellation
        #     of the operation. Operations that have been cancelled successfully
        #     have [Operation.error][] value with a
        #     {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to
        #     `Code.CANCELLED`.
        # @!attribute [r] api_version
        #   @return [::String]
        #     Output only. API version used to start the operation.
        class OperationMetadata
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end
      end
    end
  end
end