# 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.Resource do
  @moduledoc """
  Information related to the Google Cloud resource that is associated with this finding.

  ## Attributes

  *   `awsMetadata` (*type:* `GoogleApi.SecurityCenter.V1.Model.AwsMetadata.t`, *default:* `nil`) - The AWS metadata associated with the finding.
  *   `azureMetadata` (*type:* `GoogleApi.SecurityCenter.V1.Model.AzureMetadata.t`, *default:* `nil`) - The Azure metadata associated with the finding.
  *   `cloudProvider` (*type:* `String.t`, *default:* `nil`) - Indicates which cloud provider the finding is from.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - The human readable name of the resource.
  *   `folders` (*type:* `list(GoogleApi.SecurityCenter.V1.Model.Folder.t)`, *default:* `nil`) - Contains a Folder message for each folder in the assets ancestry. The first folder is the deepest nested folder, and the last folder is the folder directly under the Organization.
  *   `location` (*type:* `String.t`, *default:* `nil`) - The region or location of the service (if applicable).
  *   `name` (*type:* `String.t`, *default:* `nil`) - The full resource name of the resource. See: https://cloud.google.com/apis/design/resource_names#full_resource_name
  *   `organization` (*type:* `String.t`, *default:* `nil`) - Indicates which organization / tenant the finding is for.
  *   `parentDisplayName` (*type:* `String.t`, *default:* `nil`) - The human readable name of resource's parent.
  *   `parentName` (*type:* `String.t`, *default:* `nil`) - The full resource name of resource's parent.
  *   `projectDisplayName` (*type:* `String.t`, *default:* `nil`) - The project ID that the resource belongs to.
  *   `projectName` (*type:* `String.t`, *default:* `nil`) - The full resource name of project that the resource belongs to.
  *   `resourcePath` (*type:* `GoogleApi.SecurityCenter.V1.Model.ResourcePath.t`, *default:* `nil`) - Provides the path to the resource within the resource hierarchy.
  *   `resourcePathString` (*type:* `String.t`, *default:* `nil`) - A string representation of the resource path. For Google Cloud, it has the format of `org/{organization_id}/folder/{folder_id}/folder/{folder_id}/project/{project_id}` where there can be any number of folders. For AWS, it has the format of `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}` where there can be any number of organizational units. For Azure, it has the format of `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}` where there can be any number of management groups.
  *   `service` (*type:* `String.t`, *default:* `nil`) - The service or resource provider associated with the resource.
  *   `type` (*type:* `String.t`, *default:* `nil`) - The full resource type of the resource.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :awsMetadata => GoogleApi.SecurityCenter.V1.Model.AwsMetadata.t() | nil,
          :azureMetadata => GoogleApi.SecurityCenter.V1.Model.AzureMetadata.t() | nil,
          :cloudProvider => String.t() | nil,
          :displayName => String.t() | nil,
          :folders => list(GoogleApi.SecurityCenter.V1.Model.Folder.t()) | nil,
          :location => String.t() | nil,
          :name => String.t() | nil,
          :organization => String.t() | nil,
          :parentDisplayName => String.t() | nil,
          :parentName => String.t() | nil,
          :projectDisplayName => String.t() | nil,
          :projectName => String.t() | nil,
          :resourcePath => GoogleApi.SecurityCenter.V1.Model.ResourcePath.t() | nil,
          :resourcePathString => String.t() | nil,
          :service => String.t() | nil,
          :type => String.t() | nil
        }

  field(:awsMetadata, as: GoogleApi.SecurityCenter.V1.Model.AwsMetadata)
  field(:azureMetadata, as: GoogleApi.SecurityCenter.V1.Model.AzureMetadata)
  field(:cloudProvider)
  field(:displayName)
  field(:folders, as: GoogleApi.SecurityCenter.V1.Model.Folder, type: :list)
  field(:location)
  field(:name)
  field(:organization)
  field(:parentDisplayName)
  field(:parentName)
  field(:projectDisplayName)
  field(:projectName)
  field(:resourcePath, as: GoogleApi.SecurityCenter.V1.Model.ResourcePath)
  field(:resourcePathString)
  field(:service)
  field(:type)
end

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

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