// 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 FutureReservations
  import Foundation
  import GoogleCloudWkt

  public struct FutureReservation: Codable, Equatable, GoogleCloudWkt._AnyPackable,
    Sendable
  {
    /// Aggregate reservation details for the future reservation.
    public var aggregateReservation: AllocationAggregateReservation? = nil

    /// Future timestamp when the FR auto-created reservations will be deleted by
    /// Compute Engine. Format of this field must be a valid
    /// href="https://www.ietf.org/rfc/rfc3339.txt">RFC3339 value.
    public var autoCreatedReservationsDeleteTime: Swift.String? = nil

    /// Specifies the duration of auto-created reservations.
    /// It represents relative time to future reservation start_time when
    /// auto-created reservations will be automatically deleted by Compute
    /// Engine. Duration time unit is represented as a count of seconds
    /// and fractions of seconds at nanosecond resolution.
    public var autoCreatedReservationsDuration: Duration? = nil

    /// Setting for enabling or disabling automatic deletion for auto-created
    /// reservation. If set to true, auto-created reservations will be
    /// deleted at Future Reservation's end time (default) or at user's defined
    /// timestamp if any of the
    /// [auto_created_reservations_delete_time, auto_created_reservations_duration]
    /// values is specified.
    /// For keeping auto-created reservation indefinitely, this value should be set
    /// to false.
    public var autoDeleteAutoCreatedReservations: Swift.Bool? = nil

    /// If not present, then FR will not deliver a new commitment or update an
    /// existing commitment.
    public var commitmentInfo: FutureReservationCommitmentInfo? = nil

    public var confidentialComputeType: FutureReservation.ConfidentialComputeType? = nil

    /// Output only. [Output Only] The creation timestamp for this future reservation inRFC3339
    /// text format.
    public var creationTimestamp: Swift.String? = nil

    /// Type of the deployment requested as part of future reservation.
    public var deploymentType: FutureReservation.DeploymentType? = nil

    /// An optional description of this resource. Provide this property when you
    /// create the future reservation.
    public var description: Swift.String? = nil

    /// Indicates if this group of VMs have emergent maintenance enabled.
    public var enableEmergentMaintenance: Swift.Bool? = nil

    /// Output only. [Output Only] A unique identifier for this future reservation. The server
    /// defines this identifier.
    public var id: Swift.UInt64? = nil

    /// Output only. [Output Only] Type of the resource. Alwayscompute#futureReservation for future reservations.
    public var kind: Swift.String? = nil

    /// The name of the resource, provided by the client when initially creating
    /// the resource. The resource name must be 1-63 characters long, and comply
    /// withRFC1035.
    /// Specifically, the name must be 1-63 characters long and match the regular
    /// expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
    /// character must be a lowercase letter, and all following characters must be
    /// a dash, lowercase letter, or digit, except the last character, which cannot
    /// be a dash.
    public var name: Swift.String? = nil

    /// Name prefix for the reservations to be created at the time of
    /// delivery. The name prefix must comply with RFC1035.
    /// Maximum allowed length for name prefix is 20. Automatically created
    /// reservations name format will be -date-####.
    public var namePrefix: Swift.String? = nil

    /// Input only. Additional params passed with the request, but not persisted
    /// as part of resource payload.
    public var params: FutureReservationParams? = nil

    /// Planning state before being submitted for evaluation
    public var planningStatus: FutureReservation.PlanningStatus? = nil

    /// The reservation mode which determines reservation-termination behavior and
    /// expected pricing.
    public var reservationMode: FutureReservation.ReservationMode? = nil

    /// Name of reservations where the capacity is provisioned at the time of
    /// delivery of  future reservations. If the reservation with the given name
    /// does not exist already, it is created automatically at the time of Approval
    /// with INACTIVE state till specified start-time. Either provide the
    /// reservation_name or a name_prefix.
    public var reservationName: Swift.String? = nil

    /// Maintenance information for this reservation
    public var schedulingType: FutureReservation.SchedulingType? = nil

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

    /// Output only. [Output Only] Server-defined URL for this resource with the resource id.
    public var selfLinkWithId: Swift.String? = nil

    /// List of Projects/Folders to share with.
    public var shareSettings: ShareSettings? = nil

    /// Indicates whether the auto-created reservation can be consumed by VMs with
    /// affinity for "any" reservation. If the field is set, then only VMs that
    /// target the reservation by name can consume from the delivered reservation.
    public var specificReservationRequired: Swift.Bool? = nil

    /// Future Reservation configuration to indicate instance properties and
    /// total count.
    public var specificSkuProperties: FutureReservationSpecificSKUProperties? = nil

    /// Output only. [Output only] Status of the Future Reservation
    public var status: FutureReservationStatus? = nil

    /// Time window for this Future Reservation.
    public var timeWindow: FutureReservationTimeWindow? = nil

    /// Output only. [Output Only] URL of the Zone where this future reservation resides.
    public var zone: Swift.String? = nil

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

    /// The enumerated type for the [confidentialComputeType][google.cloud.compute.v1.FutureReservation.confidentialComputeType] field.
    ///
    /// [google.cloud.compute.v1.FutureReservation.confidentialComputeType]: <doc:FutureReservation/ConfidentialComputeType>
    public enum ConfidentialComputeType: Codable, Equatable, Sendable {
      /// Intel Trust Domain Extensions.
      case tdx
      case unspecified
      /// 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 = .tdx
      }

      /// 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 .tdx: return 0
        case .unspecified: 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 .tdx: return "CONFIDENTIAL_COMPUTE_TYPE_TDX"
        case .unspecified: return "CONFIDENTIAL_COMPUTE_TYPE_UNSPECIFIED"
        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:ConfidentialComputeType/unknownStringValue(_:)).
      public init(stringValue: Swift.String) {
        switch stringValue {
        case "CONFIDENTIAL_COMPUTE_TYPE_TDX": self = .tdx
        case "CONFIDENTIAL_COMPUTE_TYPE_UNSPECIFIED": self = .unspecified
        default: self = .unknownStringValue(stringValue)
        }
      }

      /// Initialize from an integer value.
      ///
      /// If the value is unknown, this initializes to [`unknownIntValue`](doc:ConfidentialComputeType/unknownIntValue(_:)).
      public init(intValue: Int) {
        switch intValue {
        case 0: self = .tdx
        case 1: self = .unspecified
        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 .tdx: return try container.encode(0)
        case .unspecified: return try container.encode(1)
        case .unknownIntValue(let v): return try container.encode(v)
        case .unknownStringValue(let v): return try container.encode(v)
        }
      }
    }

    /// The enumerated type for the [deploymentType][google.cloud.compute.v1.FutureReservation.deploymentType] field.
    ///
    /// [google.cloud.compute.v1.FutureReservation.deploymentType]: <doc:FutureReservation/DeploymentType>
    public enum DeploymentType: Codable, Equatable, Sendable {
      /// The reserved capacity is made up of densely deployed reservation blocks.
      case dense
      case unspecified
      /// 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 = .dense
      }

      /// 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 .dense: return 0
        case .unspecified: 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 .dense: return "DENSE"
        case .unspecified: return "DEPLOYMENT_TYPE_UNSPECIFIED"
        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:DeploymentType/unknownStringValue(_:)).
      public init(stringValue: Swift.String) {
        switch stringValue {
        case "DENSE": self = .dense
        case "DEPLOYMENT_TYPE_UNSPECIFIED": self = .unspecified
        default: self = .unknownStringValue(stringValue)
        }
      }

      /// Initialize from an integer value.
      ///
      /// If the value is unknown, this initializes to [`unknownIntValue`](doc:DeploymentType/unknownIntValue(_:)).
      public init(intValue: Int) {
        switch intValue {
        case 0: self = .dense
        case 1: self = .unspecified
        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 .dense: return try container.encode(0)
        case .unspecified: return try container.encode(1)
        case .unknownIntValue(let v): return try container.encode(v)
        case .unknownStringValue(let v): return try container.encode(v)
        }
      }
    }

    /// The enumerated type for the [planningStatus][google.cloud.compute.v1.FutureReservation.planningStatus] field.
    ///
    /// [google.cloud.compute.v1.FutureReservation.planningStatus]: <doc:FutureReservation/PlanningStatus>
    public enum PlanningStatus: Codable, Equatable, Sendable {
      /// Future Reservation is being drafted.
      case draft
      case unspecified
      /// Future Reservation has been submitted for evaluation by GCP.
      case submitted
      /// 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 = .draft
      }

      /// 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 .draft: return 0
        case .unspecified: return 1
        case .submitted: 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 .draft: return "DRAFT"
        case .unspecified: return "PLANNING_STATUS_UNSPECIFIED"
        case .submitted: return "SUBMITTED"
        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:PlanningStatus/unknownStringValue(_:)).
      public init(stringValue: Swift.String) {
        switch stringValue {
        case "DRAFT": self = .draft
        case "PLANNING_STATUS_UNSPECIFIED": self = .unspecified
        case "SUBMITTED": self = .submitted
        default: self = .unknownStringValue(stringValue)
        }
      }

      /// Initialize from an integer value.
      ///
      /// If the value is unknown, this initializes to [`unknownIntValue`](doc:PlanningStatus/unknownIntValue(_:)).
      public init(intValue: Int) {
        switch intValue {
        case 0: self = .draft
        case 1: self = .unspecified
        case 2: self = .submitted
        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 .draft: return try container.encode(0)
        case .unspecified: return try container.encode(1)
        case .submitted: 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 [reservationMode][google.cloud.compute.v1.FutureReservation.reservationMode] field.
    ///
    /// [google.cloud.compute.v1.FutureReservation.reservationMode]: <doc:FutureReservation/ReservationMode>
    public enum ReservationMode: Codable, Equatable, Sendable {
      /// The delivered reservations will delivered at specified start time and
      /// terminated at specified end time along with terminating the VMs running
      /// on it.
      case calendar
      /// The delivered reservations do not terminate VMs at the end of
      /// reservations. This is default mode.
      case `default`
      case unspecified
      /// 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 = .calendar
      }

      /// 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 .calendar: return 0
        case .`default`: return 1
        case .unspecified: 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 .calendar: return "CALENDAR"
        case .`default`: return "DEFAULT"
        case .unspecified: return "RESERVATION_MODE_UNSPECIFIED"
        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:ReservationMode/unknownStringValue(_:)).
      public init(stringValue: Swift.String) {
        switch stringValue {
        case "CALENDAR": self = .calendar
        case "DEFAULT": self = .`default`
        case "RESERVATION_MODE_UNSPECIFIED": self = .unspecified
        default: self = .unknownStringValue(stringValue)
        }
      }

      /// Initialize from an integer value.
      ///
      /// If the value is unknown, this initializes to [`unknownIntValue`](doc:ReservationMode/unknownIntValue(_:)).
      public init(intValue: Int) {
        switch intValue {
        case 0: self = .calendar
        case 1: self = .`default`
        case 2: self = .unspecified
        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 .calendar: return try container.encode(0)
        case .`default`: return try container.encode(1)
        case .unspecified: 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 [schedulingType][google.cloud.compute.v1.FutureReservation.schedulingType] field.
    ///
    /// [google.cloud.compute.v1.FutureReservation.schedulingType]: <doc:FutureReservation/SchedulingType>
    public enum SchedulingType: Codable, Equatable, Sendable {
      /// Maintenance on all reserved instances in the reservation is synchronized.
      case grouped
      /// Unknown maintenance type.
      case groupMaintenanceTypeUnspecified
      /// Maintenance is not synchronized for this reservation. Instead, each
      /// instance has its own maintenance window.
      case independent
      /// 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 = .grouped
      }

      /// 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 .grouped: return 0
        case .groupMaintenanceTypeUnspecified: return 1
        case .independent: 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 .grouped: return "GROUPED"
        case .groupMaintenanceTypeUnspecified: return "GROUP_MAINTENANCE_TYPE_UNSPECIFIED"
        case .independent: return "INDEPENDENT"
        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:SchedulingType/unknownStringValue(_:)).
      public init(stringValue: Swift.String) {
        switch stringValue {
        case "GROUPED": self = .grouped
        case "GROUP_MAINTENANCE_TYPE_UNSPECIFIED": self = .groupMaintenanceTypeUnspecified
        case "INDEPENDENT": self = .independent
        default: self = .unknownStringValue(stringValue)
        }
      }

      /// Initialize from an integer value.
      ///
      /// If the value is unknown, this initializes to [`unknownIntValue`](doc:SchedulingType/unknownIntValue(_:)).
      public init(intValue: Int) {
        switch intValue {
        case 0: self = .grouped
        case 1: self = .groupMaintenanceTypeUnspecified
        case 2: self = .independent
        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 .grouped: return try container.encode(0)
        case .groupMaintenanceTypeUnspecified: return try container.encode(1)
        case .independent: return try container.encode(2)
        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.FutureReservation"
    }
    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
