# 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.AlloyDB.V1.Model.ObservabilityInstanceConfig do
  @moduledoc """
  Observability Instance specific configuration.

  ## Attributes

  *   `enabled` (*type:* `boolean()`, *default:* `nil`) - Observability feature status for an instance. This flag is turned "off" by default.
  *   `maxQueryStringLength` (*type:* `integer()`, *default:* `nil`) - Query string length. The default value is 10k.
  *   `preserveComments` (*type:* `boolean()`, *default:* `nil`) - Preserve comments in query string for an instance. This flag is turned "off" by default.
  *   `queryPlansPerMinute` (*type:* `integer()`, *default:* `nil`) - Number of query execution plans captured by Insights per minute for all queries combined. The default value is 200. Any integer between 0 to 200 is considered valid.
  *   `recordApplicationTags` (*type:* `boolean()`, *default:* `nil`) - Record application tags for an instance. This flag is turned "off" by default.
  *   `trackActiveQueries` (*type:* `boolean()`, *default:* `nil`) - Track actively running queries on the instance. If not set, this flag is "off" by default.
  *   `trackWaitEventTypes` (*type:* `boolean()`, *default:* `nil`) - Output only. Track wait event types during query execution for an instance. This flag is turned "on" by default but tracking is enabled only after observability enabled flag is also turned on. This is read-only flag and only modifiable by internal API.
  *   `trackWaitEvents` (*type:* `boolean()`, *default:* `nil`) - Track wait events during query execution for an instance. This flag is turned "on" by default but tracking is enabled only after observability enabled flag is also turned on.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :enabled => boolean() | nil,
          :maxQueryStringLength => integer() | nil,
          :preserveComments => boolean() | nil,
          :queryPlansPerMinute => integer() | nil,
          :recordApplicationTags => boolean() | nil,
          :trackActiveQueries => boolean() | nil,
          :trackWaitEventTypes => boolean() | nil,
          :trackWaitEvents => boolean() | nil
        }

  field(:enabled)
  field(:maxQueryStringLength)
  field(:preserveComments)
  field(:queryPlansPerMinute)
  field(:recordApplicationTags)
  field(:trackActiveQueries)
  field(:trackWaitEventTypes)
  field(:trackWaitEvents)
end

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

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