# 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.ResourceSettings.V1.Model.GoogleCloudResourcesettingsV1Value do
  @moduledoc """
  The data in a setting value.

  ## Attributes

  *   `booleanValue` (*type:* `boolean()`, *default:* `nil`) - Defines this value as being a boolean value.
  *   `durationValue` (*type:* `String.t`, *default:* `nil`) - Defines this value as being a Duration.
  *   `enumValue` (*type:* `GoogleApi.ResourceSettings.V1.Model.GoogleCloudResourcesettingsV1ValueEnumValue.t`, *default:* `nil`) - Defines this value as being a Enum.
  *   `stringMapValue` (*type:* `GoogleApi.ResourceSettings.V1.Model.GoogleCloudResourcesettingsV1ValueStringMap.t`, *default:* `nil`) - Defines this value as being a StringMap.
  *   `stringSetValue` (*type:* `GoogleApi.ResourceSettings.V1.Model.GoogleCloudResourcesettingsV1ValueStringSet.t`, *default:* `nil`) - Defines this value as being a StringSet.
  *   `stringValue` (*type:* `String.t`, *default:* `nil`) - Defines this value as being a string value.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :booleanValue => boolean() | nil,
          :durationValue => String.t() | nil,
          :enumValue =>
            GoogleApi.ResourceSettings.V1.Model.GoogleCloudResourcesettingsV1ValueEnumValue.t()
            | nil,
          :stringMapValue =>
            GoogleApi.ResourceSettings.V1.Model.GoogleCloudResourcesettingsV1ValueStringMap.t()
            | nil,
          :stringSetValue =>
            GoogleApi.ResourceSettings.V1.Model.GoogleCloudResourcesettingsV1ValueStringSet.t()
            | nil,
          :stringValue => String.t() | nil
        }

  field(:booleanValue)
  field(:durationValue)

  field(:enumValue,
    as: GoogleApi.ResourceSettings.V1.Model.GoogleCloudResourcesettingsV1ValueEnumValue
  )

  field(:stringMapValue,
    as: GoogleApi.ResourceSettings.V1.Model.GoogleCloudResourcesettingsV1ValueStringMap
  )

  field(:stringSetValue,
    as: GoogleApi.ResourceSettings.V1.Model.GoogleCloudResourcesettingsV1ValueStringSet
  )

  field(:stringValue)
end

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

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