# 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.DLP.V2.Model.GooglePrivacyDlpV2DataProfilePubSubMessage do
  @moduledoc """
  Pub/Sub topic message for a DataProfileAction.PubSubNotification event. To receive a message of protocol buffer schema type, convert the message data to an object of this proto class.

  ## Attributes

  *   `event` (*type:* `String.t`, *default:* `nil`) - The event that caused the Pub/Sub message to be sent.
  *   `fileStoreProfile` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2FileStoreDataProfile.t`, *default:* `nil`) - If `DetailLevel` is `FILE_STORE_PROFILE` this will be fully populated. Otherwise, if `DetailLevel` is `RESOURCE_NAME`, then only `name` and `file_store_path` will be populated.
  *   `profile` (*type:* `GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2TableDataProfile.t`, *default:* `nil`) - If `DetailLevel` is `TABLE_PROFILE` this will be fully populated. Otherwise, if `DetailLevel` is `RESOURCE_NAME`, then only `name` and `full_resource` will be populated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :event => String.t() | nil,
          :fileStoreProfile =>
            GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2FileStoreDataProfile.t() | nil,
          :profile => GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2TableDataProfile.t() | nil
        }

  field(:event)
  field(:fileStoreProfile, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2FileStoreDataProfile)
  field(:profile, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2TableDataProfile)
end

defimpl Poison.Decoder, for: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DataProfilePubSubMessage do
  def decode(value, options) do
    GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DataProfilePubSubMessage.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2DataProfilePubSubMessage do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
