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

  /// Represents a Cloud Router resource.
  ///
  /// For more information about Cloud Router, read theCloud
  /// Router overview.
  public struct Router: Codable, Equatable, GoogleCloudWkt._AnyPackable,
    Sendable
  {
    /// BGP information specific to this router.
    public var bgp: RouterBgp? = nil

    /// BGP information that must be configured into the routing stack to
    /// establish BGP peering. This information must specify the peer ASN and
    /// either the interface name, IP address, or peer IP address. Please refer toRFC4273.
    public var bgpPeers: [RouterBgpPeer] = []

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

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

    /// Indicates if a router is dedicated for use with encrypted VLAN
    /// attachments (interconnectAttachments).
    public var encryptedInterconnectRouter: Swift.Bool? = nil

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

    /// Router interfaces.
    /// To create a BGP peer that uses a router interface,
    /// the interface must have one of the following fields specified:
    ///
    ///    - linkedVpnTunnel
    ///    - linkedInterconnectAttachment
    ///    - subnetwork
    ///
    ///
    /// You can create a router interface without any of these fields specified.
    /// However, you cannot create a BGP peer that uses that interface.
    public var interfaces: [RouterInterface] = []

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

    /// Keys used for MD5 authentication.
    public var md5AuthenticationKeys: [RouterMd5AuthenticationKey] = []

    /// Name of the resource. Provided by the client when the resource is created.
    /// The 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

    /// A list of NAT services created in this router.
    public var nats: [RouterNat] = []

    /// URI of the ncc_gateway to which this router associated.
    public var nccGateway: Swift.String? = nil

    /// URI of the network to which this router belongs.
    public var network: Swift.String? = nil

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

    /// [Output Only] URI of the region where the router resides.
    /// You must specify this field as part of the HTTP request URL. It is
    /// not settable as a field in the request body.
    public var region: Swift.String? = nil

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

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

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