# 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.Integrations.V1.Model.EnterpriseCrmEventbusStats do
  @moduledoc """
  Stats for the requested dimensions: QPS, duration, and error/warning rate

  ## Attributes

  *   `dimensions` (*type:* `GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusStatsDimensions.t`, *default:* `nil`) - Dimensions that these stats have been aggregated on.
  *   `durationInSeconds` (*type:* `float()`, *default:* `nil`) - Average duration in seconds.
  *   `errorRate` (*type:* `float()`, *default:* `nil`) - Average error rate.
  *   `qps` (*type:* `float()`, *default:* `nil`) - Queries per second.
  *   `warningRate` (*type:* `float()`, *default:* `nil`) - Average warning rate.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :dimensions =>
            GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusStatsDimensions.t() | nil,
          :durationInSeconds => float() | nil,
          :errorRate => float() | nil,
          :qps => float() | nil,
          :warningRate => float() | nil
        }

  field(:dimensions, as: GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusStatsDimensions)
  field(:durationInSeconds)
  field(:errorRate)
  field(:qps)
  field(:warningRate)
end

defimpl Poison.Decoder, for: GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusStats do
  def decode(value, options) do
    GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusStats.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Integrations.V1.Model.EnterpriseCrmEventbusStats do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
