# Copyright 2019 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
#
#     http://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.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Integrations.V1.Model.GoogleCloudConnectorsV1ConnectorVersionInfraConfig do
  @moduledoc """
  This configuration provides infra configs like rate limit threshold which need to be configurable for every connector version

  ## Attributes

  *   `connectionRatelimitWindowSeconds` (*type:* `String.t`, *default:* `nil`) - Output only. The window used for ratelimiting runtime requests to connections.
  *   `deploymentModel` (*type:* `String.t`, *default:* `nil`) - Output only. Indicates whether connector is deployed on GKE/CloudRun
  *   `deploymentModelMigrationState` (*type:* `String.t`, *default:* `nil`) - Output only. Status of the deployment model migration.
  *   `hpaConfig` (*type:* `GoogleApi.Integrations.V1.Model.GoogleCloudConnectorsV1HPAConfig.t`, *default:* `nil`) - Output only. HPA autoscaling config.
  *   `internalclientRatelimitThreshold` (*type:* `String.t`, *default:* `nil`) - Output only. Max QPS supported for internal requests originating from Connd.
  *   `maxInstanceRequestConcurrency` (*type:* `integer()`, *default:* `nil`) - Output only. Max instance request concurrency.
  *   `ratelimitThreshold` (*type:* `String.t`, *default:* `nil`) - Output only. Max QPS supported by the connector version before throttling of requests.
  *   `resourceLimits` (*type:* `GoogleApi.Integrations.V1.Model.GoogleCloudConnectorsV1ResourceLimits.t`, *default:* `nil`) - Output only. System resource limits.
  *   `resourceRequests` (*type:* `GoogleApi.Integrations.V1.Model.GoogleCloudConnectorsV1ResourceRequests.t`, *default:* `nil`) - Output only. System resource requests.
  *   `sharedDeployment` (*type:* `String.t`, *default:* `nil`) - Output only. The name of shared connector deployment.
  *   `tlsMigrationState` (*type:* `String.t`, *default:* `nil`) - Output only. Status of the TLS migration.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :connectionRatelimitWindowSeconds => String.t() | nil,
          :deploymentModel => String.t() | nil,
          :deploymentModelMigrationState => String.t() | nil,
          :hpaConfig =>
            GoogleApi.Integrations.V1.Model.GoogleCloudConnectorsV1HPAConfig.t() | nil,
          :internalclientRatelimitThreshold => String.t() | nil,
          :maxInstanceRequestConcurrency => integer() | nil,
          :ratelimitThreshold => String.t() | nil,
          :resourceLimits =>
            GoogleApi.Integrations.V1.Model.GoogleCloudConnectorsV1ResourceLimits.t() | nil,
          :resourceRequests =>
            GoogleApi.Integrations.V1.Model.GoogleCloudConnectorsV1ResourceRequests.t() | nil,
          :sharedDeployment => String.t() | nil,
          :tlsMigrationState => String.t() | nil
        }

  field(:connectionRatelimitWindowSeconds)
  field(:deploymentModel)
  field(:deploymentModelMigrationState)
  field(:hpaConfig, as: GoogleApi.Integrations.V1.Model.GoogleCloudConnectorsV1HPAConfig)
  field(:internalclientRatelimitThreshold)
  field(:maxInstanceRequestConcurrency)
  field(:ratelimitThreshold)

  field(:resourceLimits, as: GoogleApi.Integrations.V1.Model.GoogleCloudConnectorsV1ResourceLimits)

  field(:resourceRequests,
    as: GoogleApi.Integrations.V1.Model.GoogleCloudConnectorsV1ResourceRequests
  )

  field(:sharedDeployment)
  field(:tlsMigrationState)
end

defimpl Poison.Decoder,
  for: GoogleApi.Integrations.V1.Model.GoogleCloudConnectorsV1ConnectorVersionInfraConfig do
  def decode(value, options) do
    GoogleApi.Integrations.V1.Model.GoogleCloudConnectorsV1ConnectorVersionInfraConfig.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.Integrations.V1.Model.GoogleCloudConnectorsV1ConnectorVersionInfraConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
