Current section

Files

Jump to
google_api_fitness lib google_api fitness v1 model value.ex
Raw

lib/google_api/fitness/v1/model/value.ex

# Copyright 2017 Google Inc.
#
# 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 class is auto generated by the swagger code generator program.
# https://github.com/swagger-api/swagger-codegen.git
# Do not edit the class manually.
defmodule GoogleApi.Fitness.V1.Model.Value do
@moduledoc """
Holder object for the value of a single field in a data point. A field value has a particular format and is only ever set to one of an integer or a floating point value. LINT.IfChange
## Attributes
- fpVal (Float): Floating point value. When this is set, other values must not be set. Defaults to: `null`.
- intVal (Integer): Integer value. When this is set, other values must not be set. Defaults to: `null`.
- mapVal (List[ValueMapValEntry]): Map value. The valid key space and units for the corresponding value of each entry should be documented as part of the data type definition. Keys should be kept small whenever possible. Data streams with large keys and high data frequency may be down sampled. Defaults to: `null`.
- stringVal (String): String value. When this is set, other values must not be set. Strings should be kept small whenever possible. Data streams with large string values and high data frequency may be down sampled. Defaults to: `null`.
"""
defstruct [
:"fpVal",
:"intVal",
:"mapVal",
:"stringVal"
]
end
defimpl Poison.Decoder, for: GoogleApi.Fitness.V1.Model.Value do
import GoogleApi.Fitness.V1.Deserializer
def decode(value, options) do
value
|> deserialize(:"mapVal", :list, GoogleApi.Fitness.V1.Model.ValueMapValEntry, options)
end
end
defimpl Poison.Encoder, for: GoogleApi.Fitness.V1.Model.Value do
def encode(value, options) do
GoogleApi.Fitness.V1.Deserializer.serialize_non_nil(value, options)
end
end