# 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.NotificationConfig do
  @moduledoc """
  Cloud Security Command Center (Cloud SCC) notification configs. A notification config is a Cloud SCC resource that contains the configuration to send notifications for create/update events of findings, assets and etc.

  ## Attributes

  *   `description` (*type:* `String.t`, *default:* `nil`) - The description of the notification config (max of 1024 characters).
  *   `name` (*type:* `String.t`, *default:* `nil`) - The relative resource name of this notification config. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: "organizations/{organization_id}/notificationConfigs/notify_public_bucket", "folders/{folder_id}/notificationConfigs/notify_public_bucket", or "projects/{project_id}/notificationConfigs/notify_public_bucket".
  *   `pubsubTopic` (*type:* `String.t`, *default:* `nil`) - The Pub/Sub topic to send notifications to. Its format is "projects/[project_id]/topics/[topic]".
  *   `serviceAccount` (*type:* `String.t`, *default:* `nil`) - Output only. The service account that needs "pubsub.topics.publish" permission to publish to the Pub/Sub topic.
  *   `streamingConfig` (*type:* `GoogleApi.SecurityCenter.V1.Model.StreamingConfig.t`, *default:* `nil`) - The config for triggering streaming-based notifications.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :description => String.t() | nil,
          :name => String.t() | nil,
          :pubsubTopic => String.t() | nil,
          :serviceAccount => String.t() | nil,
          :streamingConfig => GoogleApi.SecurityCenter.V1.Model.StreamingConfig.t() | nil
        }

  field(:description)
  field(:name)
  field(:pubsubTopic)
  field(:serviceAccount)
  field(:streamingConfig, as: GoogleApi.SecurityCenter.V1.Model.StreamingConfig)
end

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

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