# 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.GooglePrivacyDlpV2TagResources do
  @moduledoc """
  If set, attaches the [tags] (https://cloud.google.com/resource-manager/docs/tags/tags-overview) provided to profiled resources. Tags support [access control](https://cloud.google.com/iam/docs/tags-access-control). You can conditionally grant or deny access to a resource based on whether the resource has a specific tag.

  ## Attributes

  *   `lowerDataRiskToLow` (*type:* `boolean()`, *default:* `nil`) - Whether applying a tag to a resource should lower the risk of the profile for that resource. For example, in conjunction with an [IAM deny policy](https://cloud.google.com/iam/docs/deny-overview), you can deny all principals a permission if a tag value is present, mitigating the risk of the resource. This also lowers the data risk of resources at the lower levels of the resource hierarchy. For example, reducing the data risk of a table data profile also reduces the data risk of the constituent column data profiles.
  *   `profileGenerationsToTag` (*type:* `list(String.t)`, *default:* `nil`) - The profile generations for which the tag should be attached to resources. If you attach a tag to only new profiles, then if the sensitivity score of a profile subsequently changes, its tag doesn't change. By default, this field includes only new profiles. To include both new and updated profiles for tagging, this field should explicitly include both `PROFILE_GENERATION_NEW` and `PROFILE_GENERATION_UPDATE`.
  *   `tagConditions` (*type:* `list(GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2TagCondition.t)`, *default:* `nil`) - The tags to associate with different conditions.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :lowerDataRiskToLow => boolean() | nil,
          :profileGenerationsToTag => list(String.t()) | nil,
          :tagConditions => list(GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2TagCondition.t()) | nil
        }

  field(:lowerDataRiskToLow)
  field(:profileGenerationsToTag, type: :list)
  field(:tagConditions, as: GoogleApi.DLP.V2.Model.GooglePrivacyDlpV2TagCondition, type: :list)
end

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

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