# 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.GKEHub.V1.Model.MonitoringConfig do
  @moduledoc """
  MonitoringConfig informs Fleet-based applications/services/UIs how the metrics for the underlying cluster is reported to cloud monitoring services. It can be set from empty to non-empty, but can't be mutated directly to prevent accidentally breaking the constinousty of metrics.

  ## Attributes

  *   `cluster` (*type:* `String.t`, *default:* `nil`) - Optional. Cluster name used to report metrics. For Anthos on VMWare/Baremetal/MultiCloud clusters, it would be in format {cluster_type}/{cluster_name}, e.g., "awsClusters/cluster_1".
  *   `clusterHash` (*type:* `String.t`, *default:* `nil`) - Optional. For GKE and Multicloud clusters, this is the UUID of the cluster resource. For VMWare and Baremetal clusters, this is the kube-system UID.
  *   `kubernetesMetricsPrefix` (*type:* `String.t`, *default:* `nil`) - Optional. Kubernetes system metrics, if available, are written to this prefix. This defaults to kubernetes.io for GKE, and kubernetes.io/anthos for Anthos eventually. Noted: Anthos MultiCloud will have kubernetes.io prefix today but will migration to be under kubernetes.io/anthos.
  *   `location` (*type:* `String.t`, *default:* `nil`) - Optional. Location used to report Metrics
  *   `projectId` (*type:* `String.t`, *default:* `nil`) - Optional. Project used to report Metrics
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cluster => String.t() | nil,
          :clusterHash => String.t() | nil,
          :kubernetesMetricsPrefix => String.t() | nil,
          :location => String.t() | nil,
          :projectId => String.t() | nil
        }

  field(:cluster)
  field(:clusterHash)
  field(:kubernetesMetricsPrefix)
  field(:location)
  field(:projectId)
end

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

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