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

/// [Subject][google.cloud.security.privateca.v1.Subject] describes parts of a
/// distinguished name that, in turn, describes the subject of the certificate.
///
/// [google.cloud.security.privateca.v1.Subject]: <doc:Subject>
public struct Subject: Codable, Equatable, GoogleCloudWkt._AnyPackable,
  Sendable
{
  /// The "common name" of the subject.
  public var commonName: Swift.String = Swift.String()

  /// The country code of the subject.
  public var countryCode: Swift.String = Swift.String()

  /// The organization of the subject.
  public var organization: Swift.String = Swift.String()

  /// The organizational_unit of the subject.
  public var organizationalUnit: Swift.String = Swift.String()

  /// The locality or city of the subject.
  public var locality: Swift.String = Swift.String()

  /// The province, territory, or regional state of the subject.
  public var province: Swift.String = Swift.String()

  /// The street address of the subject.
  public var streetAddress: Swift.String = Swift.String()

  /// The postal code of the subject.
  public var postalCode: Swift.String = Swift.String()

  /// This field can be used in place of the named subject fields.
  public var rdnSequence: [RelativeDistinguishedName] = []

  /// Initialize a new instance of `Subject`.
  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 = Subject().with { $0.commonName = ... }
  /// ```
  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.Subject"
  }
  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)
  }
}
