# 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.AnalyticsReporting.V4.Model.SegmentMetricFilter do
  @moduledoc """
  Metric filter to be used in a segment filter clause.

  ## Attributes

  *   `comparisonValue` (*type:* `String.t`, *default:* `nil`) - The value to compare against. If the operator is `BETWEEN`, this value is treated as minimum comparison value.
  *   `maxComparisonValue` (*type:* `String.t`, *default:* `nil`) - Max comparison value is only used for `BETWEEN` operator.
  *   `metricName` (*type:* `String.t`, *default:* `nil`) - The metric that will be filtered on. A `metricFilter` must contain a metric name.
  *   `operator` (*type:* `String.t`, *default:* `nil`) - Specifies is the operation to perform to compare the metric. The default is `EQUAL`.
  *   `scope` (*type:* `String.t`, *default:* `nil`) - Scope for a metric defines the level at which that metric is defined. The specified metric scope must be equal to or greater than its primary scope as defined in the data model. The primary scope is defined by if the segment is selecting users or sessions.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :comparisonValue => String.t() | nil,
          :maxComparisonValue => String.t() | nil,
          :metricName => String.t() | nil,
          :operator => String.t() | nil,
          :scope => String.t() | nil
        }

  field(:comparisonValue)
  field(:maxComparisonValue)
  field(:metricName)
  field(:operator)
  field(:scope)
end

defimpl Poison.Decoder, for: GoogleApi.AnalyticsReporting.V4.Model.SegmentMetricFilter do
  def decode(value, options) do
    GoogleApi.AnalyticsReporting.V4.Model.SegmentMetricFilter.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AnalyticsReporting.V4.Model.SegmentMetricFilter do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
