// 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

/// Request message for
/// [CertificateAuthorityService.CreateCertificate][google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificate].
///
/// [google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificate]: <doc:CertificateAuthorityService/createCertificate(request:)>
public struct CreateCertificateRequest: Codable, Equatable, GoogleCloudWkt._AnyPackable,
  Sendable
{
  /// Required. The resource name of the
  /// [CaPool][google.cloud.security.privateca.v1.CaPool] associated with the
  /// [Certificate][google.cloud.security.privateca.v1.Certificate], in the
  /// format `projects/*/locations/*/caPools/*`.
  ///
  /// [google.cloud.security.privateca.v1.CaPool]: <doc:CaPool>
  /// [google.cloud.security.privateca.v1.Certificate]: <doc:Certificate>
  public var parent: Swift.String = Swift.String()

  /// Optional. It must be unique within a location and match the regular
  /// expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a
  /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
  /// in the Enterprise
  /// [CertificateAuthority.tier][google.cloud.security.privateca.v1.CertificateAuthority.tier],
  /// but is optional and its value is ignored otherwise.
  ///
  /// [google.cloud.security.privateca.v1.CertificateAuthority]: <doc:CertificateAuthority>
  /// [google.cloud.security.privateca.v1.CertificateAuthority.tier]: <doc:CertificateAuthority/tier>
  public var certificateId: Swift.String = Swift.String()

  /// Required. A [Certificate][google.cloud.security.privateca.v1.Certificate]
  /// with initial field values.
  ///
  /// [google.cloud.security.privateca.v1.Certificate]: <doc:Certificate>
  public var certificate: Certificate? = nil

  /// Optional. An ID to identify requests. Specify a unique request ID so that
  /// if you must retry your request, the server will know to ignore the request
  /// if it has already been completed. The server will guarantee that for at
  /// least 60 minutes since the first request.
  ///
  /// For example, consider a situation where you make an initial request and the
  /// request times out. If you make the request again with the same request ID,
  /// the server can check if original operation with the same request ID was
  /// received, and if so, will ignore the second request. This prevents clients
  /// from accidentally creating duplicate commitments.
  ///
  /// The request ID must be a valid UUID with the exception that zero UUID is
  /// not supported (00000000-0000-0000-0000-000000000000).
  public var requestId: Swift.String = Swift.String()

  /// Optional. If this is true, no
  /// [Certificate][google.cloud.security.privateca.v1.Certificate] resource will
  /// be persisted regardless of the
  /// [CaPool][google.cloud.security.privateca.v1.CaPool]'s
  /// [tier][google.cloud.security.privateca.v1.CaPool.tier], and the returned
  /// [Certificate][google.cloud.security.privateca.v1.Certificate] will not
  /// contain the
  /// [pem_certificate][google.cloud.security.privateca.v1.Certificate.pem_certificate]
  /// field.
  ///
  /// [google.cloud.security.privateca.v1.CaPool]: <doc:CaPool>
  /// [google.cloud.security.privateca.v1.CaPool.tier]: <doc:CaPool/tier>
  /// [google.cloud.security.privateca.v1.Certificate]: <doc:Certificate>
  /// [google.cloud.security.privateca.v1.Certificate.pem_certificate]: <doc:Certificate/pemCertificate>
  public var validateOnly: Swift.Bool = Swift.Bool()

  /// Optional. The resource ID of the
  /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
  /// that should issue the certificate.  This optional field will ignore the
  /// load-balancing scheme of the Pool and directly issue the certificate from
  /// the CA with the specified ID, contained in the same
  /// [CaPool][google.cloud.security.privateca.v1.CaPool] referenced by `parent`.
  /// Per-CA quota rules apply. If left empty, a
  /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
  /// will be chosen from the [CaPool][google.cloud.security.privateca.v1.CaPool]
  /// by the service. For example, to issue a
  /// [Certificate][google.cloud.security.privateca.v1.Certificate] from a
  /// Certificate Authority with resource name
  /// "projects/my-project/locations/us-central1/caPools/my-pool/certificateAuthorities/my-ca",
  /// you can set the
  /// [parent][google.cloud.security.privateca.v1.CreateCertificateRequest.parent]
  /// to "projects/my-project/locations/us-central1/caPools/my-pool" and the
  /// [issuing_certificate_authority_id][google.cloud.security.privateca.v1.CreateCertificateRequest.issuing_certificate_authority_id]
  /// to "my-ca".
  ///
  /// [google.cloud.security.privateca.v1.CaPool]: <doc:CaPool>
  /// [google.cloud.security.privateca.v1.Certificate]: <doc:Certificate>
  /// [google.cloud.security.privateca.v1.CertificateAuthority]: <doc:CertificateAuthority>
  /// [google.cloud.security.privateca.v1.CreateCertificateRequest.issuing_certificate_authority_id]: <doc:CreateCertificateRequest/issuingCertificateAuthorityId>
  /// [google.cloud.security.privateca.v1.CreateCertificateRequest.parent]: <doc:CreateCertificateRequest/parent>
  public var issuingCertificateAuthorityId: Swift.String = Swift.String()

  /// Initialize a new instance of `CreateCertificateRequest`.
  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 = CreateCertificateRequest().with { $0.parent = ... }
  /// ```
  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.security.privateca.v1.CreateCertificateRequest"
  }
  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)
  }
}
