# 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.AlloyDB.V1.Model.StorageDatabasecenterPartnerapiV1mainDatabaseResourceId do
  @moduledoc """
  DatabaseResourceId will serve as primary key for any resource ingestion event.

  ## Attributes

  *   `provider` (*type:* `String.t`, *default:* `nil`) - Required. Cloud provider name. Ex: GCP/AWS/Azure/OnPrem/SelfManaged
  *   `providerDescription` (*type:* `String.t`, *default:* `nil`) - Optional. Needs to be used only when the provider is PROVIDER_OTHER.
  *   `resourceType` (*type:* `String.t`, *default:* `nil`) - Required. The type of resource this ID is identifying. Ex redis.googleapis.com/Instance, redis.googleapis.com/Cluster, alloydb.googleapis.com/Cluster, alloydb.googleapis.com/Instance, spanner.googleapis.com/Instance, spanner.googleapis.com/Database, firestore.googleapis.com/Database, sqladmin.googleapis.com/Instance, bigtableadmin.googleapis.com/Cluster, bigtableadmin.googleapis.com/Instance REQUIRED Please refer go/condor-common-datamodel
  *   `uniqueId` (*type:* `String.t`, *default:* `nil`) - Required. A service-local token that distinguishes this resource from other resources within the same service.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :provider => String.t() | nil,
          :providerDescription => String.t() | nil,
          :resourceType => String.t() | nil,
          :uniqueId => String.t() | nil
        }

  field(:provider)
  field(:providerDescription)
  field(:resourceType)
  field(:uniqueId)
end

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

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