# 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.Connectors.V2.Model.SloMetadata do
  @moduledoc """
  SloMetadata contains resources required for proper SLO classification of the instance.

  ## Attributes

  *   `nodes` (*type:* `list(GoogleApi.Connectors.V2.Model.NodeSloMetadata.t)`, *default:* `nil`) - Optional. List of nodes. Some producers need to use per-node metadata to calculate SLO. This field allows such producers to publish per-node SLO meta data, which will be consumed by SSA Eligibility Exporter and published in the form of per node metric to Monarch.
  *   `perSliEligibility` (*type:* `GoogleApi.Connectors.V2.Model.PerSliSloEligibility.t`, *default:* `nil`) - Optional. Multiple per-instance SLI eligibilities which apply for individual SLIs.
  *   `tier` (*type:* `String.t`, *default:* `nil`) - Name of the SLO tier the Instance belongs to. This name will be expected to match the tiers specified in the service SLO configuration. Field is mandatory and must not be empty.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :nodes => list(GoogleApi.Connectors.V2.Model.NodeSloMetadata.t()) | nil,
          :perSliEligibility => GoogleApi.Connectors.V2.Model.PerSliSloEligibility.t() | nil,
          :tier => String.t() | nil
        }

  field(:nodes, as: GoogleApi.Connectors.V2.Model.NodeSloMetadata, type: :list)
  field(:perSliEligibility, as: GoogleApi.Connectors.V2.Model.PerSliSloEligibility)
  field(:tier)
end

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

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