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

  /// Represents a Cross-Cloud Interconnect Remote Location resource.
  ///
  /// You can use this resource to find remote location details about an
  /// Interconnect attachment (VLAN).
  public struct InterconnectRemoteLocation: 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. [Output Only] Subset of fields from InterconnectAttachment's
    /// |configurationConstraints| field that apply to all attachments for this
    /// remote location.
    public var attachmentConfigurationConstraints: InterconnectAttachmentConfigurationConstraints? =
      nil

    /// Output only. [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. [Output Only] Constraints on the parameters for creating Cross-Cloud
    /// Interconnect and associated InterconnectAttachments.
    public var constraints: InterconnectRemoteLocationConstraints? = nil

    /// Output only. [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: InterconnectRemoteLocation.Continent? = nil

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

    /// 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#interconnectRemoteLocation for interconnect remote
    /// locations.
    public var kind: Swift.String? = nil

    /// Output only. [Output Only] Link Aggregation Control Protocol (LACP) constraints, which
    /// can take one of the following values: LACP_SUPPORTED, LACP_UNSUPPORTED
    public var lacp: InterconnectRemoteLocation.Lacp? = nil

    /// Output only. [Output Only]
    /// The maximum number of 100 Gbps ports supported in a link aggregation group
    /// (LAG). When linkType is 100 Gbps, requestedLinkCount cannot exceed
    /// max_lag_size_100_gbps.
    public var maxLagSize100Gbps: Swift.Int32? = nil

    /// Output only. [Output Only]
    /// The maximum number of 10 Gbps ports supported in a link aggregation group
    /// (LAG). When linkType is 10 Gbps, requestedLinkCount cannot exceed
    /// max_lag_size_10_gbps.
    public var maxLagSize10Gbps: Swift.Int32? = nil

    /// Output only. [Output Only]
    /// The maximum number of 400 Gbps ports supported in a link aggregation group
    /// (LAG). When linkType is 400 Gbps, requestedLinkCount cannot exceed
    /// max_lag_size_400_gbps.
    public var maxLagSize400Gbps: Swift.Int32? = 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] Permitted connections.
    public var permittedConnections: [InterconnectRemoteLocationPermittedConnections] = []

    /// Output only. [Output Only] Indicates the service provider present at the remote
    /// location. Example values: "Amazon Web Services", "Microsoft Azure".
    public var remoteService: Swift.String? = nil

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

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

    /// Initialize a new instance of `InterconnectRemoteLocation`.
    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 = InterconnectRemoteLocation().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 [continent][google.cloud.compute.v1.InterconnectRemoteLocation.continent] field.
    ///
    /// [google.cloud.compute.v1.InterconnectRemoteLocation.continent]: <doc:InterconnectRemoteLocation/Continent>
    public enum Continent: Codable, Equatable, Sendable {
      case africa
      case asiaPac
      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 .europe: return 2
        case .northAmerica: return 3
        case .southAmerica: return 4
        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 .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 "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 = .europe
        case 3: self = .northAmerica
        case 4: 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 .europe: return try container.encode(2)
        case .northAmerica: return try container.encode(3)
        case .southAmerica: return try container.encode(4)
        case .unknownIntValue(let v): return try container.encode(v)
        case .unknownStringValue(let v): return try container.encode(v)
        }
      }
    }

    /// The enumerated type for the [lacp][google.cloud.compute.v1.InterconnectRemoteLocation.lacp] field.
    ///
    /// [google.cloud.compute.v1.InterconnectRemoteLocation.lacp]: <doc:InterconnectRemoteLocation/Lacp>
    public enum Lacp: Codable, Equatable, Sendable {
      /// LACP_SUPPORTED: LACP is supported, and enabled by default on
      /// the Cross-Cloud Interconnect.
      case supported
      /// LACP_UNSUPPORTED: LACP is not supported and is not be enabled on this
      /// port. GetDiagnostics shows bundleAggregationType as "static". GCP does
      /// not support LAGs without LACP, so requestedLinkCount must be 1.
      case unsupported
      /// 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 = .supported
      }

      /// 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 .supported: return 0
        case .unsupported: 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 .supported: return "LACP_SUPPORTED"
        case .unsupported: return "LACP_UNSUPPORTED"
        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:Lacp/unknownStringValue(_:)).
      public init(stringValue: Swift.String) {
        switch stringValue {
        case "LACP_SUPPORTED": self = .supported
        case "LACP_UNSUPPORTED": self = .unsupported
        default: self = .unknownStringValue(stringValue)
        }
      }

      /// Initialize from an integer value.
      ///
      /// If the value is unknown, this initializes to [`unknownIntValue`](doc:Lacp/unknownIntValue(_:)).
      public init(intValue: Int) {
        switch intValue {
        case 0: self = .supported
        case 1: self = .unsupported
        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 .supported: return try container.encode(0)
        case .unsupported: 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 [status][google.cloud.compute.v1.InterconnectRemoteLocation.status] field.
    ///
    /// [google.cloud.compute.v1.InterconnectRemoteLocation.status]: <doc:InterconnectRemoteLocation/Status>
    public enum Status: Codable, Equatable, Sendable {
      /// The InterconnectRemoteLocation is available for provisioning new
      /// Cross-Cloud Interconnects.
      case available
      /// The InterconnectRemoteLocation is closed for provisioning new
      /// Cross-Cloud 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.InterconnectRemoteLocation"
    }
    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
