# 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.GoogleCloudRetailV2RemoveLocalInventoriesRequest do
  @moduledoc """
  Request message for ProductService.RemoveLocalInventories method.

  ## Attributes

  *   `allowMissing` (*type:* `boolean()`, *default:* `nil`) - If set to true, and the Product is not found, the local inventory removal request will still be processed and retained for at most 1 day and processed once the Product is created. If set to false, a NOT_FOUND error is returned if the Product is not found.
  *   `placeIds` (*type:* `list(String.t)`, *default:* `nil`) - Required. A list of place IDs to have their inventory deleted. At most 3000 place IDs are allowed per request.
  *   `removeTime` (*type:* `DateTime.t`, *default:* `nil`) - The time when the inventory deletions are issued. Used to prevent out-of-order updates and deletions on local inventory fields. If not provided, the internal system time will be used.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :allowMissing => boolean() | nil,
          :placeIds => list(String.t()) | nil,
          :removeTime => DateTime.t() | nil
        }

  field(:allowMissing)
  field(:placeIds, type: :list)
  field(:removeTime, as: DateTime)
end

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

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