lib/google_api/compute/v1/model/customer_encryption_key.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.Compute.V1.Model.CustomerEncryptionKey do
  @moduledoc """


  ## Attributes

  *   `kmsKeyName` (*type:* `String.t`, *default:* `nil`) - The name of the encryption key that is stored in Google Cloud KMS.
  *   `kmsKeyServiceAccount` (*type:* `String.t`, *default:* `nil`) - The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
  *   `rawKey` (*type:* `String.t`, *default:* `nil`) - Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
  *   `rsaEncryptedKey` (*type:* `String.t`, *default:* `nil`) - Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. The key must meet the following requirements before you can provide it to Compute Engine: 1. The key is wrapped using a RSA public key certificate provided by Google. 2. After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at: https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem 
  *   `sha256` (*type:* `String.t`, *default:* `nil`) - [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :kmsKeyName => String.t() | nil,
          :kmsKeyServiceAccount => String.t() | nil,
          :rawKey => String.t() | nil,
          :rsaEncryptedKey => String.t() | nil,
          :sha256 => String.t() | nil
        }

  field(:kmsKeyName)
  field(:kmsKeyServiceAccount)
  field(:rawKey)
  field(:rsaEncryptedKey)
  field(:sha256)
end

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

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