# 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.GoogleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule do
  @moduledoc """
  Represents an instance of a Security Health Analytics custom module, including its full module name, display name, enablement state, and last updated time. You can create a custom module at the organization, folder, or project level. Custom modules that you create at the organization or folder level are inherited by the child folders and projects.

  ## Attributes

  *   `ancestorModule` (*type:* `String.t`, *default:* `nil`) - Output only. If empty, indicates that the custom module was created in the organization, folder, or project in which you are viewing the custom module. Otherwise, `ancestor_module` specifies the organization or folder from which the custom module is inherited.
  *   `cloudProvider` (*type:* `String.t`, *default:* `nil`) - The cloud provider of the custom module.
  *   `customConfig` (*type:* `GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV1CustomConfig.t`, *default:* `nil`) - The user specified custom configuration for the module.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - The display name of the Security Health Analytics custom module. This display name becomes the finding category for all findings that are returned by this custom module. The display 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`) - The enablement state of the custom module.
  *   `lastEditor` (*type:* `String.t`, *default:* `nil`) - Output only. The editor that last updated the custom module.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Immutable. The resource name of the custom module. Its format is "organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}", or "folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}", or "projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}" The id {customModule} is server-generated and is not user settable. It will be a numeric id containing 1-20 digits.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time at which the custom module was last updated.
  """

  use GoogleApi.Gax.ModelBase

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

  field(:ancestorModule)
  field(:cloudProvider)

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

  field(:displayName)
  field(:enablementState)
  field(:lastEditor)
  field(:name)
  field(:updateTime, as: DateTime)
end

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

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