// Code generated by sidekick. DO NOT EDIT.
//
// Copyright 2026 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
//
//     https://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.

import Foundation
import GoogleCloudWkt

/// ContainerImageSignature holds necessary metadata to verify a container image
/// signature.
public struct ContainerImageSignature: Codable, Equatable, GoogleCloudWkt._AnyPackable,
  Sendable
{
  /// Optional. The binary signature payload following the SimpleSigning format
  /// https://github.com/sigstore/cosign/blob/main/specs/SIGNATURE_SPEC.md#simple-signing.
  /// This payload includes the container image digest.
  public var payload: Foundation.Data = Foundation.Data()

  /// Optional. A signature over the payload.
  /// The container image digest is incorporated into the signature as follows:
  /// 1. Generate a SimpleSigning format payload that includes the container
  /// image digest.
  /// 2. Generate a signature over SHA256 digest of the payload.
  /// The signature generation process can be represented as follows:
  /// `Sign(sha256(SimpleSigningPayload(sha256(Image Manifest))))`
  public var signature: Foundation.Data = Foundation.Data()

  /// Optional. Reserved for future use.
  public var publicKey: Foundation.Data = Foundation.Data()

  /// Optional. Reserved for future use.
  public var sigAlg: SigningAlgorithm = SigningAlgorithm()

  /// Initialize a new instance of `ContainerImageSignature`.
  public init() {}

  /// Use `config` to return a new instance of this object, with some fields updated.
  ///
  /// Commonly used to initialize the value, for example:
  ///
  /// ```
  /// let value = ContainerImageSignature().with { $0.payload = ... }
  /// ```
  public func with(_ config: (inout Self) throws -> Swift.Void) rethrows -> Self {
    var copy = self
    try config(&copy)
    return copy
  }

  public static var _anyTypeUrl: Swift.String {
    return "type.googleapis.com/google.cloud.confidentialcomputing.v1.ContainerImageSignature"
  }
  public init(fromAny any: GoogleCloudWkt.`Any`) throws {
    self = try GoogleCloudWkt._slowAnyDeserialize(Self.self, from: any)
  }
  public func _pack() throws -> GoogleCloudWkt.Struct {
    return try GoogleCloudWkt._slowAnySerialize(message: self)
  }
}
