# 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.BigQueryDataPolicy.V1.Model.DataPolicy do
  @moduledoc """
  Represents the label-policy binding.

  ## Attributes

  *   `dataMaskingPolicy` (*type:* `GoogleApi.BigQueryDataPolicy.V1.Model.DataMaskingPolicy.t`, *default:* `nil`) - The data masking policy that specifies the data masking rule to use.
  *   `dataPolicyId` (*type:* `String.t`, *default:* `nil`) - User-assigned (human readable) ID of the data policy that needs to be unique within a project. Used as {data_policy_id} in part of the resource name.
  *   `dataPolicyType` (*type:* `String.t`, *default:* `nil`) - Required. Data policy type. Type of data policy.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Resource name of this data policy, in the format of `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`.
  *   `policyTag` (*type:* `String.t`, *default:* `nil`) - Policy tag resource name, in the format of `projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :dataMaskingPolicy => GoogleApi.BigQueryDataPolicy.V1.Model.DataMaskingPolicy.t() | nil,
          :dataPolicyId => String.t() | nil,
          :dataPolicyType => String.t() | nil,
          :name => String.t() | nil,
          :policyTag => String.t() | nil
        }

  field(:dataMaskingPolicy, as: GoogleApi.BigQueryDataPolicy.V1.Model.DataMaskingPolicy)
  field(:dataPolicyId)
  field(:dataPolicyType)
  field(:name)
  field(:policyTag)
end

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

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