# 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.GoogleCloudRetailV2CollectUserEventRequest do
  @moduledoc """
  Request message for CollectUserEvent method.

  ## Attributes

  *   `ets` (*type:* `String.t`, *default:* `nil`) - The event timestamp in milliseconds. This prevents browser caching of otherwise identical get requests. The name is abbreviated to reduce the payload bytes.
  *   `prebuiltRule` (*type:* `String.t`, *default:* `nil`) - The prebuilt rule name that can convert a specific type of raw_json. For example: "ga4_bq" rule for the GA4 user event schema.
  *   `rawJson` (*type:* `String.t`, *default:* `nil`) - An arbitrary serialized JSON string that contains necessary information that can comprise a user event. When this field is specified, the user_event field will be ignored. Note: line-delimited JSON is not supported, a single JSON only.
  *   `uri` (*type:* `String.t`, *default:* `nil`) - The URL including cgi-parameters but excluding the hash fragment with a length limit of 5,000 characters. This is often more useful than the referer URL, because many browsers only send the domain for 3rd party requests.
  *   `userEvent` (*type:* `String.t`, *default:* `nil`) - Required. URL encoded UserEvent proto with a length limit of 2,000,000 characters.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :ets => String.t() | nil,
          :prebuiltRule => String.t() | nil,
          :rawJson => String.t() | nil,
          :uri => String.t() | nil,
          :userEvent => String.t() | nil
        }

  field(:ets)
  field(:prebuiltRule)
  field(:rawJson)
  field(:uri)
  field(:userEvent)
end

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

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