# 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.GoogleCloudRetailLoggingImportErrorContext do
  @moduledoc """
  The error payload that is populated on LRO import APIs, including "google.cloud.retail.v2.ProductService.ImportProducts" and "google.cloud.retail.v2.EventService.ImportUserEvents".

  ## Attributes

  *   `catalogItem` (*type:* `String.t`, *default:* `nil`) - The detailed content which caused the error on importing a catalog item.
  *   `gcsPath` (*type:* `String.t`, *default:* `nil`) - Cloud Storage file path of the import source. Can be set for batch operation error.
  *   `lineNumber` (*type:* `String.t`, *default:* `nil`) - Line number of the content in file. Should be empty for permission or batch operation error.
  *   `operationName` (*type:* `String.t`, *default:* `nil`) - The operation resource name of the LRO.
  *   `product` (*type:* `String.t`, *default:* `nil`) - The detailed content which caused the error on importing a product.
  *   `userEvent` (*type:* `String.t`, *default:* `nil`) - The detailed content which caused the error on importing a user event.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :catalogItem => String.t() | nil,
          :gcsPath => String.t() | nil,
          :lineNumber => String.t() | nil,
          :operationName => String.t() | nil,
          :product => String.t() | nil,
          :userEvent => String.t() | nil
        }

  field(:catalogItem)
  field(:gcsPath)
  field(:lineNumber)
  field(:operationName)
  field(:product)
  field(:userEvent)
end

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

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