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

  public struct InterconnectGroupsCreateMembersInterconnectInput: Codable, Equatable, GoogleCloudWkt
      ._AnyPackable,
    Sendable
  {
    /// Administrative status of the interconnect. When this is set to true, the
    /// Interconnect is functional and can carry traffic.
    /// When set to false, no packets can be carried over the interconnect and
    /// no BGP routes are exchanged over it. By default, the status is set to
    /// true.
    public var adminEnabled: Swift.Bool? = nil

    /// Customer name, to put in the Letter of Authorization as the party
    /// authorized to request a crossconnect.
    public var customerName: Swift.String? = nil

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

    /// A zone-free location to use for all Interconnects created in this call,
    /// like "iad-1234".
    public var facility: Swift.String? = nil

    /// Type of interconnect, which can take one of the following values:
    ///
    ///    - PARTNER: A partner-managed interconnection shared between
    ///    customers though a partner.
    ///    - DEDICATED: A dedicated physical
    ///    interconnection with the customer.
    ///
    ///  Note that a value IT_PRIVATE
    /// has been deprecated in favor of DEDICATED.
    public var interconnectType:
      InterconnectGroupsCreateMembersInterconnectInput.InterconnectType? = nil

    /// Type of link requested, which can take one of the following values:
    ///
    ///    - LINK_TYPE_ETHERNET_10G_LR: A 10G Ethernet with LR optics
    ///    - LINK_TYPE_ETHERNET_100G_LR: A 100G Ethernet with LR optics.
    ///    - LINK_TYPE_ETHERNET_400G_LR4: A 400G Ethernet with LR4
    ///    optics.
    ///
    ///  Note that this field indicates the speed of each of the
    /// links in the bundle, not the speed of the entire bundle.
    public var linkType: InterconnectGroupsCreateMembersInterconnectInput.LinkType? = nil

    /// Name of the Interconnects to be created. This must be specified on the
    /// template and/or on each individual interconnect. The name, if not empty,
    /// must be 1-63 characters long, and comply with RFC1035.
    /// Specifically, any nonempty 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

    /// Email address to contact the customer NOC for operations and maintenance
    /// notifications regarding this Interconnect. If specified, this will be
    /// used for notifications in addition to all other forms described, such as
    /// Cloud Monitoring logs alerting and Cloud Notifications. This field is
    /// required for users who sign up for Cloud Interconnect using
    /// workforce identity federation.
    public var nocContactEmail: Swift.String? = nil

    /// Indicates that this is a Cross-Cloud Interconnect. This field specifies
    /// the location outside of Google's network that the interconnect is
    /// connected to.
    public var remoteLocation: Swift.String? = nil

    /// Optional. List of features requested for this Interconnect connection,
    /// which can take one of the following values:
    ///
    ///    - IF_MACSEC: If specified, then the connection is created on MACsec
    ///    capable hardware ports. If not specified, non-MACsec capable ports will
    ///    also be considered.
    ///    - IF_CROSS_SITE_NETWORK: If specified, then the connection is created
    ///    exclusively for Cross-Site Networking. The connection can not be used for
    ///    Cross-Site Networking unless this feature is specified.
    public var requestedFeatures:
      [InterconnectGroupsCreateMembersInterconnectInput.RequestedFeatures] = []

    /// Target number of physical links in the link bundle, as requested by the
    /// customer.
    public var requestedLinkCount: Swift.Int32? = nil

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

    /// The enumerated type for the [interconnectType][google.cloud.compute.v1.InterconnectGroupsCreateMembersInterconnectInput.interconnectType] field.
    ///
    /// [google.cloud.compute.v1.InterconnectGroupsCreateMembersInterconnectInput.interconnectType]: <doc:InterconnectGroupsCreateMembersInterconnectInput/InterconnectType>
    public enum InterconnectType: Codable, Equatable, Sendable {
      /// A dedicated physical interconnection with the customer.
      case dedicated
      /// [Deprecated] A private, physical interconnection with the customer.
      case itPrivate
      /// A partner-managed interconnection shared between customers via partner.
      case partner
      /// 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 = .dedicated
      }

      /// 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 .dedicated: return 0
        case .itPrivate: return 1
        case .partner: 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 .dedicated: return "DEDICATED"
        case .itPrivate: return "IT_PRIVATE"
        case .partner: return "PARTNER"
        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:InterconnectType/unknownStringValue(_:)).
      public init(stringValue: Swift.String) {
        switch stringValue {
        case "DEDICATED": self = .dedicated
        case "IT_PRIVATE": self = .itPrivate
        case "PARTNER": self = .partner
        default: self = .unknownStringValue(stringValue)
        }
      }

      /// Initialize from an integer value.
      ///
      /// If the value is unknown, this initializes to [`unknownIntValue`](doc:InterconnectType/unknownIntValue(_:)).
      public init(intValue: Int) {
        switch intValue {
        case 0: self = .dedicated
        case 1: self = .itPrivate
        case 2: self = .partner
        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 .dedicated: return try container.encode(0)
        case .itPrivate: return try container.encode(1)
        case .partner: 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 [linkType][google.cloud.compute.v1.InterconnectGroupsCreateMembersInterconnectInput.linkType] field.
    ///
    /// [google.cloud.compute.v1.InterconnectGroupsCreateMembersInterconnectInput.linkType]: <doc:InterconnectGroupsCreateMembersInterconnectInput/LinkType>
    public enum LinkType: Codable, Equatable, Sendable {
      /// 100G Ethernet, LR Optics.
      case ethernet100GLr
      /// 10G Ethernet, LR Optics.
      /// [(rate_bps) =  10000000000];
      case ethernet10GLr
      /// 400G Ethernet, LR4 Optics.
      case ethernet400GLr4
      /// 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 = .ethernet100GLr
      }

      /// 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 .ethernet100GLr: return 0
        case .ethernet10GLr: return 1
        case .ethernet400GLr4: 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 .ethernet100GLr: return "LINK_TYPE_ETHERNET_100G_LR"
        case .ethernet10GLr: return "LINK_TYPE_ETHERNET_10G_LR"
        case .ethernet400GLr4: return "LINK_TYPE_ETHERNET_400G_LR4"
        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:LinkType/unknownStringValue(_:)).
      public init(stringValue: Swift.String) {
        switch stringValue {
        case "LINK_TYPE_ETHERNET_100G_LR": self = .ethernet100GLr
        case "LINK_TYPE_ETHERNET_10G_LR": self = .ethernet10GLr
        case "LINK_TYPE_ETHERNET_400G_LR4": self = .ethernet400GLr4
        default: self = .unknownStringValue(stringValue)
        }
      }

      /// Initialize from an integer value.
      ///
      /// If the value is unknown, this initializes to [`unknownIntValue`](doc:LinkType/unknownIntValue(_:)).
      public init(intValue: Int) {
        switch intValue {
        case 0: self = .ethernet100GLr
        case 1: self = .ethernet10GLr
        case 2: self = .ethernet400GLr4
        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 .ethernet100GLr: return try container.encode(0)
        case .ethernet10GLr: return try container.encode(1)
        case .ethernet400GLr4: 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 [requestedFeatures][google.cloud.compute.v1.InterconnectGroupsCreateMembersInterconnectInput.requestedFeatures] field.
    ///
    /// [google.cloud.compute.v1.InterconnectGroupsCreateMembersInterconnectInput.requestedFeatures]: <doc:InterconnectGroupsCreateMembersInterconnectInput/RequestedFeatures>
    public enum RequestedFeatures: Codable, Equatable, Sendable {
      /// Cross-Site Networking
      case ifCrossSiteNetwork
      /// L2 Interconnect Attachment Forwarding
      case ifL2Forwarding
      /// Media Access Control security (MACsec)
      case ifMacsec
      /// 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 = .ifCrossSiteNetwork
      }

      /// 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 .ifCrossSiteNetwork: return 0
        case .ifL2Forwarding: return 1
        case .ifMacsec: 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 .ifCrossSiteNetwork: return "IF_CROSS_SITE_NETWORK"
        case .ifL2Forwarding: return "IF_L2_FORWARDING"
        case .ifMacsec: return "IF_MACSEC"
        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:RequestedFeatures/unknownStringValue(_:)).
      public init(stringValue: Swift.String) {
        switch stringValue {
        case "IF_CROSS_SITE_NETWORK": self = .ifCrossSiteNetwork
        case "IF_L2_FORWARDING": self = .ifL2Forwarding
        case "IF_MACSEC": self = .ifMacsec
        default: self = .unknownStringValue(stringValue)
        }
      }

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