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

  public struct NetworksAddPeeringRequest: Codable, Equatable, GoogleCloudWkt._AnyPackable,
    Sendable
  {
    /// This field will be deprecated soon. Useexchange_subnet_routes in network_peering
    /// instead.
    /// Indicates whether full mesh connectivity is created and managed
    /// automatically between peered networks. Currently this field should always
    /// be true since Google Compute Engine will automatically create and manage
    /// subnetwork routes between two networks when peering state isACTIVE.
    public var autoCreateRoutes: Swift.Bool? = nil

    /// Name of the peering, which should conform to RFC1035.
    public var name: Swift.String? = nil

    /// Network peering parameters.
    /// In order to specify route policies for peering using import and export
    /// custom routes, you must specify all peering related parameters
    /// (name, peer network,exchange_subnet_routes) in the network_peering
    /// field.
    /// The corresponding fields in NetworksAddPeeringRequest will be
    /// deprecated soon.
    public var networkPeering: NetworkPeering? = nil

    /// URL of the peer network.  It can be either full URL or partial URL. The
    /// peer network may belong to a different project. If the partial URL does not
    /// contain project, it is assumed that the peer network is in the same project
    /// as the current network.
    public var peerNetwork: Swift.String? = nil

    /// Initialize a new instance of `NetworksAddPeeringRequest`.
    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 = NetworksAddPeeringRequest().with { $0.autoCreateRoutes = ... }
    /// ```
    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.NetworksAddPeeringRequest"
    }
    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
