# 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.DLP.V2.Model.GooglePrivacyDlpV2Value do
  @moduledoc """
  Set of primitive values supported by the system. Note that for the purposes of inspection or transformation, the number of bytes considered to comprise a 'Value' is based on its representation as a UTF-8 encoded string. For example, if 'integer_value' is set to 123456789, the number of bytes would be counted as 9, even though an int64 only holds up to 8 bytes of data.

  ## Attributes

  *   `booleanValue` (*type:* `boolean()`, *default:* `nil`) - boolean
  *   `dateValue` (*type:* `GoogleApi.DLP.V2.Model.GoogleTypeDate.t`, *default:* `nil`) - date
  *   `dayOfWeekValue` (*type:* `String.t`, *default:* `nil`) - day of week
  *   `floatValue` (*type:* `float()`, *default:* `nil`) - float
  *   `integerValue` (*type:* `String.t`, *default:* `nil`) - integer
  *   `stringValue` (*type:* `String.t`, *default:* `nil`) - string
  *   `timeValue` (*type:* `GoogleApi.DLP.V2.Model.GoogleTypeTimeOfDay.t`, *default:* `nil`) - time of day
  *   `timestampValue` (*type:* `DateTime.t`, *default:* `nil`) - timestamp
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :booleanValue => boolean() | nil,
          :dateValue => GoogleApi.DLP.V2.Model.GoogleTypeDate.t() | nil,
          :dayOfWeekValue => String.t() | nil,
          :floatValue => float() | nil,
          :integerValue => String.t() | nil,
          :stringValue => String.t() | nil,
          :timeValue => GoogleApi.DLP.V2.Model.GoogleTypeTimeOfDay.t() | nil,
          :timestampValue => DateTime.t() | nil
        }

  field(:booleanValue)
  field(:dateValue, as: GoogleApi.DLP.V2.Model.GoogleTypeDate)
  field(:dayOfWeekValue)
  field(:floatValue)
  field(:integerValue)
  field(:stringValue)
  field(:timeValue, as: GoogleApi.DLP.V2.Model.GoogleTypeTimeOfDay)
  field(:timestampValue, as: DateTime)
end

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

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