# 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.MetricMetadata do
  @moduledoc """
  Explains a metric.

  ## Attributes

  *   `apiName` (*type:* `String.t`, *default:* `nil`) - A metric name. Useable in [Metric](#Metric)'s `name`. For example, `eventCount`.
  *   `blockedReasons` (*type:* `list(String.t)`, *default:* `nil`) - If reasons are specified, your access is blocked to this metric for this property. API requests from you to this property for this metric will succeed; however, the report will contain only zeros for this metric. API requests with metric filters on blocked metrics will fail. If reasons are empty, you have access to this metric. To learn more, see [Access and data-restriction management](https://support.google.com/analytics/answer/10851388).
  *   `category` (*type:* `String.t`, *default:* `nil`) - The display name of the category that this metrics belongs to. Similar dimensions and metrics are categorized together.
  *   `customDefinition` (*type:* `boolean()`, *default:* `nil`) - True if the metric is a custom metric for this property.
  *   `deprecatedApiNames` (*type:* `list(String.t)`, *default:* `nil`) - Still usable but deprecated names for this metric. If populated, this metric is available by either `apiName` or one of `deprecatedApiNames` for a period of time. After the deprecation period, the metric will be available only by `apiName`.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Description of how this metric is used and calculated.
  *   `expression` (*type:* `String.t`, *default:* `nil`) - The mathematical expression for this derived metric. Can be used in [Metric](#Metric)'s `expression` field for equivalent reports. Most metrics are not expressions, and for non-expressions, this field is empty.
  *   `type` (*type:* `String.t`, *default:* `nil`) - The type of this metric.
  *   `uiName` (*type:* `String.t`, *default:* `nil`) - This metric's name within the Google Analytics user interface. For example, `Event count`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :apiName => String.t() | nil,
          :blockedReasons => list(String.t()) | nil,
          :category => String.t() | nil,
          :customDefinition => boolean() | nil,
          :deprecatedApiNames => list(String.t()) | nil,
          :description => String.t() | nil,
          :expression => String.t() | nil,
          :type => String.t() | nil,
          :uiName => String.t() | nil
        }

  field(:apiName)
  field(:blockedReasons, type: :list)
  field(:category)
  field(:customDefinition)
  field(:deprecatedApiNames, type: :list)
  field(:description)
  field(:expression)
  field(:type)
  field(:uiName)
end

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

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