# 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.Retail.V2.Model.GoogleCloudRetailV2CatalogAttributeFacetConfigIgnoredFacetValues do
  @moduledoc """
  Facet values to ignore on facets during the specified time range for the given SearchResponse.Facet.key attribute.

  ## Attributes

  *   `endTime` (*type:* `DateTime.t`, *default:* `nil`) - If start time is empty and end time is not empty, then ignore these facet values before end time.
  *   `startTime` (*type:* `DateTime.t`, *default:* `nil`) - Time range for the current list of facet values to ignore. If multiple time ranges are specified for an facet value for the current attribute, consider all of them. If both are empty, ignore always. If start time and end time are set, then start time must be before end time. If start time is not empty and end time is empty, then will ignore these facet values after the start time.
  *   `values` (*type:* `list(String.t)`, *default:* `nil`) - List of facet values to ignore for the following time range. The facet values are the same as the attribute values. There is a limit of 10 values per instance of IgnoredFacetValues. Each value can have at most 128 characters.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :endTime => DateTime.t() | nil,
          :startTime => DateTime.t() | nil,
          :values => list(String.t()) | nil
        }

  field(:endTime, as: DateTime)
  field(:startTime, as: DateTime)
  field(:values, type: :list)
end

defimpl Poison.Decoder,
  for: GoogleApi.Retail.V2.Model.GoogleCloudRetailV2CatalogAttributeFacetConfigIgnoredFacetValues do
  def decode(value, options) do
    GoogleApi.Retail.V2.Model.GoogleCloudRetailV2CatalogAttributeFacetConfigIgnoredFacetValues.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.Retail.V2.Model.GoogleCloudRetailV2CatalogAttributeFacetConfigIgnoredFacetValues do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
