# 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.Fitness.V1.Model.DataTypeField do
  @moduledoc """
  In case of multi-dimensional data (such as an accelerometer with x, y, and z axes) each field represents one dimension. Each data type field has a unique name which identifies it. The field also defines the format of the data (int, float, etc.). This message is only instantiated in code and not used for wire comms or stored in any way.

  ## Attributes

  *   `format` (*type:* `String.t`, *default:* `nil`) - The different supported formats for each field in a data type.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Defines the name and format of data. Unlike data type names, field names are not namespaced, and only need to be unique within the data type.
  *   `optional` (*type:* `boolean()`, *default:* `nil`) - 
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :format => String.t() | nil,
          :name => String.t() | nil,
          :optional => boolean() | nil
        }

  field(:format)
  field(:name)
  field(:optional)
end

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

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