lib/google_api/cloud_asset/v1/model/google_cloud_asset_v1_access_control_list.ex

# 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.CloudAsset.V1.Model.GoogleCloudAssetV1AccessControlList do
  @moduledoc """
  An access control list, derived from the above IAM policy binding, which contains a set of resources and accesses. May include one item from each set to compose an access control entry. NOTICE that there could be multiple access control lists for one IAM policy binding. The access control lists are created based on resource and access combinations. For example, assume we have the following cases in one IAM policy binding: - Permission P1 and P2 apply to resource R1 and R2; - Permission P3 applies to resource R2 and R3; This will result in the following access control lists: - AccessControlList 1: [R1, R2], [P1, P2] - AccessControlList 2: [R2, R3], [P3]

  ## Attributes

  *   `accesses` (*type:* `list(GoogleApi.CloudAsset.V1.Model.GoogleCloudAssetV1Access.t)`, *default:* `nil`) - The accesses that match one of the following conditions: - The access_selector, if it is specified in request; - Otherwise, access specifiers reachable from the policy binding's role.
  *   `conditionEvaluation` (*type:* `GoogleApi.CloudAsset.V1.Model.ConditionEvaluation.t`, *default:* `nil`) - Condition evaluation for this AccessControlList, if there is a condition defined in the above IAM policy binding.
  *   `resourceEdges` (*type:* `list(GoogleApi.CloudAsset.V1.Model.GoogleCloudAssetV1Edge.t)`, *default:* `nil`) - Resource edges of the graph starting from the policy attached resource to any descendant resources. The Edge.source_node contains the full resource name of a parent resource and Edge.target_node contains the full resource name of a child resource. This field is present only if the output_resource_edges option is enabled in request.
  *   `resources` (*type:* `list(GoogleApi.CloudAsset.V1.Model.GoogleCloudAssetV1Resource.t)`, *default:* `nil`) - The resources that match one of the following conditions: - The resource_selector, if it is specified in request; - Otherwise, resources reachable from the policy attached resource.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :accesses => list(GoogleApi.CloudAsset.V1.Model.GoogleCloudAssetV1Access.t()) | nil,
          :conditionEvaluation => GoogleApi.CloudAsset.V1.Model.ConditionEvaluation.t() | nil,
          :resourceEdges => list(GoogleApi.CloudAsset.V1.Model.GoogleCloudAssetV1Edge.t()) | nil,
          :resources => list(GoogleApi.CloudAsset.V1.Model.GoogleCloudAssetV1Resource.t()) | nil
        }

  field(:accesses, as: GoogleApi.CloudAsset.V1.Model.GoogleCloudAssetV1Access, type: :list)
  field(:conditionEvaluation, as: GoogleApi.CloudAsset.V1.Model.ConditionEvaluation)
  field(:resourceEdges, as: GoogleApi.CloudAsset.V1.Model.GoogleCloudAssetV1Edge, type: :list)
  field(:resources, as: GoogleApi.CloudAsset.V1.Model.GoogleCloudAssetV1Resource, type: :list)
end

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

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