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

  /// Represents an Interconnect Attachment (VLAN) Location resource.
  ///
  /// You can use this resource to find location details about an Interconnect
  /// attachment (VLAN). For more information about interconnect attachments, read
  /// Creating VLAN Attachments.
  public struct InterconnectLocation: Codable, Equatable, GoogleCloudWkt._AnyPackable,
    Sendable
  {
    /// Output only. [Output Only] The postal address of the Point of Presence, each line in
    /// the address is separated by a newline character.
    public var address: Swift.String? = nil

    /// [Output Only] Availability zone for this InterconnectLocation. Within a
    /// metropolitan area (metro), maintenance will not be simultaneously scheduled
    /// in more than one availability zone.  Example: "zone1" or "zone2".
    public var availabilityZone: Swift.String? = nil

    /// [Output only] List of features available at this InterconnectLocation,
    /// which can take one of the following values:
    ///
    ///    - IF_MACSEC
    ///    - IF_CROSS_SITE_NETWORK
    public var availableFeatures: [InterconnectLocation.AvailableFeatures] = []

    /// [Output only] List of link types available at this InterconnectLocation,
    /// which can take one of the following values:
    ///
    ///    - LINK_TYPE_ETHERNET_10G_LR
    ///    - LINK_TYPE_ETHERNET_100G_LR
    ///    - LINK_TYPE_ETHERNET_400G_LR4
    public var availableLinkTypes: [InterconnectLocation.AvailableLinkTypes] = []

    /// [Output Only] Metropolitan area designator that indicates which city an
    /// interconnect is located.
    /// For example: "Chicago, IL", "Amsterdam, Netherlands".
    public var city: Swift.String? = nil

    /// [Output Only] Continent for this location, which can take one of the
    /// following values:
    ///
    ///    - AFRICA
    ///    - ASIA_PAC
    ///    - EUROPE
    ///    - NORTH_AMERICA
    ///    - SOUTH_AMERICA
    public var continent: InterconnectLocation.Continent? = nil

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

    /// [Output Only] A list of InterconnectLocation.CrossSiteInterconnectInfo
    /// objects, that describe where Cross-Site Interconnect wires may connect to
    /// from this location and associated connection parameters. Cross-Site
    /// Interconnect isn't allowed to locations which are not listed.
    public var crossSiteInterconnectInfos: [InterconnectLocationCrossSiteInterconnectInfo] = []

    /// Output only. [Output Only] An optional description of the resource.
    public var description: Swift.String? = nil

    /// Output only. [Output Only] The name of the provider for this facility (e.g., EQUINIX).
    public var facilityProvider: Swift.String? = nil

    /// Output only. [Output Only] A provider-assigned Identifier for this facility (e.g.,
    /// Ashburn-DC1).
    public var facilityProviderFacilityId: Swift.String? = nil

    /// Output only. [Output Only] The unique identifier for the resource. This identifier is
    /// defined by the server.
    public var id: Swift.UInt64? = nil

    /// Output only. [Output Only] Type of the resource. Alwayscompute#interconnectLocation for interconnect locations.
    public var kind: Swift.String? = nil

    /// Output only. [Output Only] Name of the resource.
    public var name: Swift.String? = nil

    /// Output only. [Output Only] The peeringdb identifier for this facility (corresponding
    /// with a netfac type in peeringdb).
    public var peeringdbFacilityId: Swift.String? = nil

    /// Output only. [Output Only] A list of InterconnectLocation.RegionInfo objects, that
    /// describe parameters pertaining to the relation between this
    /// InterconnectLocation and various Google Cloud regions.
    public var regionInfos: [InterconnectLocationRegionInfo] = []

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

    /// Output only. [Output Only] URLs of the other locations that can pair up with this
    /// location to support Single-Region 99.99% SLA. E.g. iad-zone1-1 and
    /// iad-zone2-5467 are Single-Region 99.99% peer locations of each other.
    public var singleRegionProductionCriticalPeerLocations: [Swift.String] = []

    /// [Output Only] The status of this InterconnectLocation, which can take one
    /// of the following values:
    ///
    ///    - CLOSED: The InterconnectLocation is closed and is unavailable for
    ///    provisioning new Interconnects.
    ///    - AVAILABLE: The InterconnectLocation is available for provisioning new
    ///    Interconnects.
    public var status: InterconnectLocation.Status? = nil

    /// Output only. [Output Only] Reserved for future use.
    public var supportsPzs: Swift.Bool? = nil

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

    /// The enumerated type for the [availableFeatures][google.cloud.compute.v1.InterconnectLocation.availableFeatures] field.
    ///
    /// [google.cloud.compute.v1.InterconnectLocation.availableFeatures]: <doc:InterconnectLocation/AvailableFeatures>
    public enum AvailableFeatures: 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:AvailableFeatures/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:AvailableFeatures/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)
        }
      }
    }

    /// The enumerated type for the [availableLinkTypes][google.cloud.compute.v1.InterconnectLocation.availableLinkTypes] field.
    ///
    /// [google.cloud.compute.v1.InterconnectLocation.availableLinkTypes]: <doc:InterconnectLocation/AvailableLinkTypes>
    public enum AvailableLinkTypes: Codable, Equatable, Sendable {
      /// 100G Ethernet, LR Optics.
      case linkTypeEthernet100GLr
      /// 10G Ethernet, LR Optics.
      /// [(rate_bps) =  10000000000];
      case linkTypeEthernet10GLr
      /// 400G Ethernet, LR4 Optics.
      case linkTypeEthernet400GLr4
      /// 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 = .linkTypeEthernet100GLr
      }

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

      /// Initialize from an integer value.
      ///
      /// If the value is unknown, this initializes to [`unknownIntValue`](doc:AvailableLinkTypes/unknownIntValue(_:)).
      public init(intValue: Int) {
        switch intValue {
        case 0: self = .linkTypeEthernet100GLr
        case 1: self = .linkTypeEthernet10GLr
        case 2: self = .linkTypeEthernet400GLr4
        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 .linkTypeEthernet100GLr: return try container.encode(0)
        case .linkTypeEthernet10GLr: return try container.encode(1)
        case .linkTypeEthernet400GLr4: 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 [continent][google.cloud.compute.v1.InterconnectLocation.continent] field.
    ///
    /// [google.cloud.compute.v1.InterconnectLocation.continent]: <doc:InterconnectLocation/Continent>
    public enum Continent: Codable, Equatable, Sendable {
      case africa
      case asiaPac
      case cAfrica
      case cAsiaPac
      case cEurope
      case cNorthAmerica
      case cSouthAmerica
      case europe
      case northAmerica
      case southAmerica
      /// 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 = .africa
      }

      /// 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 .africa: return 0
        case .asiaPac: return 1
        case .cAfrica: return 2
        case .cAsiaPac: return 3
        case .cEurope: return 4
        case .cNorthAmerica: return 5
        case .cSouthAmerica: return 6
        case .europe: return 7
        case .northAmerica: return 8
        case .southAmerica: return 9
        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 .africa: return "AFRICA"
        case .asiaPac: return "ASIA_PAC"
        case .cAfrica: return "C_AFRICA"
        case .cAsiaPac: return "C_ASIA_PAC"
        case .cEurope: return "C_EUROPE"
        case .cNorthAmerica: return "C_NORTH_AMERICA"
        case .cSouthAmerica: return "C_SOUTH_AMERICA"
        case .europe: return "EUROPE"
        case .northAmerica: return "NORTH_AMERICA"
        case .southAmerica: return "SOUTH_AMERICA"
        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:Continent/unknownStringValue(_:)).
      public init(stringValue: Swift.String) {
        switch stringValue {
        case "AFRICA": self = .africa
        case "ASIA_PAC": self = .asiaPac
        case "C_AFRICA": self = .cAfrica
        case "C_ASIA_PAC": self = .cAsiaPac
        case "C_EUROPE": self = .cEurope
        case "C_NORTH_AMERICA": self = .cNorthAmerica
        case "C_SOUTH_AMERICA": self = .cSouthAmerica
        case "EUROPE": self = .europe
        case "NORTH_AMERICA": self = .northAmerica
        case "SOUTH_AMERICA": self = .southAmerica
        default: self = .unknownStringValue(stringValue)
        }
      }

      /// Initialize from an integer value.
      ///
      /// If the value is unknown, this initializes to [`unknownIntValue`](doc:Continent/unknownIntValue(_:)).
      public init(intValue: Int) {
        switch intValue {
        case 0: self = .africa
        case 1: self = .asiaPac
        case 2: self = .cAfrica
        case 3: self = .cAsiaPac
        case 4: self = .cEurope
        case 5: self = .cNorthAmerica
        case 6: self = .cSouthAmerica
        case 7: self = .europe
        case 8: self = .northAmerica
        case 9: self = .southAmerica
        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 .africa: return try container.encode(0)
        case .asiaPac: return try container.encode(1)
        case .cAfrica: return try container.encode(2)
        case .cAsiaPac: return try container.encode(3)
        case .cEurope: return try container.encode(4)
        case .cNorthAmerica: return try container.encode(5)
        case .cSouthAmerica: return try container.encode(6)
        case .europe: return try container.encode(7)
        case .northAmerica: return try container.encode(8)
        case .southAmerica: return try container.encode(9)
        case .unknownIntValue(let v): return try container.encode(v)
        case .unknownStringValue(let v): return try container.encode(v)
        }
      }
    }

    /// The enumerated type for the [status][google.cloud.compute.v1.InterconnectLocation.status] field.
    ///
    /// [google.cloud.compute.v1.InterconnectLocation.status]: <doc:InterconnectLocation/Status>
    public enum Status: Codable, Equatable, Sendable {
      /// The InterconnectLocation is available for provisioning new Interconnects.
      case available
      /// The InterconnectLocation is closed for provisioning new Interconnects.
      case closed
      /// 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 = .available
      }

      /// 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 .available: return 0
        case .closed: 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 .available: return "AVAILABLE"
        case .closed: return "CLOSED"
        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:Status/unknownStringValue(_:)).
      public init(stringValue: Swift.String) {
        switch stringValue {
        case "AVAILABLE": self = .available
        case "CLOSED": self = .closed
        default: self = .unknownStringValue(stringValue)
        }
      }

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