# 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.Datastore.V1.Model.GoogleDatastoreAdminV1Index do
  @moduledoc """
  Datastore composite index definition.

  ## Attributes

  *   `ancestor` (*type:* `String.t`, *default:* `nil`) - Required. The index's ancestor mode. Must not be ANCESTOR_MODE_UNSPECIFIED.
  *   `indexId` (*type:* `String.t`, *default:* `nil`) - Output only. The resource ID of the index.
  *   `kind` (*type:* `String.t`, *default:* `nil`) - Required. The entity kind to which this index applies.
  *   `projectId` (*type:* `String.t`, *default:* `nil`) - Output only. Project ID.
  *   `properties` (*type:* `list(GoogleApi.Datastore.V1.Model.GoogleDatastoreAdminV1IndexedProperty.t)`, *default:* `nil`) - Required. An ordered sequence of property names and their index attributes. Requires: * A maximum of 100 properties.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The state of the index.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :ancestor => String.t() | nil,
          :indexId => String.t() | nil,
          :kind => String.t() | nil,
          :projectId => String.t() | nil,
          :properties =>
            list(GoogleApi.Datastore.V1.Model.GoogleDatastoreAdminV1IndexedProperty.t()) | nil,
          :state => String.t() | nil
        }

  field(:ancestor)
  field(:indexId)
  field(:kind)
  field(:projectId)

  field(:properties,
    as: GoogleApi.Datastore.V1.Model.GoogleDatastoreAdminV1IndexedProperty,
    type: :list
  )

  field(:state)
end

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

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