# 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.Area120Tables.V1alpha1.Model.ColumnDescription do
  @moduledoc """
  Details on a column in the table.

  ## Attributes

  *   `dataType` (*type:* `String.t`, *default:* `nil`) - Data type of the column Supported types are auto_id, boolean, boolean_list, creator, create_timestamp, date, dropdown, location, integer, integer_list, number, number_list, person, person_list, tags, check_list, text, text_list, update_timestamp, updater, relationship, file_attachment_list. These types directly map to the column types supported on Tables website.
  *   `dateDetails` (*type:* `GoogleApi.Area120Tables.V1alpha1.Model.DateDetails.t`, *default:* `nil`) - Optional. Additional details about a date column.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Internal id for a column.
  *   `labels` (*type:* `list(GoogleApi.Area120Tables.V1alpha1.Model.LabeledItem.t)`, *default:* `nil`) - Optional. Range of labeled values for the column. Some columns like tags and drop-downs limit the values to a set of possible values. We return the range of values in such cases to help clients implement better user data validation.
  *   `lookupDetails` (*type:* `GoogleApi.Area120Tables.V1alpha1.Model.LookupDetails.t`, *default:* `nil`) - Optional. Indicates that this is a lookup column whose value is derived from the relationship column specified in the details. Lookup columns can not be updated directly. To change the value you must update the associated relationship column.
  *   `multipleValuesDisallowed` (*type:* `boolean()`, *default:* `nil`) - Optional. Indicates whether or not multiple values are allowed for array types where such a restriction is possible.
  *   `name` (*type:* `String.t`, *default:* `nil`) - column name
  *   `readonly` (*type:* `boolean()`, *default:* `nil`) - Optional. Indicates that values for the column cannot be set by the user.
  *   `relationshipDetails` (*type:* `GoogleApi.Area120Tables.V1alpha1.Model.RelationshipDetails.t`, *default:* `nil`) - Optional. Additional details about a relationship column. Specified when data_type is relationship.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :dataType => String.t() | nil,
          :dateDetails => GoogleApi.Area120Tables.V1alpha1.Model.DateDetails.t() | nil,
          :id => String.t() | nil,
          :labels => list(GoogleApi.Area120Tables.V1alpha1.Model.LabeledItem.t()) | nil,
          :lookupDetails => GoogleApi.Area120Tables.V1alpha1.Model.LookupDetails.t() | nil,
          :multipleValuesDisallowed => boolean() | nil,
          :name => String.t() | nil,
          :readonly => boolean() | nil,
          :relationshipDetails =>
            GoogleApi.Area120Tables.V1alpha1.Model.RelationshipDetails.t() | nil
        }

  field(:dataType)
  field(:dateDetails, as: GoogleApi.Area120Tables.V1alpha1.Model.DateDetails)
  field(:id)
  field(:labels, as: GoogleApi.Area120Tables.V1alpha1.Model.LabeledItem, type: :list)
  field(:lookupDetails, as: GoogleApi.Area120Tables.V1alpha1.Model.LookupDetails)
  field(:multipleValuesDisallowed)
  field(:name)
  field(:readonly)
  field(:relationshipDetails, as: GoogleApi.Area120Tables.V1alpha1.Model.RelationshipDetails)
end

defimpl Poison.Decoder, for: GoogleApi.Area120Tables.V1alpha1.Model.ColumnDescription do
  def decode(value, options) do
    GoogleApi.Area120Tables.V1alpha1.Model.ColumnDescription.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Area120Tables.V1alpha1.Model.ColumnDescription do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
