lib/google_api/memcache/v1beta2/model/google_cloud_saasaccelerator_management_providers_v1_slo_metadata.ex

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

  ## Attributes

  *   `nodes` (*type:* `list(GoogleApi.Memcache.V1beta2.Model.GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata.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.Memcache.V1beta2.Model.GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility.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.Memcache.V1beta2.Model.GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata.t()
            )
            | nil,
          :perSliEligibility =>
            GoogleApi.Memcache.V1beta2.Model.GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility.t()
            | nil,
          :tier => String.t() | nil
        }

  field(:nodes,
    as:
      GoogleApi.Memcache.V1beta2.Model.GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata,
    type: :list
  )

  field(:perSliEligibility,
    as:
      GoogleApi.Memcache.V1beta2.Model.GoogleCloudSaasacceleratorManagementProvidersV1PerSliSloEligibility
  )

  field(:tier)
end

defimpl Poison.Decoder,
  for: GoogleApi.Memcache.V1beta2.Model.GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata do
  def decode(value, options) do
    GoogleApi.Memcache.V1beta2.Model.GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.Memcache.V1beta2.Model.GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end