// 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

  /// Contain information of Nat mapping for an interface of this endpoint.
  public struct VmEndpointNatMappingsInterfaceNatMappings: Codable, Equatable, GoogleCloudWkt
      ._AnyPackable,
    Sendable
  {
    /// Output only. List of all drain IP:port-range mappings assigned to this interface.
    /// These ranges are inclusive, that is, both the first and the last
    /// ports can be used for NAT. Example: ["2.2.2.2:12345-12355",
    /// "1.1.1.1:2234-2234"].
    public var drainNatIpPortRanges: [Swift.String] = []

    /// Output only. A list of all IP:port-range mappings assigned to this interface.
    /// These ranges are inclusive, that is, both the first and the last
    /// ports can be used for NAT. Example: ["2.2.2.2:12345-12355",
    /// "1.1.1.1:2234-2234"].
    public var natIpPortRanges: [Swift.String] = []

    /// Output only. Total number of drain ports across all NAT IPs allocated to this
    /// interface. It equals to the aggregated port number in the field
    /// drain_nat_ip_port_ranges.
    public var numTotalDrainNatPorts: Swift.Int32? = nil

    /// Output only. Total number of ports across all NAT IPs allocated to this interface.
    /// It equals to the aggregated port number in the field nat_ip_port_ranges.
    public var numTotalNatPorts: Swift.Int32? = nil

    /// Output only. Information about mappings provided by rules in this NAT.
    public var ruleMappings: [VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings] = []

    /// Output only. Alias IP range for this interface endpoint.
    /// It will be a private (RFC 1918) IP range.
    /// Examples: "10.33.4.55/32", or "192.168.5.0/24".
    public var sourceAliasIpRange: Swift.String? = nil

    /// Output only. Primary IP of the VM for this NIC.
    public var sourceVirtualIp: Swift.String? = nil

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