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

#if Projects
  import Foundation
  import GoogleCloudWkt

  /// Represents a Project resource.
  ///
  /// A project is used to organize resources in a Google Cloud Platform
  /// environment. For more information, read about the
  /// Resource Hierarchy.
  public struct Project: Codable, Equatable, GoogleCloudWkt._AnyPackable,
    Sendable
  {
    /// Output only. [Output Only] The Cloud Armor tier for this project. It can be one of the
    /// following values: CA_STANDARD,CA_ENTERPRISE_PAYGO.
    ///
    /// If this field is not specified, it is assumed to beCA_STANDARD.
    public var cloudArmorTier: Project.CloudArmorTier? = nil

    /// Metadata key/value pairs available to all instances contained in this
    /// project. See Custom
    /// metadata for more information.
    public var commonInstanceMetadata: Metadata? = nil

    /// [Output Only] Creation timestamp inRFC3339
    /// text format.
    public var creationTimestamp: Swift.String? = nil

    /// This signifies the default network tier used for configuring resources of
    /// the project and can only take the following values:PREMIUM, STANDARD. Initially the default network
    /// tier is PREMIUM.
    public var defaultNetworkTier: Project.DefaultNetworkTier? = nil

    /// [Output Only] Default service account used by VMs running in this project.
    public var defaultServiceAccount: Swift.String? = nil

    /// An optional textual description of the resource.
    public var description: Swift.String? = nil

    /// An optional list of restricted features enabled for use on this project.
    public var enabledFeatures: [Swift.String] = []

    /// [Output Only] The unique identifier for the resource. This identifier is
    /// defined by the server. This is *not* the project ID, and is
    /// just a unique ID used by Compute Engine to identify resources.
    public var id: Swift.UInt64? = nil

    /// Output only. [Output Only] Type of the resource. Always compute#project for
    /// projects.
    public var kind: Swift.String? = nil

    /// The project ID. For example: my-example-project. Use the
    /// project ID to make requests to Compute Engine.
    public var name: Swift.String? = nil

    /// [Output Only] Quotas assigned to this project.
    public var quotas: [Quota] = []

    /// [Output Only] Server-defined URL for the resource.
    public var selfLink: Swift.String? = nil

    /// An optional naming prefix for daily usage reports and the Google Cloud
    /// Storage bucket where they are stored.
    public var usageExportLocation: UsageExportLocation? = nil

    /// Output only. [Output Only] Default internal DNS setting used by VMs running in
    /// this project.
    public var vmDnsSetting: Project.VmDnsSetting? = nil

    /// [Output Only] The role this project has in a shared VPC configuration.
    /// Currently, only projects with the host role, which is specified by the
    /// value HOST, are differentiated.
    public var xpnProjectStatus: Project.XpnProjectStatus? = nil

    /// Initialize a new instance of `Project`.
    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 = Project().with { $0.cloudArmorTier = ... }
    /// ```
    public func with(_ config: (inout Self) throws -> Swift.Void) rethrows -> Self {
      var copy = self
      try config(&copy)
      return copy
    }

    /// The enumerated type for the [cloudArmorTier][google.cloud.compute.v1.Project.cloudArmorTier] field.
    ///
    /// [google.cloud.compute.v1.Project.cloudArmorTier]: <doc:Project/CloudArmorTier>
    public enum CloudArmorTier: Codable, Equatable, Sendable {
      /// Enterprise tier protection billed annually.
      case caEnterpriseAnnual
      /// Enterprise tier protection billed monthly.
      case caEnterprisePaygo
      /// Standard protection.
      case caStandard
      /// Encodes an unknown integer value.
      ///
      /// The most common cause for an unknown values is for the service to send
      /// a value unknown to the library. We recommend you update your library to
      /// the latest version.
      case unknownIntValue(Int)
      /// Encodes an unknown string value.
      ///
      /// The most common cause for an unknown values is for the service to send
      /// a value unknown to the library. We recommend you update your library to
      /// the latest version.
      case unknownStringValue(String)

      public init() {
        self = .caEnterpriseAnnual
      }

      /// Returns the integer value associated with the enumeration.
      ///
      /// If the enumeration was initialized with an unknown string value, this returns `nil`.
      public var intValue: Int? {
        switch self {
        case .caEnterpriseAnnual: return 0
        case .caEnterprisePaygo: return 1
        case .caStandard: return 2
        case .unknownIntValue(let v): return v
        case .unknownStringValue: return nil
        }
      }

      /// Returns the string value (or name) associated with the enumeration.
      ///
      /// If the enumeration was initialized with an unknown integer value, this returns `nil`.
      public var stringValue: Swift.String? {
        switch self {
        case .caEnterpriseAnnual: return "CA_ENTERPRISE_ANNUAL"
        case .caEnterprisePaygo: return "CA_ENTERPRISE_PAYGO"
        case .caStandard: return "CA_STANDARD"
        case .unknownIntValue: return nil
        case .unknownStringValue(let v): return v
        }
      }

      /// Initialize from a string value.
      ///
      /// If the value is unknown, this initializes to [`unknownStringValue`](doc:CloudArmorTier/unknownStringValue(_:)).
      public init(stringValue: Swift.String) {
        switch stringValue {
        case "CA_ENTERPRISE_ANNUAL": self = .caEnterpriseAnnual
        case "CA_ENTERPRISE_PAYGO": self = .caEnterprisePaygo
        case "CA_STANDARD": self = .caStandard
        default: self = .unknownStringValue(stringValue)
        }
      }

      /// Initialize from an integer value.
      ///
      /// If the value is unknown, this initializes to [`unknownIntValue`](doc:CloudArmorTier/unknownIntValue(_:)).
      public init(intValue: Int) {
        switch intValue {
        case 0: self = .caEnterpriseAnnual
        case 1: self = .caEnterprisePaygo
        case 2: self = .caStandard
        default: self = .unknownIntValue(intValue)
        }
      }

      public init(from decoder: Decoder) throws {
        let container = try decoder.singleValueContainer()
        if let v = try? container.decode(Int.self) {
          self.init(intValue: v)
          return
        }
        if let s = try? container.decode(String.self) {
          if let v = Int(s) {
            self.init(intValue: v)
          } else {
            self.init(stringValue: s)
          }
          return
        }
        throw DecodingError.dataCorruptedError(
          in: container, debugDescription: "Expected enum value, must be integer or string.")
      }

      public func encode(to encoder: Encoder) throws {
        var container = encoder.singleValueContainer()
        switch self {
        case .caEnterpriseAnnual: return try container.encode(0)
        case .caEnterprisePaygo: return try container.encode(1)
        case .caStandard: return try container.encode(2)
        case .unknownIntValue(let v): return try container.encode(v)
        case .unknownStringValue(let v): return try container.encode(v)
        }
      }
    }

    /// The enumerated type for the [defaultNetworkTier][google.cloud.compute.v1.Project.defaultNetworkTier] field.
    ///
    /// [google.cloud.compute.v1.Project.defaultNetworkTier]: <doc:Project/DefaultNetworkTier>
    public enum DefaultNetworkTier: Codable, Equatable, Sendable {
      /// Public internet quality with fixed bandwidth.
      case fixedStandard
      /// High quality, Google-grade network tier, support for all networking
      /// products.
      case premium
      /// Public internet quality, only limited support for other networking
      /// products.
      case standard
      /// (Output only) Temporary tier for FIXED_STANDARD when fixed standard tier
      /// is expired or not configured.
      case standardOverridesFixedStandard
      /// Encodes an unknown integer value.
      ///
      /// The most common cause for an unknown values is for the service to send
      /// a value unknown to the library. We recommend you update your library to
      /// the latest version.
      case unknownIntValue(Int)
      /// Encodes an unknown string value.
      ///
      /// The most common cause for an unknown values is for the service to send
      /// a value unknown to the library. We recommend you update your library to
      /// the latest version.
      case unknownStringValue(String)

      public init() {
        self = .fixedStandard
      }

      /// Returns the integer value associated with the enumeration.
      ///
      /// If the enumeration was initialized with an unknown string value, this returns `nil`.
      public var intValue: Int? {
        switch self {
        case .fixedStandard: return 0
        case .premium: return 1
        case .standard: return 2
        case .standardOverridesFixedStandard: return 3
        case .unknownIntValue(let v): return v
        case .unknownStringValue: return nil
        }
      }

      /// Returns the string value (or name) associated with the enumeration.
      ///
      /// If the enumeration was initialized with an unknown integer value, this returns `nil`.
      public var stringValue: Swift.String? {
        switch self {
        case .fixedStandard: return "FIXED_STANDARD"
        case .premium: return "PREMIUM"
        case .standard: return "STANDARD"
        case .standardOverridesFixedStandard: return "STANDARD_OVERRIDES_FIXED_STANDARD"
        case .unknownIntValue: return nil
        case .unknownStringValue(let v): return v
        }
      }

      /// Initialize from a string value.
      ///
      /// If the value is unknown, this initializes to [`unknownStringValue`](doc:DefaultNetworkTier/unknownStringValue(_:)).
      public init(stringValue: Swift.String) {
        switch stringValue {
        case "FIXED_STANDARD": self = .fixedStandard
        case "PREMIUM": self = .premium
        case "STANDARD": self = .standard
        case "STANDARD_OVERRIDES_FIXED_STANDARD": self = .standardOverridesFixedStandard
        default: self = .unknownStringValue(stringValue)
        }
      }

      /// Initialize from an integer value.
      ///
      /// If the value is unknown, this initializes to [`unknownIntValue`](doc:DefaultNetworkTier/unknownIntValue(_:)).
      public init(intValue: Int) {
        switch intValue {
        case 0: self = .fixedStandard
        case 1: self = .premium
        case 2: self = .standard
        case 3: self = .standardOverridesFixedStandard
        default: self = .unknownIntValue(intValue)
        }
      }

      public init(from decoder: Decoder) throws {
        let container = try decoder.singleValueContainer()
        if let v = try? container.decode(Int.self) {
          self.init(intValue: v)
          return
        }
        if let s = try? container.decode(String.self) {
          if let v = Int(s) {
            self.init(intValue: v)
          } else {
            self.init(stringValue: s)
          }
          return
        }
        throw DecodingError.dataCorruptedError(
          in: container, debugDescription: "Expected enum value, must be integer or string.")
      }

      public func encode(to encoder: Encoder) throws {
        var container = encoder.singleValueContainer()
        switch self {
        case .fixedStandard: return try container.encode(0)
        case .premium: return try container.encode(1)
        case .standard: return try container.encode(2)
        case .standardOverridesFixedStandard: return try container.encode(3)
        case .unknownIntValue(let v): return try container.encode(v)
        case .unknownStringValue(let v): return try container.encode(v)
        }
      }
    }

    /// The enumerated type for the [vmDnsSetting][google.cloud.compute.v1.Project.vmDnsSetting] field.
    ///
    /// [google.cloud.compute.v1.Project.vmDnsSetting]: <doc:Project/VmDnsSetting>
    public enum VmDnsSetting: Codable, Equatable, Sendable {
      case globalDefault
      case unspecifiedVmDnsSetting
      case zonalDefault
      case zonalOnly
      /// Encodes an unknown integer value.
      ///
      /// The most common cause for an unknown values is for the service to send
      /// a value unknown to the library. We recommend you update your library to
      /// the latest version.
      case unknownIntValue(Int)
      /// Encodes an unknown string value.
      ///
      /// The most common cause for an unknown values is for the service to send
      /// a value unknown to the library. We recommend you update your library to
      /// the latest version.
      case unknownStringValue(String)

      public init() {
        self = .globalDefault
      }

      /// Returns the integer value associated with the enumeration.
      ///
      /// If the enumeration was initialized with an unknown string value, this returns `nil`.
      public var intValue: Int? {
        switch self {
        case .globalDefault: return 0
        case .unspecifiedVmDnsSetting: return 1
        case .zonalDefault: return 2
        case .zonalOnly: return 3
        case .unknownIntValue(let v): return v
        case .unknownStringValue: return nil
        }
      }

      /// Returns the string value (or name) associated with the enumeration.
      ///
      /// If the enumeration was initialized with an unknown integer value, this returns `nil`.
      public var stringValue: Swift.String? {
        switch self {
        case .globalDefault: return "GLOBAL_DEFAULT"
        case .unspecifiedVmDnsSetting: return "UNSPECIFIED_VM_DNS_SETTING"
        case .zonalDefault: return "ZONAL_DEFAULT"
        case .zonalOnly: return "ZONAL_ONLY"
        case .unknownIntValue: return nil
        case .unknownStringValue(let v): return v
        }
      }

      /// Initialize from a string value.
      ///
      /// If the value is unknown, this initializes to [`unknownStringValue`](doc:VmDnsSetting/unknownStringValue(_:)).
      public init(stringValue: Swift.String) {
        switch stringValue {
        case "GLOBAL_DEFAULT": self = .globalDefault
        case "UNSPECIFIED_VM_DNS_SETTING": self = .unspecifiedVmDnsSetting
        case "ZONAL_DEFAULT": self = .zonalDefault
        case "ZONAL_ONLY": self = .zonalOnly
        default: self = .unknownStringValue(stringValue)
        }
      }

      /// Initialize from an integer value.
      ///
      /// If the value is unknown, this initializes to [`unknownIntValue`](doc:VmDnsSetting/unknownIntValue(_:)).
      public init(intValue: Int) {
        switch intValue {
        case 0: self = .globalDefault
        case 1: self = .unspecifiedVmDnsSetting
        case 2: self = .zonalDefault
        case 3: self = .zonalOnly
        default: self = .unknownIntValue(intValue)
        }
      }

      public init(from decoder: Decoder) throws {
        let container = try decoder.singleValueContainer()
        if let v = try? container.decode(Int.self) {
          self.init(intValue: v)
          return
        }
        if let s = try? container.decode(String.self) {
          if let v = Int(s) {
            self.init(intValue: v)
          } else {
            self.init(stringValue: s)
          }
          return
        }
        throw DecodingError.dataCorruptedError(
          in: container, debugDescription: "Expected enum value, must be integer or string.")
      }

      public func encode(to encoder: Encoder) throws {
        var container = encoder.singleValueContainer()
        switch self {
        case .globalDefault: return try container.encode(0)
        case .unspecifiedVmDnsSetting: return try container.encode(1)
        case .zonalDefault: return try container.encode(2)
        case .zonalOnly: return try container.encode(3)
        case .unknownIntValue(let v): return try container.encode(v)
        case .unknownStringValue(let v): return try container.encode(v)
        }
      }
    }

    /// The enumerated type for the [xpnProjectStatus][google.cloud.compute.v1.Project.xpnProjectStatus] field.
    ///
    /// [google.cloud.compute.v1.Project.xpnProjectStatus]: <doc:Project/XpnProjectStatus>
    public enum XpnProjectStatus: Codable, Equatable, Sendable {
      case host
      case unspecifiedXpnProjectStatus
      /// Encodes an unknown integer value.
      ///
      /// The most common cause for an unknown values is for the service to send
      /// a value unknown to the library. We recommend you update your library to
      /// the latest version.
      case unknownIntValue(Int)
      /// Encodes an unknown string value.
      ///
      /// The most common cause for an unknown values is for the service to send
      /// a value unknown to the library. We recommend you update your library to
      /// the latest version.
      case unknownStringValue(String)

      public init() {
        self = .host
      }

      /// Returns the integer value associated with the enumeration.
      ///
      /// If the enumeration was initialized with an unknown string value, this returns `nil`.
      public var intValue: Int? {
        switch self {
        case .host: return 0
        case .unspecifiedXpnProjectStatus: return 1
        case .unknownIntValue(let v): return v
        case .unknownStringValue: return nil
        }
      }

      /// Returns the string value (or name) associated with the enumeration.
      ///
      /// If the enumeration was initialized with an unknown integer value, this returns `nil`.
      public var stringValue: Swift.String? {
        switch self {
        case .host: return "HOST"
        case .unspecifiedXpnProjectStatus: return "UNSPECIFIED_XPN_PROJECT_STATUS"
        case .unknownIntValue: return nil
        case .unknownStringValue(let v): return v
        }
      }

      /// Initialize from a string value.
      ///
      /// If the value is unknown, this initializes to [`unknownStringValue`](doc:XpnProjectStatus/unknownStringValue(_:)).
      public init(stringValue: Swift.String) {
        switch stringValue {
        case "HOST": self = .host
        case "UNSPECIFIED_XPN_PROJECT_STATUS": self = .unspecifiedXpnProjectStatus
        default: self = .unknownStringValue(stringValue)
        }
      }

      /// Initialize from an integer value.
      ///
      /// If the value is unknown, this initializes to [`unknownIntValue`](doc:XpnProjectStatus/unknownIntValue(_:)).
      public init(intValue: Int) {
        switch intValue {
        case 0: self = .host
        case 1: self = .unspecifiedXpnProjectStatus
        default: self = .unknownIntValue(intValue)
        }
      }

      public init(from decoder: Decoder) throws {
        let container = try decoder.singleValueContainer()
        if let v = try? container.decode(Int.self) {
          self.init(intValue: v)
          return
        }
        if let s = try? container.decode(String.self) {
          if let v = Int(s) {
            self.init(intValue: v)
          } else {
            self.init(stringValue: s)
          }
          return
        }
        throw DecodingError.dataCorruptedError(
          in: container, debugDescription: "Expected enum value, must be integer or string.")
      }

      public func encode(to encoder: Encoder) throws {
        var container = encoder.singleValueContainer()
        switch self {
        case .host: return try container.encode(0)
        case .unspecifiedXpnProjectStatus: return try container.encode(1)
        case .unknownIntValue(let v): return try container.encode(v)
        case .unknownStringValue(let v): return try container.encode(v)
        }
      }
    }

    public static var _anyTypeUrl: Swift.String {
      return "type.googleapis.com/google.cloud.compute.v1.Project"
    }
    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)
    }
  }
#endif
