# 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.GoogleCloudSecuritycenterV2IssueResource do
  @moduledoc """
  A resource associated with the an issue.

  ## Attributes

  *   `awsMetadata` (*type:* `GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueResourceAwsMetadata.t`, *default:* `nil`) - The AWS metadata of the resource associated with the issue. Only populated for AWS resources.
  *   `azureMetadata` (*type:* `GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueResourceAzureMetadata.t`, *default:* `nil`) - The Azure metadata of the resource associated with the issue. Only populated for Azure resources.
  *   `cloudProvider` (*type:* `String.t`, *default:* `nil`) - The cloud provider of the resource associated with the issue.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - The resource-type specific display name of the resource associated with the issue.
  *   `googleCloudMetadata` (*type:* `GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueResourceGoogleCloudMetadata.t`, *default:* `nil`) - The Google Cloud metadata of the resource associated with the issue. Only populated for Google Cloud resources.
  *   `name` (*type:* `String.t`, *default:* `nil`) - The full resource name of the resource associated with the issue.
  *   `type` (*type:* `String.t`, *default:* `nil`) - The type of the resource associated with the issue.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :awsMetadata =>
            GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueResourceAwsMetadata.t()
            | nil,
          :azureMetadata =>
            GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueResourceAzureMetadata.t()
            | nil,
          :cloudProvider => String.t() | nil,
          :displayName => String.t() | nil,
          :googleCloudMetadata =>
            GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueResourceGoogleCloudMetadata.t()
            | nil,
          :name => String.t() | nil,
          :type => String.t() | nil
        }

  field(:awsMetadata,
    as: GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueResourceAwsMetadata
  )

  field(:azureMetadata,
    as: GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueResourceAzureMetadata
  )

  field(:cloudProvider)
  field(:displayName)

  field(:googleCloudMetadata,
    as:
      GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueResourceGoogleCloudMetadata
  )

  field(:name)
  field(:type)
end

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

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