# 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.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV1EffectiveSecurityHealthAnalyticsCustomModule do
  @moduledoc """
  An EffectiveSecurityHealthAnalyticsCustomModule is the representation of a Security Health Analytics custom module at a specified level of the resource hierarchy: organization, folder, or project. If a custom module is inherited from a parent organization or folder, the value of the `enablementState` property in EffectiveSecurityHealthAnalyticsCustomModule is set to the value that is effective in the parent, instead of `INHERITED`. For example, if the module is enabled in a parent organization or folder, the effective enablement_state for the module in all child folders or projects is also `enabled`. EffectiveSecurityHealthAnalyticsCustomModule is read-only.

  ## Attributes

  *   `cloudProvider` (*type:* `String.t`, *default:* `nil`) - The cloud provider of the custom module.
  *   `customConfig` (*type:* `GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV1CustomConfig.t`, *default:* `nil`) - Output only. The user-specified configuration for the module.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Output only. The display name for the custom module. The name must be between 1 and 128 characters, start with a lowercase letter, and contain alphanumeric characters or underscores only.
  *   `enablementState` (*type:* `String.t`, *default:* `nil`) - Output only. The effective state of enablement for the module at the given level of the hierarchy.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The resource name of the custom module. Its format is "organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}", or "folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}", or "projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}"
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cloudProvider => String.t() | nil,
          :customConfig =>
            GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV1CustomConfig.t() | nil,
          :displayName => String.t() | nil,
          :enablementState => String.t() | nil,
          :name => String.t() | nil
        }

  field(:cloudProvider)

  field(:customConfig,
    as: GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV1CustomConfig
  )

  field(:displayName)
  field(:enablementState)
  field(:name)
end

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

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