# 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.AnalyticsData.V1beta.Model.Comparison do
  @moduledoc """
  Defines an individual comparison. Most requests will include multiple comparisons so that the report compares between the comparisons.

  ## Attributes

  *   `comparison` (*type:* `String.t`, *default:* `nil`) - A saved comparison identified by the comparison's resource name. For example, 'comparisons/1234'.
  *   `dimensionFilter` (*type:* `GoogleApi.AnalyticsData.V1beta.Model.FilterExpression.t`, *default:* `nil`) - A basic comparison.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Each comparison produces separate rows in the response. In the response, this comparison is identified by this name. If name is unspecified, we will use the saved comparisons display name.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :comparison => String.t() | nil,
          :dimensionFilter => GoogleApi.AnalyticsData.V1beta.Model.FilterExpression.t() | nil,
          :name => String.t() | nil
        }

  field(:comparison)
  field(:dimensionFilter, as: GoogleApi.AnalyticsData.V1beta.Model.FilterExpression)
  field(:name)
end

defimpl Poison.Decoder, for: GoogleApi.AnalyticsData.V1beta.Model.Comparison do
  def decode(value, options) do
    GoogleApi.AnalyticsData.V1beta.Model.Comparison.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AnalyticsData.V1beta.Model.Comparison do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
