# 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.RemoteBuildExecution.V2.Model.GoogleDevtoolsRemotebuildexecutionAdminV1alphaWorkerPool do
  @moduledoc """
  A worker pool resource in the Remote Build Execution API.

  ## Attributes

  *   `autoscale` (*type:* `GoogleApi.RemoteBuildExecution.V2.Model.GoogleDevtoolsRemotebuildexecutionAdminV1alphaAutoscale.t`, *default:* `nil`) - The autoscale policy to apply on a pool.
  *   `channel` (*type:* `String.t`, *default:* `nil`) - Channel specifies the release channel of the pool.
  *   `name` (*type:* `String.t`, *default:* `nil`) - WorkerPool resource name formatted as: `projects/[PROJECT_ID]/instances/[INSTANCE_ID]/workerpools/[POOL_ID]`. name should not be populated when creating a worker pool since it is provided in the `poolId` field.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. State of the worker pool.
  *   `workerConfig` (*type:* `GoogleApi.RemoteBuildExecution.V2.Model.GoogleDevtoolsRemotebuildexecutionAdminV1alphaWorkerConfig.t`, *default:* `nil`) - Specifies the properties, such as machine type and disk size, used for creating workers in a worker pool.
  *   `workerCount` (*type:* `String.t`, *default:* `nil`) - The desired number of workers in the worker pool. Must be a value between 0 and 15000.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :autoscale =>
            GoogleApi.RemoteBuildExecution.V2.Model.GoogleDevtoolsRemotebuildexecutionAdminV1alphaAutoscale.t()
            | nil,
          :channel => String.t() | nil,
          :name => String.t() | nil,
          :state => String.t() | nil,
          :workerConfig =>
            GoogleApi.RemoteBuildExecution.V2.Model.GoogleDevtoolsRemotebuildexecutionAdminV1alphaWorkerConfig.t()
            | nil,
          :workerCount => String.t() | nil
        }

  field(:autoscale,
    as:
      GoogleApi.RemoteBuildExecution.V2.Model.GoogleDevtoolsRemotebuildexecutionAdminV1alphaAutoscale
  )

  field(:channel)
  field(:name)
  field(:state)

  field(:workerConfig,
    as:
      GoogleApi.RemoteBuildExecution.V2.Model.GoogleDevtoolsRemotebuildexecutionAdminV1alphaWorkerConfig
  )

  field(:workerCount)
end

defimpl Poison.Decoder,
  for:
    GoogleApi.RemoteBuildExecution.V2.Model.GoogleDevtoolsRemotebuildexecutionAdminV1alphaWorkerPool do
  def decode(value, options) do
    GoogleApi.RemoteBuildExecution.V2.Model.GoogleDevtoolsRemotebuildexecutionAdminV1alphaWorkerPool.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.RemoteBuildExecution.V2.Model.GoogleDevtoolsRemotebuildexecutionAdminV1alphaWorkerPool do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
