# 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.Sheets.V4.Model.DeveloperMetadataLookup do
  @moduledoc """
  Selects DeveloperMetadata that matches all of the specified fields. For example, if only a metadata ID is specified this considers the DeveloperMetadata with that particular unique ID. If a metadata key is specified, this considers all developer metadata with that key. If a key, visibility, and location type are all specified, this considers all developer metadata with that key and visibility that are associated with a location of that type. In general, this selects all DeveloperMetadata that matches the intersection of all the specified fields; any field or combination of fields may be specified.

  ## Attributes

  *   `locationMatchingStrategy` (*type:* `String.t`, *default:* `nil`) - Determines how this lookup matches the location. If this field is specified as EXACT, only developer metadata associated on the exact location specified is matched. If this field is specified to INTERSECTING, developer metadata associated on intersecting locations is also matched. If left unspecified, this field assumes a default value of INTERSECTING. If this field is specified, a metadataLocation must also be specified.
  *   `locationType` (*type:* `String.t`, *default:* `nil`) - Limits the selected developer metadata to those entries which are associated with locations of the specified type. For example, when this field is specified as ROW this lookup only considers developer metadata associated on rows. If the field is left unspecified, all location types are considered. This field cannot be specified as SPREADSHEET when the locationMatchingStrategy is specified as INTERSECTING or when the metadataLocation is specified as a non-spreadsheet location: spreadsheet metadata cannot intersect any other developer metadata location. This field also must be left unspecified when the locationMatchingStrategy is specified as EXACT.
  *   `metadataId` (*type:* `integer()`, *default:* `nil`) - Limits the selected developer metadata to that which has a matching DeveloperMetadata.metadata_id.
  *   `metadataKey` (*type:* `String.t`, *default:* `nil`) - Limits the selected developer metadata to that which has a matching DeveloperMetadata.metadata_key.
  *   `metadataLocation` (*type:* `GoogleApi.Sheets.V4.Model.DeveloperMetadataLocation.t`, *default:* `nil`) - Limits the selected developer metadata to those entries associated with the specified location. This field either matches exact locations or all intersecting locations according the specified locationMatchingStrategy.
  *   `metadataValue` (*type:* `String.t`, *default:* `nil`) - Limits the selected developer metadata to that which has a matching DeveloperMetadata.metadata_value.
  *   `visibility` (*type:* `String.t`, *default:* `nil`) - Limits the selected developer metadata to that which has a matching DeveloperMetadata.visibility. If left unspecified, all developer metadata visible to the requesting project is considered.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :locationMatchingStrategy => String.t() | nil,
          :locationType => String.t() | nil,
          :metadataId => integer() | nil,
          :metadataKey => String.t() | nil,
          :metadataLocation => GoogleApi.Sheets.V4.Model.DeveloperMetadataLocation.t() | nil,
          :metadataValue => String.t() | nil,
          :visibility => String.t() | nil
        }

  field(:locationMatchingStrategy)
  field(:locationType)
  field(:metadataId)
  field(:metadataKey)
  field(:metadataLocation, as: GoogleApi.Sheets.V4.Model.DeveloperMetadataLocation)
  field(:metadataValue)
  field(:visibility)
end

defimpl Poison.Decoder, for: GoogleApi.Sheets.V4.Model.DeveloperMetadataLookup do
  def decode(value, options) do
    GoogleApi.Sheets.V4.Model.DeveloperMetadataLookup.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Sheets.V4.Model.DeveloperMetadataLookup do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
