# 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.AlloyDB.V1.Model.SupportedDatabaseFlag do
  @moduledoc """
  SupportedDatabaseFlag gives general information about a database flag, like type and allowed values. This is a static value that is defined on the server side, and it cannot be modified by callers. To set the Database flags on a particular Instance, a caller should modify the Instance.database_flags field.

  ## Attributes

  *   `acceptsMultipleValues` (*type:* `boolean()`, *default:* `nil`) - Whether the database flag accepts multiple values. If true, a comma-separated list of stringified values may be specified.
  *   `flagName` (*type:* `String.t`, *default:* `nil`) - The name of the database flag, e.g. "max_allowed_packets". The is a possibly key for the Instance.database_flags map field.
  *   `integerRestrictions` (*type:* `GoogleApi.AlloyDB.V1.Model.IntegerRestrictions.t`, *default:* `nil`) - Restriction on INTEGER type value.
  *   `name` (*type:* `String.t`, *default:* `nil`) - The name of the flag resource, following Google Cloud conventions, e.g.: * projects/{project}/locations/{location}/flags/{flag} This field currently has no semantic meaning.
  *   `recommendedIntegerValue` (*type:* `String.t`, *default:* `nil`) - The recommended value for an INTEGER flag.
  *   `recommendedStringValue` (*type:* `String.t`, *default:* `nil`) - The recommended value for a STRING flag.
  *   `requiresDbRestart` (*type:* `boolean()`, *default:* `nil`) - Whether setting or updating this flag on an Instance requires a database restart. If a flag that requires database restart is set, the backend will automatically restart the database (making sure to satisfy any availability SLO's).
  *   `scope` (*type:* `String.t`, *default:* `nil`) - The scope of the flag.
  *   `stringRestrictions` (*type:* `GoogleApi.AlloyDB.V1.Model.StringRestrictions.t`, *default:* `nil`) - Restriction on STRING type value.
  *   `supportedDbVersions` (*type:* `list(String.t)`, *default:* `nil`) - Major database engine versions for which this flag is supported.
  *   `valueType` (*type:* `String.t`, *default:* `nil`) - 
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :acceptsMultipleValues => boolean() | nil,
          :flagName => String.t() | nil,
          :integerRestrictions => GoogleApi.AlloyDB.V1.Model.IntegerRestrictions.t() | nil,
          :name => String.t() | nil,
          :recommendedIntegerValue => String.t() | nil,
          :recommendedStringValue => String.t() | nil,
          :requiresDbRestart => boolean() | nil,
          :scope => String.t() | nil,
          :stringRestrictions => GoogleApi.AlloyDB.V1.Model.StringRestrictions.t() | nil,
          :supportedDbVersions => list(String.t()) | nil,
          :valueType => String.t() | nil
        }

  field(:acceptsMultipleValues)
  field(:flagName)
  field(:integerRestrictions, as: GoogleApi.AlloyDB.V1.Model.IntegerRestrictions)
  field(:name)
  field(:recommendedIntegerValue)
  field(:recommendedStringValue)
  field(:requiresDbRestart)
  field(:scope)
  field(:stringRestrictions, as: GoogleApi.AlloyDB.V1.Model.StringRestrictions)
  field(:supportedDbVersions, type: :list)
  field(:valueType)
end

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

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