# 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.Integrations.V1.Model.GoogleCloudIntegrationsV1alphaCloudKmsConfig do
  @moduledoc """
  Configuration information for Client's Cloud KMS information

  ## Attributes

  *   `key` (*type:* `String.t`, *default:* `nil`) - Required. A Cloud KMS key is a named object containing one or more key versions, along with metadata for the key. A key exists on exactly one key ring tied to a specific location.
  *   `keyVersion` (*type:* `String.t`, *default:* `nil`) - Optional. Each version of a key contains key material used for encryption or signing. A key's version is represented by an integer, starting at 1. To decrypt data or verify a signature, you must use the same key version that was used to encrypt or sign the data.
  *   `kmsLocation` (*type:* `String.t`, *default:* `nil`) - Required. Location name of the key ring, e.g. "us-west1".
  *   `kmsProjectId` (*type:* `String.t`, *default:* `nil`) - Optional. The gcp project id of the project where the kms key stored. If empty, the kms key is stored at the same project as customer's project and ecrypted with CMEK, otherwise, the kms key is stored in the tenant project and encrypted with GMEK
  *   `kmsRing` (*type:* `String.t`, *default:* `nil`) - Required. A key ring organizes keys in a specific Google Cloud location and allows you to manage access control on groups of keys. A key ring's name does not need to be unique across a Google Cloud project, but must be unique within a given location.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :key => String.t() | nil,
          :keyVersion => String.t() | nil,
          :kmsLocation => String.t() | nil,
          :kmsProjectId => String.t() | nil,
          :kmsRing => String.t() | nil
        }

  field(:key)
  field(:keyVersion)
  field(:kmsLocation)
  field(:kmsProjectId)
  field(:kmsRing)
end

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

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