// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct SecurityRulePropertiesFormatData : SecurityRulePropertiesFormatProtocol {
    public var description: String?
    public var _protocol: SecurityRuleProtocolEnum
    public var sourcePortRange: String?
    public var destinationPortRange: String?
    public var sourceAddressPrefix: String?
    public var sourceAddressPrefixes: [String]?
    public var sourceApplicationSecurityGroups: [ApplicationSecurityGroupProtocol?]?
    public var destinationAddressPrefix: String?
    public var destinationAddressPrefixes: [String]?
    public var destinationApplicationSecurityGroups: [ApplicationSecurityGroupProtocol?]?
    public var sourcePortRanges: [String]?
    public var destinationPortRanges: [String]?
    public var access: SecurityRuleAccessEnum
    public var priority: Int32?
    public var direction: SecurityRuleDirectionEnum
    public var provisioningState: String?

        enum CodingKeys: String, CodingKey {case description = "description"
        case _protocol = "protocol"
        case sourcePortRange = "sourcePortRange"
        case destinationPortRange = "destinationPortRange"
        case sourceAddressPrefix = "sourceAddressPrefix"
        case sourceAddressPrefixes = "sourceAddressPrefixes"
        case sourceApplicationSecurityGroups = "sourceApplicationSecurityGroups"
        case destinationAddressPrefix = "destinationAddressPrefix"
        case destinationAddressPrefixes = "destinationAddressPrefixes"
        case destinationApplicationSecurityGroups = "destinationApplicationSecurityGroups"
        case sourcePortRanges = "sourcePortRanges"
        case destinationPortRanges = "destinationPortRanges"
        case access = "access"
        case priority = "priority"
        case direction = "direction"
        case provisioningState = "provisioningState"
        }

  public init(_protocol: SecurityRuleProtocolEnum, access: SecurityRuleAccessEnum, direction: SecurityRuleDirectionEnum)  {
    self._protocol = _protocol
    self.access = access
    self.direction = direction
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.description) {
        self.description = try container.decode(String?.self, forKey: .description)
    }
    self._protocol = try container.decode(SecurityRuleProtocolEnum.self, forKey: ._protocol)
    if container.contains(.sourcePortRange) {
        self.sourcePortRange = try container.decode(String?.self, forKey: .sourcePortRange)
    }
    if container.contains(.destinationPortRange) {
        self.destinationPortRange = try container.decode(String?.self, forKey: .destinationPortRange)
    }
    if container.contains(.sourceAddressPrefix) {
        self.sourceAddressPrefix = try container.decode(String?.self, forKey: .sourceAddressPrefix)
    }
    if container.contains(.sourceAddressPrefixes) {
        self.sourceAddressPrefixes = try container.decode([String]?.self, forKey: .sourceAddressPrefixes)
    }
    if container.contains(.sourceApplicationSecurityGroups) {
        self.sourceApplicationSecurityGroups = try container.decode([ApplicationSecurityGroupData?]?.self, forKey: .sourceApplicationSecurityGroups)
    }
    if container.contains(.destinationAddressPrefix) {
        self.destinationAddressPrefix = try container.decode(String?.self, forKey: .destinationAddressPrefix)
    }
    if container.contains(.destinationAddressPrefixes) {
        self.destinationAddressPrefixes = try container.decode([String]?.self, forKey: .destinationAddressPrefixes)
    }
    if container.contains(.destinationApplicationSecurityGroups) {
        self.destinationApplicationSecurityGroups = try container.decode([ApplicationSecurityGroupData?]?.self, forKey: .destinationApplicationSecurityGroups)
    }
    if container.contains(.sourcePortRanges) {
        self.sourcePortRanges = try container.decode([String]?.self, forKey: .sourcePortRanges)
    }
    if container.contains(.destinationPortRanges) {
        self.destinationPortRanges = try container.decode([String]?.self, forKey: .destinationPortRanges)
    }
    self.access = try container.decode(SecurityRuleAccessEnum.self, forKey: .access)
    if container.contains(.priority) {
        self.priority = try container.decode(Int32?.self, forKey: .priority)
    }
    self.direction = try container.decode(SecurityRuleDirectionEnum.self, forKey: .direction)
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(String?.self, forKey: .provisioningState)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.description != nil {try container.encode(self.description, forKey: .description)}
    try container.encode(self._protocol, forKey: ._protocol)
    if self.sourcePortRange != nil {try container.encode(self.sourcePortRange, forKey: .sourcePortRange)}
    if self.destinationPortRange != nil {try container.encode(self.destinationPortRange, forKey: .destinationPortRange)}
    if self.sourceAddressPrefix != nil {try container.encode(self.sourceAddressPrefix, forKey: .sourceAddressPrefix)}
    if self.sourceAddressPrefixes != nil {try container.encode(self.sourceAddressPrefixes as! [String]?, forKey: .sourceAddressPrefixes)}
    if self.sourceApplicationSecurityGroups != nil {try container.encode(self.sourceApplicationSecurityGroups as! [ApplicationSecurityGroupData?]?, forKey: .sourceApplicationSecurityGroups)}
    if self.destinationAddressPrefix != nil {try container.encode(self.destinationAddressPrefix, forKey: .destinationAddressPrefix)}
    if self.destinationAddressPrefixes != nil {try container.encode(self.destinationAddressPrefixes as! [String]?, forKey: .destinationAddressPrefixes)}
    if self.destinationApplicationSecurityGroups != nil {try container.encode(self.destinationApplicationSecurityGroups as! [ApplicationSecurityGroupData?]?, forKey: .destinationApplicationSecurityGroups)}
    if self.sourcePortRanges != nil {try container.encode(self.sourcePortRanges as! [String]?, forKey: .sourcePortRanges)}
    if self.destinationPortRanges != nil {try container.encode(self.destinationPortRanges as! [String]?, forKey: .destinationPortRanges)}
    try container.encode(self.access, forKey: .access)
    if self.priority != nil {try container.encode(self.priority, forKey: .priority)}
    try container.encode(self.direction, forKey: .direction)
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
  }
}

extension DataFactory {
  public static func createSecurityRulePropertiesFormatProtocol(_protocol: SecurityRuleProtocolEnum, access: SecurityRuleAccessEnum, direction: SecurityRuleDirectionEnum) -> SecurityRulePropertiesFormatProtocol {
    return SecurityRulePropertiesFormatData(_protocol: _protocol, access: access, direction: direction)
  }
}


// SecurityRuleProtocol enumerates the values for security rule protocol.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum SecurityRuleProtocolEnum: String, Codable
{
// SecurityRuleProtocolAsterisk specifies the security rule protocol asterisk state for security rule protocol.
    case SecurityRuleProtocolAsterisk = "*"
// SecurityRuleProtocolTcp specifies the security rule protocol tcp state for security rule protocol.
    case SecurityRuleProtocolTcp = "Tcp"
// SecurityRuleProtocolUdp specifies the security rule protocol udp state for security rule protocol.
    case SecurityRuleProtocolUdp = "Udp"
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct ServiceEndpointPropertiesFormatData : ServiceEndpointPropertiesFormatProtocol {
    public var service: String?
    public var locations: [String]?
    public var provisioningState: String?

        enum CodingKeys: String, CodingKey {case service = "service"
        case locations = "locations"
        case provisioningState = "provisioningState"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.service) {
        self.service = try container.decode(String?.self, forKey: .service)
    }
    if container.contains(.locations) {
        self.locations = try container.decode([String]?.self, forKey: .locations)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(String?.self, forKey: .provisioningState)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.service != nil {try container.encode(self.service, forKey: .service)}
    if self.locations != nil {try container.encode(self.locations as! [String]?, forKey: .locations)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
  }
}

extension DataFactory {
  public static func createServiceEndpointPropertiesFormatProtocol() -> ServiceEndpointPropertiesFormatProtocol {
    return ServiceEndpointPropertiesFormatData()
  }
}


// ServiceProviderProvisioningState enumerates the values for service provider provisioning state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum ServiceProviderProvisioningStateEnum: String, Codable
{
// Deprovisioning specifies the deprovisioning state for service provider provisioning state.
    case Deprovisioning = "Deprovisioning"
// NotProvisioned specifies the not provisioned state for service provider provisioning state.
    case NotProvisioned = "NotProvisioned"
// Provisioned specifies the provisioned state for service provider provisioning state.
    case Provisioned = "Provisioned"
// Provisioning specifies the provisioning state for service provider provisioning state.
    case Provisioning = "Provisioning"
}


// Severity enumerates the values for severity.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum SeverityEnum: String, Codable
{
// SeverityError specifies the severity error state for severity.
    case SeverityError = "Error"
// SeverityWarning specifies the severity warning state for severity.
    case SeverityWarning = "Warning"
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct SubnetAssociationData : SubnetAssociationProtocol {
    public var id: String?
    public var securityRules: [SecurityRuleProtocol?]?

        enum CodingKeys: String, CodingKey {case id = "id"
        case securityRules = "securityRules"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.id) {
        self.id = try container.decode(String?.self, forKey: .id)
    }
    if container.contains(.securityRules) {
        self.securityRules = try container.decode([SecurityRuleData?]?.self, forKey: .securityRules)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.id != nil {try container.encode(self.id, forKey: .id)}
    if self.securityRules != nil {try container.encode(self.securityRules as! [SecurityRuleData?]?, forKey: .securityRules)}
  }
}

extension DataFactory {
  public static func createSubnetAssociationProtocol() -> SubnetAssociationProtocol {
    return SubnetAssociationData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct SubnetData : SubnetProtocol, SubResourceProtocol {
    public var id: String?
    public var properties: SubnetPropertiesFormatProtocol?
    public var name: String?
    public var etag: String?

        enum CodingKeys: String, CodingKey {case id = "id"
        case properties = "properties"
        case name = "name"
        case etag = "etag"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.id) {
        self.id = try container.decode(String?.self, forKey: .id)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(SubnetPropertiesFormatData?.self, forKey: .properties)
    }
    if container.contains(.name) {
        self.name = try container.decode(String?.self, forKey: .name)
    }
    if container.contains(.etag) {
        self.etag = try container.decode(String?.self, forKey: .etag)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.id != nil {try container.encode(self.id, forKey: .id)}
    if self.properties != nil {try container.encode(self.properties as! SubnetPropertiesFormatData?, forKey: .properties)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.etag != nil {try container.encode(self.etag, forKey: .etag)}
  }
}

extension DataFactory {
  public static func createSubnetProtocol() -> SubnetProtocol {
    return SubnetData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct SubnetListResultData : SubnetListResultProtocol {
    public var value: [SubnetProtocol?]?
    public var _nextLink: String?

        enum CodingKeys: String, CodingKey {case value = "value"
        case _nextLink = "nextLink"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.value) {
        self.value = try container.decode([SubnetData?]?.self, forKey: .value)
    }
    if container.contains(._nextLink) {
        self._nextLink = try container.decode(String?.self, forKey: ._nextLink)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.value != nil {try container.encode(self.value as! [SubnetData?]?, forKey: .value)}
    if self._nextLink != nil {try container.encode(self._nextLink, forKey: ._nextLink)}
  }
}

extension DataFactory {
  public static func createSubnetListResultProtocol() -> SubnetListResultProtocol {
    return SubnetListResultData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct SubnetPropertiesFormatData : SubnetPropertiesFormatProtocol {
    public var addressPrefix: String?
    public var networkSecurityGroup: NetworkSecurityGroupProtocol?
    public var routeTable: RouteTableProtocol?
    public var serviceEndpoints: [ServiceEndpointPropertiesFormatProtocol?]?
    public var ipConfigurations: [IPConfigurationProtocol?]?
    public var resourceNavigationLinks: [ResourceNavigationLinkProtocol?]?
    public var provisioningState: String?

        enum CodingKeys: String, CodingKey {case addressPrefix = "addressPrefix"
        case networkSecurityGroup = "networkSecurityGroup"
        case routeTable = "routeTable"
        case serviceEndpoints = "serviceEndpoints"
        case ipConfigurations = "ipConfigurations"
        case resourceNavigationLinks = "resourceNavigationLinks"
        case provisioningState = "provisioningState"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.addressPrefix) {
        self.addressPrefix = try container.decode(String?.self, forKey: .addressPrefix)
    }
    if container.contains(.networkSecurityGroup) {
        self.networkSecurityGroup = try container.decode(NetworkSecurityGroupData?.self, forKey: .networkSecurityGroup)
    }
    if container.contains(.routeTable) {
        self.routeTable = try container.decode(RouteTableData?.self, forKey: .routeTable)
    }
    if container.contains(.serviceEndpoints) {
        self.serviceEndpoints = try container.decode([ServiceEndpointPropertiesFormatData?]?.self, forKey: .serviceEndpoints)
    }
    if container.contains(.ipConfigurations) {
        self.ipConfigurations = try container.decode([IPConfigurationData?]?.self, forKey: .ipConfigurations)
    }
    if container.contains(.resourceNavigationLinks) {
        self.resourceNavigationLinks = try container.decode([ResourceNavigationLinkData?]?.self, forKey: .resourceNavigationLinks)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(String?.self, forKey: .provisioningState)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.addressPrefix != nil {try container.encode(self.addressPrefix, forKey: .addressPrefix)}
    if self.networkSecurityGroup != nil {try container.encode(self.networkSecurityGroup as! NetworkSecurityGroupData?, forKey: .networkSecurityGroup)}
    if self.routeTable != nil {try container.encode(self.routeTable as! RouteTableData?, forKey: .routeTable)}
    if self.serviceEndpoints != nil {try container.encode(self.serviceEndpoints as! [ServiceEndpointPropertiesFormatData?]?, forKey: .serviceEndpoints)}
    if self.ipConfigurations != nil {try container.encode(self.ipConfigurations as! [IPConfigurationData?]?, forKey: .ipConfigurations)}
    if self.resourceNavigationLinks != nil {try container.encode(self.resourceNavigationLinks as! [ResourceNavigationLinkData?]?, forKey: .resourceNavigationLinks)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
  }
}

extension DataFactory {
  public static func createSubnetPropertiesFormatProtocol() -> SubnetPropertiesFormatProtocol {
    return SubnetPropertiesFormatData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct SubResourceData : SubResourceProtocol {
    public var id: String?

        enum CodingKeys: String, CodingKey {case id = "id"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.id) {
        self.id = try container.decode(String?.self, forKey: .id)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.id != nil {try container.encode(self.id, forKey: .id)}
  }
}

extension DataFactory {
  public static func createSubResourceProtocol() -> SubResourceProtocol {
    return SubResourceData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct TagsObjectData : TagsObjectProtocol {
    public var tags: [String:String]?

        enum CodingKeys: String, CodingKey {case tags = "tags"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.tags) {
        self.tags = try container.decode([String:String]?.self, forKey: .tags)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.tags != nil {try container.encode(self.tags, forKey: .tags)}
  }
}

extension DataFactory {
  public static func createTagsObjectProtocol() -> TagsObjectProtocol {
    return TagsObjectData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct TopologyAssociationData : TopologyAssociationProtocol {
    public var name: String?
    public var resourceId: String?
    public var associationType: AssociationTypeEnum?

        enum CodingKeys: String, CodingKey {case name = "name"
        case resourceId = "resourceId"
        case associationType = "associationType"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.name) {
        self.name = try container.decode(String?.self, forKey: .name)
    }
    if container.contains(.resourceId) {
        self.resourceId = try container.decode(String?.self, forKey: .resourceId)
    }
    if container.contains(.associationType) {
        self.associationType = try container.decode(AssociationTypeEnum?.self, forKey: .associationType)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.resourceId != nil {try container.encode(self.resourceId, forKey: .resourceId)}
    if self.associationType != nil {try container.encode(self.associationType, forKey: .associationType)}
  }
}

extension DataFactory {
  public static func createTopologyAssociationProtocol() -> TopologyAssociationProtocol {
    return TopologyAssociationData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct TopologyData : TopologyProtocol {
    public var id: String?
    public var createdDateTime: Date?
    public var lastModified: Date?
    public var resources: [TopologyResourceProtocol?]?

        enum CodingKeys: String, CodingKey {case id = "id"
        case createdDateTime = "createdDateTime"
        case lastModified = "lastModified"
        case resources = "resources"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.id) {
        self.id = try container.decode(String?.self, forKey: .id)
    }
    if container.contains(.createdDateTime) {
        self.createdDateTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .createdDateTime)), format: .dateTime)
    }
    if container.contains(.lastModified) {
        self.lastModified = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastModified)), format: .dateTime)
    }
    if container.contains(.resources) {
        self.resources = try container.decode([TopologyResourceData?]?.self, forKey: .resources)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.id != nil {try container.encode(self.id, forKey: .id)}
    if self.createdDateTime != nil {
        try container.encode(DateConverter.toString(date: self.createdDateTime!, format: .dateTime), forKey: .createdDateTime)
    }
    if self.lastModified != nil {
        try container.encode(DateConverter.toString(date: self.lastModified!, format: .dateTime), forKey: .lastModified)
    }
    if self.resources != nil {try container.encode(self.resources as! [TopologyResourceData?]?, forKey: .resources)}
  }
}

extension DataFactory {
  public static func createTopologyProtocol() -> TopologyProtocol {
    return TopologyData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct TopologyParametersData : TopologyParametersProtocol {
    public var targetResourceGroupName: String?
    public var targetVirtualNetwork: SubResourceProtocol?
    public var targetSubnet: SubResourceProtocol?

        enum CodingKeys: String, CodingKey {case targetResourceGroupName = "targetResourceGroupName"
        case targetVirtualNetwork = "targetVirtualNetwork"
        case targetSubnet = "targetSubnet"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.targetResourceGroupName) {
        self.targetResourceGroupName = try container.decode(String?.self, forKey: .targetResourceGroupName)
    }
    if container.contains(.targetVirtualNetwork) {
        self.targetVirtualNetwork = try container.decode(SubResourceData?.self, forKey: .targetVirtualNetwork)
    }
    if container.contains(.targetSubnet) {
        self.targetSubnet = try container.decode(SubResourceData?.self, forKey: .targetSubnet)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.targetResourceGroupName != nil {try container.encode(self.targetResourceGroupName, forKey: .targetResourceGroupName)}
    if self.targetVirtualNetwork != nil {try container.encode(self.targetVirtualNetwork as! SubResourceData?, forKey: .targetVirtualNetwork)}
    if self.targetSubnet != nil {try container.encode(self.targetSubnet as! SubResourceData?, forKey: .targetSubnet)}
  }
}

extension DataFactory {
  public static func createTopologyParametersProtocol() -> TopologyParametersProtocol {
    return TopologyParametersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct TopologyResourceData : TopologyResourceProtocol {
    public var name: String?
    public var id: String?
    public var location: String?
    public var associations: [TopologyAssociationProtocol?]?

        enum CodingKeys: String, CodingKey {case name = "name"
        case id = "id"
        case location = "location"
        case associations = "associations"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.name) {
        self.name = try container.decode(String?.self, forKey: .name)
    }
    if container.contains(.id) {
        self.id = try container.decode(String?.self, forKey: .id)
    }
    if container.contains(.location) {
        self.location = try container.decode(String?.self, forKey: .location)
    }
    if container.contains(.associations) {
        self.associations = try container.decode([TopologyAssociationData?]?.self, forKey: .associations)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.id != nil {try container.encode(self.id, forKey: .id)}
    if self.location != nil {try container.encode(self.location, forKey: .location)}
    if self.associations != nil {try container.encode(self.associations as! [TopologyAssociationData?]?, forKey: .associations)}
  }
}

extension DataFactory {
  public static func createTopologyResourceProtocol() -> TopologyResourceProtocol {
    return TopologyResourceData()
  }
}


// TransportProtocol enumerates the values for transport protocol.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum TransportProtocolEnum: String, Codable
{
// TransportProtocolAll specifies the transport protocol all state for transport protocol.
    case TransportProtocolAll = "All"
// TransportProtocolTcp specifies the transport protocol tcp state for transport protocol.
    case TransportProtocolTcp = "Tcp"
// TransportProtocolUdp specifies the transport protocol udp state for transport protocol.
    case TransportProtocolUdp = "Udp"
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct TroubleshootingDetailsData : TroubleshootingDetailsProtocol {
    public var id: String?
    public var reasonType: String?
    public var summary: String?
    public var detail: String?
    public var recommendedActions: [TroubleshootingRecommendedActionsProtocol?]?

        enum CodingKeys: String, CodingKey {case id = "id"
        case reasonType = "reasonType"
        case summary = "summary"
        case detail = "detail"
        case recommendedActions = "recommendedActions"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.id) {
        self.id = try container.decode(String?.self, forKey: .id)
    }
    if container.contains(.reasonType) {
        self.reasonType = try container.decode(String?.self, forKey: .reasonType)
    }
    if container.contains(.summary) {
        self.summary = try container.decode(String?.self, forKey: .summary)
    }
    if container.contains(.detail) {
        self.detail = try container.decode(String?.self, forKey: .detail)
    }
    if container.contains(.recommendedActions) {
        self.recommendedActions = try container.decode([TroubleshootingRecommendedActionsData?]?.self, forKey: .recommendedActions)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.id != nil {try container.encode(self.id, forKey: .id)}
    if self.reasonType != nil {try container.encode(self.reasonType, forKey: .reasonType)}
    if self.summary != nil {try container.encode(self.summary, forKey: .summary)}
    if self.detail != nil {try container.encode(self.detail, forKey: .detail)}
    if self.recommendedActions != nil {try container.encode(self.recommendedActions as! [TroubleshootingRecommendedActionsData?]?, forKey: .recommendedActions)}
  }
}

extension DataFactory {
  public static func createTroubleshootingDetailsProtocol() -> TroubleshootingDetailsProtocol {
    return TroubleshootingDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct TroubleshootingParametersData : TroubleshootingParametersProtocol {
    public var targetResourceId: String
    public var properties: TroubleshootingPropertiesProtocol

        enum CodingKeys: String, CodingKey {case targetResourceId = "targetResourceId"
        case properties = "properties"
        }

  public init(targetResourceId: String, properties: TroubleshootingPropertiesProtocol)  {
    self.targetResourceId = targetResourceId
    self.properties = properties
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.targetResourceId = try container.decode(String.self, forKey: .targetResourceId)
    self.properties = try container.decode(TroubleshootingPropertiesData.self, forKey: .properties)
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.targetResourceId, forKey: .targetResourceId)
    try container.encode(self.properties as! TroubleshootingPropertiesData, forKey: .properties)
  }
}

extension DataFactory {
  public static func createTroubleshootingParametersProtocol(targetResourceId: String, properties: TroubleshootingPropertiesProtocol) -> TroubleshootingParametersProtocol {
    return TroubleshootingParametersData(targetResourceId: targetResourceId, properties: properties)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct TroubleshootingPropertiesData : TroubleshootingPropertiesProtocol {
    public var storageId: String
    public var storagePath: String

        enum CodingKeys: String, CodingKey {case storageId = "storageId"
        case storagePath = "storagePath"
        }

  public init(storageId: String, storagePath: String)  {
    self.storageId = storageId
    self.storagePath = storagePath
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.storageId = try container.decode(String.self, forKey: .storageId)
    self.storagePath = try container.decode(String.self, forKey: .storagePath)
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.storageId, forKey: .storageId)
    try container.encode(self.storagePath, forKey: .storagePath)
  }
}

extension DataFactory {
  public static func createTroubleshootingPropertiesProtocol(storageId: String, storagePath: String) -> TroubleshootingPropertiesProtocol {
    return TroubleshootingPropertiesData(storageId: storageId, storagePath: storagePath)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct TroubleshootingRecommendedActionsData : TroubleshootingRecommendedActionsProtocol {
    public var actionId: String?
    public var actionText: String?
    public var actionUri: String?
    public var actionUriText: String?

        enum CodingKeys: String, CodingKey {case actionId = "actionId"
        case actionText = "actionText"
        case actionUri = "actionUri"
        case actionUriText = "actionUriText"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.actionId) {
        self.actionId = try container.decode(String?.self, forKey: .actionId)
    }
    if container.contains(.actionText) {
        self.actionText = try container.decode(String?.self, forKey: .actionText)
    }
    if container.contains(.actionUri) {
        self.actionUri = try container.decode(String?.self, forKey: .actionUri)
    }
    if container.contains(.actionUriText) {
        self.actionUriText = try container.decode(String?.self, forKey: .actionUriText)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.actionId != nil {try container.encode(self.actionId, forKey: .actionId)}
    if self.actionText != nil {try container.encode(self.actionText, forKey: .actionText)}
    if self.actionUri != nil {try container.encode(self.actionUri, forKey: .actionUri)}
    if self.actionUriText != nil {try container.encode(self.actionUriText, forKey: .actionUriText)}
  }
}

extension DataFactory {
  public static func createTroubleshootingRecommendedActionsProtocol() -> TroubleshootingRecommendedActionsProtocol {
    return TroubleshootingRecommendedActionsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct TroubleshootingResultData : TroubleshootingResultProtocol {
    public var startTime: Date?
    public var endTime: Date?
    public var code: String?
    public var results: [TroubleshootingDetailsProtocol?]?

        enum CodingKeys: String, CodingKey {case startTime = "startTime"
        case endTime = "endTime"
        case code = "code"
        case results = "results"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.startTime) {
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)
    }
    if container.contains(.endTime) {
        self.endTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .endTime)), format: .dateTime)
    }
    if container.contains(.code) {
        self.code = try container.decode(String?.self, forKey: .code)
    }
    if container.contains(.results) {
        self.results = try container.decode([TroubleshootingDetailsData?]?.self, forKey: .results)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.startTime != nil {
        try container.encode(DateConverter.toString(date: self.startTime!, format: .dateTime), forKey: .startTime)
    }
    if self.endTime != nil {
        try container.encode(DateConverter.toString(date: self.endTime!, format: .dateTime), forKey: .endTime)
    }
    if self.code != nil {try container.encode(self.code, forKey: .code)}
    if self.results != nil {try container.encode(self.results as! [TroubleshootingDetailsData?]?, forKey: .results)}
  }
}

extension DataFactory {
  public static func createTroubleshootingResultProtocol() -> TroubleshootingResultProtocol {
    return TroubleshootingResultData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct TunnelConnectionHealthData : TunnelConnectionHealthProtocol {
    public var tunnel: String?
    public var connectionStatus: VirtualNetworkGatewayConnectionStatusEnum?
    public var ingressBytesTransferred: Int64?
    public var egressBytesTransferred: Int64?
    public var lastConnectionEstablishedUtcTime: String?

        enum CodingKeys: String, CodingKey {case tunnel = "tunnel"
        case connectionStatus = "connectionStatus"
        case ingressBytesTransferred = "ingressBytesTransferred"
        case egressBytesTransferred = "egressBytesTransferred"
        case lastConnectionEstablishedUtcTime = "lastConnectionEstablishedUtcTime"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.tunnel) {
        self.tunnel = try container.decode(String?.self, forKey: .tunnel)
    }
    if container.contains(.connectionStatus) {
        self.connectionStatus = try container.decode(VirtualNetworkGatewayConnectionStatusEnum?.self, forKey: .connectionStatus)
    }
    if container.contains(.ingressBytesTransferred) {
        self.ingressBytesTransferred = try container.decode(Int64?.self, forKey: .ingressBytesTransferred)
    }
    if container.contains(.egressBytesTransferred) {
        self.egressBytesTransferred = try container.decode(Int64?.self, forKey: .egressBytesTransferred)
    }
    if container.contains(.lastConnectionEstablishedUtcTime) {
        self.lastConnectionEstablishedUtcTime = try container.decode(String?.self, forKey: .lastConnectionEstablishedUtcTime)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.tunnel != nil {try container.encode(self.tunnel, forKey: .tunnel)}
    if self.connectionStatus != nil {try container.encode(self.connectionStatus, forKey: .connectionStatus)}
    if self.ingressBytesTransferred != nil {try container.encode(self.ingressBytesTransferred, forKey: .ingressBytesTransferred)}
    if self.egressBytesTransferred != nil {try container.encode(self.egressBytesTransferred, forKey: .egressBytesTransferred)}
    if self.lastConnectionEstablishedUtcTime != nil {try container.encode(self.lastConnectionEstablishedUtcTime, forKey: .lastConnectionEstablishedUtcTime)}
  }
}

extension DataFactory {
  public static func createTunnelConnectionHealthProtocol() -> TunnelConnectionHealthProtocol {
    return TunnelConnectionHealthData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct UsageData : UsageProtocol {
    public var id: String?
    public var unit: String
    public var currentValue: Int64
    public var limit: Int64
    public var name: UsageNameProtocol

        enum CodingKeys: String, CodingKey {case id = "id"
        case unit = "unit"
        case currentValue = "currentValue"
        case limit = "limit"
        case name = "name"
        }

  public init(unit: String, currentValue: Int64, limit: Int64, name: UsageNameProtocol)  {
    self.unit = unit
    self.currentValue = currentValue
    self.limit = limit
    self.name = name
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.id) {
        self.id = try container.decode(String?.self, forKey: .id)
    }
    self.unit = try container.decode(String.self, forKey: .unit)
    self.currentValue = try container.decode(Int64.self, forKey: .currentValue)
    self.limit = try container.decode(Int64.self, forKey: .limit)
    self.name = try container.decode(UsageNameData.self, forKey: .name)
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.id != nil {try container.encode(self.id, forKey: .id)}
    try container.encode(self.unit, forKey: .unit)
    try container.encode(self.currentValue, forKey: .currentValue)
    try container.encode(self.limit, forKey: .limit)
    try container.encode(self.name as! UsageNameData, forKey: .name)
  }
}

extension DataFactory {
  public static func createUsageProtocol(unit: String, currentValue: Int64, limit: Int64, name: UsageNameProtocol) -> UsageProtocol {
    return UsageData(unit: unit, currentValue: currentValue, limit: limit, name: name)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct UsageNameData : UsageNameProtocol {
    public var value: String?
    public var localizedValue: String?

        enum CodingKeys: String, CodingKey {case value = "value"
        case localizedValue = "localizedValue"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.value) {
        self.value = try container.decode(String?.self, forKey: .value)
    }
    if container.contains(.localizedValue) {
        self.localizedValue = try container.decode(String?.self, forKey: .localizedValue)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.value != nil {try container.encode(self.value, forKey: .value)}
    if self.localizedValue != nil {try container.encode(self.localizedValue, forKey: .localizedValue)}
  }
}

extension DataFactory {
  public static func createUsageNameProtocol() -> UsageNameProtocol {
    return UsageNameData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct UsagesListResultData : UsagesListResultProtocol {
    public var value: [UsageProtocol?]?
    public var _nextLink: String?

        enum CodingKeys: String, CodingKey {case value = "value"
        case _nextLink = "nextLink"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.value) {
        self.value = try container.decode([UsageData?]?.self, forKey: .value)
    }
    if container.contains(._nextLink) {
        self._nextLink = try container.decode(String?.self, forKey: ._nextLink)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.value != nil {try container.encode(self.value as! [UsageData?]?, forKey: .value)}
    if self._nextLink != nil {try container.encode(self._nextLink, forKey: ._nextLink)}
  }
}

extension DataFactory {
  public static func createUsagesListResultProtocol() -> UsagesListResultProtocol {
    return UsagesListResultData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct VerificationIPFlowParametersData : VerificationIPFlowParametersProtocol {
    public var targetResourceId: String
    public var direction: DirectionEnum
    public var _protocol: ProtocolEnum
    public var localPort: String
    public var remotePort: String
    public var localIPAddress: String
    public var remoteIPAddress: String
    public var targetNicResourceId: String?

        enum CodingKeys: String, CodingKey {case targetResourceId = "targetResourceId"
        case direction = "direction"
        case _protocol = "protocol"
        case localPort = "localPort"
        case remotePort = "remotePort"
        case localIPAddress = "localIPAddress"
        case remoteIPAddress = "remoteIPAddress"
        case targetNicResourceId = "targetNicResourceId"
        }

  public init(targetResourceId: String, direction: DirectionEnum, _protocol: ProtocolEnum, localPort: String, remotePort: String, localIPAddress: String, remoteIPAddress: String)  {
    self.targetResourceId = targetResourceId
    self.direction = direction
    self._protocol = _protocol
    self.localPort = localPort
    self.remotePort = remotePort
    self.localIPAddress = localIPAddress
    self.remoteIPAddress = remoteIPAddress
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.targetResourceId = try container.decode(String.self, forKey: .targetResourceId)
    self.direction = try container.decode(DirectionEnum.self, forKey: .direction)
    self._protocol = try container.decode(ProtocolEnum.self, forKey: ._protocol)
    self.localPort = try container.decode(String.self, forKey: .localPort)
    self.remotePort = try container.decode(String.self, forKey: .remotePort)
    self.localIPAddress = try container.decode(String.self, forKey: .localIPAddress)
    self.remoteIPAddress = try container.decode(String.self, forKey: .remoteIPAddress)
    if container.contains(.targetNicResourceId) {
        self.targetNicResourceId = try container.decode(String?.self, forKey: .targetNicResourceId)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.targetResourceId, forKey: .targetResourceId)
    try container.encode(self.direction, forKey: .direction)
    try container.encode(self._protocol, forKey: ._protocol)
    try container.encode(self.localPort, forKey: .localPort)
    try container.encode(self.remotePort, forKey: .remotePort)
    try container.encode(self.localIPAddress, forKey: .localIPAddress)
    try container.encode(self.remoteIPAddress, forKey: .remoteIPAddress)
    if self.targetNicResourceId != nil {try container.encode(self.targetNicResourceId, forKey: .targetNicResourceId)}
  }
}

extension DataFactory {
  public static func createVerificationIPFlowParametersProtocol(targetResourceId: String, direction: DirectionEnum, _protocol: ProtocolEnum, localPort: String, remotePort: String, localIPAddress: String, remoteIPAddress: String) -> VerificationIPFlowParametersProtocol {
    return VerificationIPFlowParametersData(targetResourceId: targetResourceId, direction: direction, _protocol: _protocol, localPort: localPort, remotePort: remotePort, localIPAddress: localIPAddress, remoteIPAddress: remoteIPAddress)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct VerificationIPFlowResultData : VerificationIPFlowResultProtocol {
    public var access: AccessEnum?
    public var ruleName: String?

        enum CodingKeys: String, CodingKey {case access = "access"
        case ruleName = "ruleName"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.access) {
        self.access = try container.decode(AccessEnum?.self, forKey: .access)
    }
    if container.contains(.ruleName) {
        self.ruleName = try container.decode(String?.self, forKey: .ruleName)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.access != nil {try container.encode(self.access, forKey: .access)}
    if self.ruleName != nil {try container.encode(self.ruleName, forKey: .ruleName)}
  }
}

extension DataFactory {
  public static func createVerificationIPFlowResultProtocol() -> VerificationIPFlowResultProtocol {
    return VerificationIPFlowResultData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct VirtualNetworkConnectionGatewayReferenceData : VirtualNetworkConnectionGatewayReferenceProtocol {
    public var id: String

        enum CodingKeys: String, CodingKey {case id = "id"
        }

  public init(id: String)  {
    self.id = id
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.id = try container.decode(String.self, forKey: .id)
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.id, forKey: .id)
  }
}

extension DataFactory {
  public static func createVirtualNetworkConnectionGatewayReferenceProtocol(id: String) -> VirtualNetworkConnectionGatewayReferenceProtocol {
    return VirtualNetworkConnectionGatewayReferenceData(id: id)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct VirtualNetworkData : VirtualNetworkProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?
    public var properties: VirtualNetworkPropertiesFormatProtocol?
    public var etag: String?

        enum CodingKeys: String, CodingKey {case id = "id"
        case name = "name"
        case type = "type"
        case location = "location"
        case tags = "tags"
        case properties = "properties"
        case etag = "etag"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.id) {
        self.id = try container.decode(String?.self, forKey: .id)
    }
    if container.contains(.name) {
        self.name = try container.decode(String?.self, forKey: .name)
    }
    if container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    if container.contains(.location) {
        self.location = try container.decode(String?.self, forKey: .location)
    }
    if container.contains(.tags) {
        self.tags = try container.decode([String:String]?.self, forKey: .tags)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(VirtualNetworkPropertiesFormatData?.self, forKey: .properties)
    }
    if container.contains(.etag) {
        self.etag = try container.decode(String?.self, forKey: .etag)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.id != nil {try container.encode(self.id, forKey: .id)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
    if self.location != nil {try container.encode(self.location, forKey: .location)}
    if self.tags != nil {try container.encode(self.tags, forKey: .tags)}
    if self.properties != nil {try container.encode(self.properties as! VirtualNetworkPropertiesFormatData?, forKey: .properties)}
    if self.etag != nil {try container.encode(self.etag, forKey: .etag)}
  }
}

extension DataFactory {
  public static func createVirtualNetworkProtocol() -> VirtualNetworkProtocol {
    return VirtualNetworkData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct VirtualNetworkGatewayConnectionData : VirtualNetworkGatewayConnectionProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?
    public var properties: VirtualNetworkGatewayConnectionPropertiesFormatProtocol
    public var etag: String?

        enum CodingKeys: String, CodingKey {case id = "id"
        case name = "name"
        case type = "type"
        case location = "location"
        case tags = "tags"
        case properties = "properties"
        case etag = "etag"
        }

  public init(properties: VirtualNetworkGatewayConnectionPropertiesFormatProtocol)  {
    self.properties = properties
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.id) {
        self.id = try container.decode(String?.self, forKey: .id)
    }
    if container.contains(.name) {
        self.name = try container.decode(String?.self, forKey: .name)
    }
    if container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    if container.contains(.location) {
        self.location = try container.decode(String?.self, forKey: .location)
    }
    if container.contains(.tags) {
        self.tags = try container.decode([String:String]?.self, forKey: .tags)
    }
    self.properties = try container.decode(VirtualNetworkGatewayConnectionPropertiesFormatData.self, forKey: .properties)
    if container.contains(.etag) {
        self.etag = try container.decode(String?.self, forKey: .etag)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.id != nil {try container.encode(self.id, forKey: .id)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
    if self.location != nil {try container.encode(self.location, forKey: .location)}
    if self.tags != nil {try container.encode(self.tags, forKey: .tags)}
    try container.encode(self.properties as! VirtualNetworkGatewayConnectionPropertiesFormatData, forKey: .properties)
    if self.etag != nil {try container.encode(self.etag, forKey: .etag)}
  }
}

extension DataFactory {
  public static func createVirtualNetworkGatewayConnectionProtocol(properties: VirtualNetworkGatewayConnectionPropertiesFormatProtocol) -> VirtualNetworkGatewayConnectionProtocol {
    return VirtualNetworkGatewayConnectionData(properties: properties)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct VirtualNetworkGatewayConnectionListEntityData : VirtualNetworkGatewayConnectionListEntityProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?
    public var properties: VirtualNetworkGatewayConnectionListEntityPropertiesFormatProtocol
    public var etag: String?

        enum CodingKeys: String, CodingKey {case id = "id"
        case name = "name"
        case type = "type"
        case location = "location"
        case tags = "tags"
        case properties = "properties"
        case etag = "etag"
        }

  public init(properties: VirtualNetworkGatewayConnectionListEntityPropertiesFormatProtocol)  {
    self.properties = properties
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.id) {
        self.id = try container.decode(String?.self, forKey: .id)
    }
    if container.contains(.name) {
        self.name = try container.decode(String?.self, forKey: .name)
    }
    if container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    if container.contains(.location) {
        self.location = try container.decode(String?.self, forKey: .location)
    }
    if container.contains(.tags) {
        self.tags = try container.decode([String:String]?.self, forKey: .tags)
    }
    self.properties = try container.decode(VirtualNetworkGatewayConnectionListEntityPropertiesFormatData.self, forKey: .properties)
    if container.contains(.etag) {
        self.etag = try container.decode(String?.self, forKey: .etag)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.id != nil {try container.encode(self.id, forKey: .id)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
    if self.location != nil {try container.encode(self.location, forKey: .location)}
    if self.tags != nil {try container.encode(self.tags, forKey: .tags)}
    try container.encode(self.properties as! VirtualNetworkGatewayConnectionListEntityPropertiesFormatData, forKey: .properties)
    if self.etag != nil {try container.encode(self.etag, forKey: .etag)}
  }
}

extension DataFactory {
  public static func createVirtualNetworkGatewayConnectionListEntityProtocol(properties: VirtualNetworkGatewayConnectionListEntityPropertiesFormatProtocol) -> VirtualNetworkGatewayConnectionListEntityProtocol {
    return VirtualNetworkGatewayConnectionListEntityData(properties: properties)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct VirtualNetworkGatewayConnectionListEntityPropertiesFormatData : VirtualNetworkGatewayConnectionListEntityPropertiesFormatProtocol {
    public var authorizationKey: String?
    public var virtualNetworkGateway1: VirtualNetworkConnectionGatewayReferenceProtocol
    public var virtualNetworkGateway2: VirtualNetworkConnectionGatewayReferenceProtocol?
    public var localNetworkGateway2: VirtualNetworkConnectionGatewayReferenceProtocol?
    public var connectionType: VirtualNetworkGatewayConnectionTypeEnum
    public var routingWeight: Int32?
    public var sharedKey: String?
    public var connectionStatus: VirtualNetworkGatewayConnectionStatusEnum?
    public var tunnelConnectionStatus: [TunnelConnectionHealthProtocol?]?
    public var egressBytesTransferred: Int64?
    public var ingressBytesTransferred: Int64?
    public var peer: SubResourceProtocol?
    public var enableBgp: Bool?
    public var usePolicyBasedTrafficSelectors: Bool?
    public var ipsecPolicies: [IpsecPolicyProtocol?]?
    public var resourceGuid: String?
    public var provisioningState: String?

        enum CodingKeys: String, CodingKey {case authorizationKey = "authorizationKey"
        case virtualNetworkGateway1 = "virtualNetworkGateway1"
        case virtualNetworkGateway2 = "virtualNetworkGateway2"
        case localNetworkGateway2 = "localNetworkGateway2"
        case connectionType = "connectionType"
        case routingWeight = "routingWeight"
        case sharedKey = "sharedKey"
        case connectionStatus = "connectionStatus"
        case tunnelConnectionStatus = "tunnelConnectionStatus"
        case egressBytesTransferred = "egressBytesTransferred"
        case ingressBytesTransferred = "ingressBytesTransferred"
        case peer = "peer"
        case enableBgp = "enableBgp"
        case usePolicyBasedTrafficSelectors = "usePolicyBasedTrafficSelectors"
        case ipsecPolicies = "ipsecPolicies"
        case resourceGuid = "resourceGuid"
        case provisioningState = "provisioningState"
        }

  public init(virtualNetworkGateway1: VirtualNetworkConnectionGatewayReferenceProtocol, connectionType: VirtualNetworkGatewayConnectionTypeEnum)  {
    self.virtualNetworkGateway1 = virtualNetworkGateway1
    self.connectionType = connectionType
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.authorizationKey) {
        self.authorizationKey = try container.decode(String?.self, forKey: .authorizationKey)
    }
    self.virtualNetworkGateway1 = try container.decode(VirtualNetworkConnectionGatewayReferenceData.self, forKey: .virtualNetworkGateway1)
    if container.contains(.virtualNetworkGateway2) {
        self.virtualNetworkGateway2 = try container.decode(VirtualNetworkConnectionGatewayReferenceData?.self, forKey: .virtualNetworkGateway2)
    }
    if container.contains(.localNetworkGateway2) {
        self.localNetworkGateway2 = try container.decode(VirtualNetworkConnectionGatewayReferenceData?.self, forKey: .localNetworkGateway2)
    }
    self.connectionType = try container.decode(VirtualNetworkGatewayConnectionTypeEnum.self, forKey: .connectionType)
    if container.contains(.routingWeight) {
        self.routingWeight = try container.decode(Int32?.self, forKey: .routingWeight)
    }
    if container.contains(.sharedKey) {
        self.sharedKey = try container.decode(String?.self, forKey: .sharedKey)
    }
    if container.contains(.connectionStatus) {
        self.connectionStatus = try container.decode(VirtualNetworkGatewayConnectionStatusEnum?.self, forKey: .connectionStatus)
    }
    if container.contains(.tunnelConnectionStatus) {
        self.tunnelConnectionStatus = try container.decode([TunnelConnectionHealthData?]?.self, forKey: .tunnelConnectionStatus)
    }
    if container.contains(.egressBytesTransferred) {
        self.egressBytesTransferred = try container.decode(Int64?.self, forKey: .egressBytesTransferred)
    }
    if container.contains(.ingressBytesTransferred) {
        self.ingressBytesTransferred = try container.decode(Int64?.self, forKey: .ingressBytesTransferred)
    }
    if container.contains(.peer) {
        self.peer = try container.decode(SubResourceData?.self, forKey: .peer)
    }
    if container.contains(.enableBgp) {
        self.enableBgp = try container.decode(Bool?.self, forKey: .enableBgp)
    }
    if container.contains(.usePolicyBasedTrafficSelectors) {
        self.usePolicyBasedTrafficSelectors = try container.decode(Bool?.self, forKey: .usePolicyBasedTrafficSelectors)
    }
    if container.contains(.ipsecPolicies) {
        self.ipsecPolicies = try container.decode([IpsecPolicyData?]?.self, forKey: .ipsecPolicies)
    }
    if container.contains(.resourceGuid) {
        self.resourceGuid = try container.decode(String?.self, forKey: .resourceGuid)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(String?.self, forKey: .provisioningState)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.authorizationKey != nil {try container.encode(self.authorizationKey, forKey: .authorizationKey)}
    try container.encode(self.virtualNetworkGateway1 as! VirtualNetworkConnectionGatewayReferenceData, forKey: .virtualNetworkGateway1)
    if self.virtualNetworkGateway2 != nil {try container.encode(self.virtualNetworkGateway2 as! VirtualNetworkConnectionGatewayReferenceData?, forKey: .virtualNetworkGateway2)}
    if self.localNetworkGateway2 != nil {try container.encode(self.localNetworkGateway2 as! VirtualNetworkConnectionGatewayReferenceData?, forKey: .localNetworkGateway2)}
    try container.encode(self.connectionType, forKey: .connectionType)
    if self.routingWeight != nil {try container.encode(self.routingWeight, forKey: .routingWeight)}
    if self.sharedKey != nil {try container.encode(self.sharedKey, forKey: .sharedKey)}
    if self.connectionStatus != nil {try container.encode(self.connectionStatus, forKey: .connectionStatus)}
    if self.tunnelConnectionStatus != nil {try container.encode(self.tunnelConnectionStatus as! [TunnelConnectionHealthData?]?, forKey: .tunnelConnectionStatus)}
    if self.egressBytesTransferred != nil {try container.encode(self.egressBytesTransferred, forKey: .egressBytesTransferred)}
    if self.ingressBytesTransferred != nil {try container.encode(self.ingressBytesTransferred, forKey: .ingressBytesTransferred)}
    if self.peer != nil {try container.encode(self.peer as! SubResourceData?, forKey: .peer)}
    if self.enableBgp != nil {try container.encode(self.enableBgp, forKey: .enableBgp)}
    if self.usePolicyBasedTrafficSelectors != nil {try container.encode(self.usePolicyBasedTrafficSelectors, forKey: .usePolicyBasedTrafficSelectors)}
    if self.ipsecPolicies != nil {try container.encode(self.ipsecPolicies as! [IpsecPolicyData?]?, forKey: .ipsecPolicies)}
    if self.resourceGuid != nil {try container.encode(self.resourceGuid, forKey: .resourceGuid)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
  }
}

extension DataFactory {
  public static func createVirtualNetworkGatewayConnectionListEntityPropertiesFormatProtocol(virtualNetworkGateway1: VirtualNetworkConnectionGatewayReferenceProtocol, connectionType: VirtualNetworkGatewayConnectionTypeEnum) -> VirtualNetworkGatewayConnectionListEntityPropertiesFormatProtocol {
    return VirtualNetworkGatewayConnectionListEntityPropertiesFormatData(virtualNetworkGateway1: virtualNetworkGateway1, connectionType: connectionType)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct VirtualNetworkGatewayConnectionListResultData : VirtualNetworkGatewayConnectionListResultProtocol {
    public var value: [VirtualNetworkGatewayConnectionProtocol?]?
    public var _nextLink: String?

        enum CodingKeys: String, CodingKey {case value = "value"
        case _nextLink = "nextLink"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.value) {
        self.value = try container.decode([VirtualNetworkGatewayConnectionData?]?.self, forKey: .value)
    }
    if container.contains(._nextLink) {
        self._nextLink = try container.decode(String?.self, forKey: ._nextLink)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.value != nil {try container.encode(self.value as! [VirtualNetworkGatewayConnectionData?]?, forKey: .value)}
    if self._nextLink != nil {try container.encode(self._nextLink, forKey: ._nextLink)}
  }
}

extension DataFactory {
  public static func createVirtualNetworkGatewayConnectionListResultProtocol() -> VirtualNetworkGatewayConnectionListResultProtocol {
    return VirtualNetworkGatewayConnectionListResultData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct VirtualNetworkGatewayConnectionPropertiesFormatData : VirtualNetworkGatewayConnectionPropertiesFormatProtocol {
    public var authorizationKey: String?
    public var virtualNetworkGateway1: VirtualNetworkGatewayProtocol
    public var virtualNetworkGateway2: VirtualNetworkGatewayProtocol?
    public var localNetworkGateway2: LocalNetworkGatewayProtocol?
    public var connectionType: VirtualNetworkGatewayConnectionTypeEnum
    public var routingWeight: Int32?
    public var sharedKey: String?
    public var connectionStatus: VirtualNetworkGatewayConnectionStatusEnum?
    public var tunnelConnectionStatus: [TunnelConnectionHealthProtocol?]?
    public var egressBytesTransferred: Int64?
    public var ingressBytesTransferred: Int64?
    public var peer: SubResourceProtocol?
    public var enableBgp: Bool?
    public var usePolicyBasedTrafficSelectors: Bool?
    public var ipsecPolicies: [IpsecPolicyProtocol?]?
    public var resourceGuid: String?
    public var provisioningState: String?

        enum CodingKeys: String, CodingKey {case authorizationKey = "authorizationKey"
        case virtualNetworkGateway1 = "virtualNetworkGateway1"
        case virtualNetworkGateway2 = "virtualNetworkGateway2"
        case localNetworkGateway2 = "localNetworkGateway2"
        case connectionType = "connectionType"
        case routingWeight = "routingWeight"
        case sharedKey = "sharedKey"
        case connectionStatus = "connectionStatus"
        case tunnelConnectionStatus = "tunnelConnectionStatus"
        case egressBytesTransferred = "egressBytesTransferred"
        case ingressBytesTransferred = "ingressBytesTransferred"
        case peer = "peer"
        case enableBgp = "enableBgp"
        case usePolicyBasedTrafficSelectors = "usePolicyBasedTrafficSelectors"
        case ipsecPolicies = "ipsecPolicies"
        case resourceGuid = "resourceGuid"
        case provisioningState = "provisioningState"
        }

  public init(virtualNetworkGateway1: VirtualNetworkGatewayProtocol, connectionType: VirtualNetworkGatewayConnectionTypeEnum)  {
    self.virtualNetworkGateway1 = virtualNetworkGateway1
    self.connectionType = connectionType
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.authorizationKey) {
        self.authorizationKey = try container.decode(String?.self, forKey: .authorizationKey)
    }
    self.virtualNetworkGateway1 = try container.decode(VirtualNetworkGatewayData.self, forKey: .virtualNetworkGateway1)
    if container.contains(.virtualNetworkGateway2) {
        self.virtualNetworkGateway2 = try container.decode(VirtualNetworkGatewayData?.self, forKey: .virtualNetworkGateway2)
    }
    if container.contains(.localNetworkGateway2) {
        self.localNetworkGateway2 = try container.decode(LocalNetworkGatewayData?.self, forKey: .localNetworkGateway2)
    }
    self.connectionType = try container.decode(VirtualNetworkGatewayConnectionTypeEnum.self, forKey: .connectionType)
    if container.contains(.routingWeight) {
        self.routingWeight = try container.decode(Int32?.self, forKey: .routingWeight)
    }
    if container.contains(.sharedKey) {
        self.sharedKey = try container.decode(String?.self, forKey: .sharedKey)
    }
    if container.contains(.connectionStatus) {
        self.connectionStatus = try container.decode(VirtualNetworkGatewayConnectionStatusEnum?.self, forKey: .connectionStatus)
    }
    if container.contains(.tunnelConnectionStatus) {
        self.tunnelConnectionStatus = try container.decode([TunnelConnectionHealthData?]?.self, forKey: .tunnelConnectionStatus)
    }
    if container.contains(.egressBytesTransferred) {
        self.egressBytesTransferred = try container.decode(Int64?.self, forKey: .egressBytesTransferred)
    }
    if container.contains(.ingressBytesTransferred) {
        self.ingressBytesTransferred = try container.decode(Int64?.self, forKey: .ingressBytesTransferred)
    }
    if container.contains(.peer) {
        self.peer = try container.decode(SubResourceData?.self, forKey: .peer)
    }
    if container.contains(.enableBgp) {
        self.enableBgp = try container.decode(Bool?.self, forKey: .enableBgp)
    }
    if container.contains(.usePolicyBasedTrafficSelectors) {
        self.usePolicyBasedTrafficSelectors = try container.decode(Bool?.self, forKey: .usePolicyBasedTrafficSelectors)
    }
    if container.contains(.ipsecPolicies) {
        self.ipsecPolicies = try container.decode([IpsecPolicyData?]?.self, forKey: .ipsecPolicies)
    }
    if container.contains(.resourceGuid) {
        self.resourceGuid = try container.decode(String?.self, forKey: .resourceGuid)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(String?.self, forKey: .provisioningState)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.authorizationKey != nil {try container.encode(self.authorizationKey, forKey: .authorizationKey)}
    try container.encode(self.virtualNetworkGateway1 as! VirtualNetworkGatewayData, forKey: .virtualNetworkGateway1)
    if self.virtualNetworkGateway2 != nil {try container.encode(self.virtualNetworkGateway2 as! VirtualNetworkGatewayData?, forKey: .virtualNetworkGateway2)}
    if self.localNetworkGateway2 != nil {try container.encode(self.localNetworkGateway2 as! LocalNetworkGatewayData?, forKey: .localNetworkGateway2)}
    try container.encode(self.connectionType, forKey: .connectionType)
    if self.routingWeight != nil {try container.encode(self.routingWeight, forKey: .routingWeight)}
    if self.sharedKey != nil {try container.encode(self.sharedKey, forKey: .sharedKey)}
    if self.connectionStatus != nil {try container.encode(self.connectionStatus, forKey: .connectionStatus)}
    if self.tunnelConnectionStatus != nil {try container.encode(self.tunnelConnectionStatus as! [TunnelConnectionHealthData?]?, forKey: .tunnelConnectionStatus)}
    if self.egressBytesTransferred != nil {try container.encode(self.egressBytesTransferred, forKey: .egressBytesTransferred)}
    if self.ingressBytesTransferred != nil {try container.encode(self.ingressBytesTransferred, forKey: .ingressBytesTransferred)}
    if self.peer != nil {try container.encode(self.peer as! SubResourceData?, forKey: .peer)}
    if self.enableBgp != nil {try container.encode(self.enableBgp, forKey: .enableBgp)}
    if self.usePolicyBasedTrafficSelectors != nil {try container.encode(self.usePolicyBasedTrafficSelectors, forKey: .usePolicyBasedTrafficSelectors)}
    if self.ipsecPolicies != nil {try container.encode(self.ipsecPolicies as! [IpsecPolicyData?]?, forKey: .ipsecPolicies)}
    if self.resourceGuid != nil {try container.encode(self.resourceGuid, forKey: .resourceGuid)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
  }
}

extension DataFactory {
  public static func createVirtualNetworkGatewayConnectionPropertiesFormatProtocol(virtualNetworkGateway1: VirtualNetworkGatewayProtocol, connectionType: VirtualNetworkGatewayConnectionTypeEnum) -> VirtualNetworkGatewayConnectionPropertiesFormatProtocol {
    return VirtualNetworkGatewayConnectionPropertiesFormatData(virtualNetworkGateway1: virtualNetworkGateway1, connectionType: connectionType)
  }
}


// VirtualNetworkGatewayConnectionStatus enumerates the values for virtual network gateway connection status.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum VirtualNetworkGatewayConnectionStatusEnum: String, Codable
{
// VirtualNetworkGatewayConnectionStatusConnected specifies the virtual network gateway connection status connected
// state for virtual network gateway connection status.
    case VirtualNetworkGatewayConnectionStatusConnected = "Connected"
// VirtualNetworkGatewayConnectionStatusConnecting specifies the virtual network gateway connection status connecting
// state for virtual network gateway connection status.
    case VirtualNetworkGatewayConnectionStatusConnecting = "Connecting"
// VirtualNetworkGatewayConnectionStatusNotConnected specifies the virtual network gateway connection status not
// connected state for virtual network gateway connection status.
    case VirtualNetworkGatewayConnectionStatusNotConnected = "NotConnected"
// VirtualNetworkGatewayConnectionStatusUnknown specifies the virtual network gateway connection status unknown state
// for virtual network gateway connection status.
    case VirtualNetworkGatewayConnectionStatusUnknown = "Unknown"
}


// VirtualNetworkGatewayConnectionType enumerates the values for virtual network gateway connection type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum VirtualNetworkGatewayConnectionTypeEnum: String, Codable
{
// ExpressRoute specifies the express route state for virtual network gateway connection type.
    case ExpressRoute = "ExpressRoute"
// IPsec specifies the i psec state for virtual network gateway connection type.
    case IPsec = "IPsec"
// Vnet2Vnet specifies the vnet 2 vnet state for virtual network gateway connection type.
    case Vnet2Vnet = "Vnet2Vnet"
// VPNClient specifies the vpn client state for virtual network gateway connection type.
    case VPNClient = "VPNClient"
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct VirtualNetworkGatewayData : VirtualNetworkGatewayProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?
    public var properties: VirtualNetworkGatewayPropertiesFormatProtocol
    public var etag: String?

        enum CodingKeys: String, CodingKey {case id = "id"
        case name = "name"
        case type = "type"
        case location = "location"
        case tags = "tags"
        case properties = "properties"
        case etag = "etag"
        }

  public init(properties: VirtualNetworkGatewayPropertiesFormatProtocol)  {
    self.properties = properties
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.id) {
        self.id = try container.decode(String?.self, forKey: .id)
    }
    if container.contains(.name) {
        self.name = try container.decode(String?.self, forKey: .name)
    }
    if container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    if container.contains(.location) {
        self.location = try container.decode(String?.self, forKey: .location)
    }
    if container.contains(.tags) {
        self.tags = try container.decode([String:String]?.self, forKey: .tags)
    }
    self.properties = try container.decode(VirtualNetworkGatewayPropertiesFormatData.self, forKey: .properties)
    if container.contains(.etag) {
        self.etag = try container.decode(String?.self, forKey: .etag)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.id != nil {try container.encode(self.id, forKey: .id)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
    if self.location != nil {try container.encode(self.location, forKey: .location)}
    if self.tags != nil {try container.encode(self.tags, forKey: .tags)}
    try container.encode(self.properties as! VirtualNetworkGatewayPropertiesFormatData, forKey: .properties)
    if self.etag != nil {try container.encode(self.etag, forKey: .etag)}
  }
}

extension DataFactory {
  public static func createVirtualNetworkGatewayProtocol(properties: VirtualNetworkGatewayPropertiesFormatProtocol) -> VirtualNetworkGatewayProtocol {
    return VirtualNetworkGatewayData(properties: properties)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct VirtualNetworkGatewayIPConfigurationData : VirtualNetworkGatewayIPConfigurationProtocol, SubResourceProtocol {
    public var id: String?
    public var properties: VirtualNetworkGatewayIPConfigurationPropertiesFormatProtocol?
    public var name: String?
    public var etag: String?

        enum CodingKeys: String, CodingKey {case id = "id"
        case properties = "properties"
        case name = "name"
        case etag = "etag"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.id) {
        self.id = try container.decode(String?.self, forKey: .id)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(VirtualNetworkGatewayIPConfigurationPropertiesFormatData?.self, forKey: .properties)
    }
    if container.contains(.name) {
        self.name = try container.decode(String?.self, forKey: .name)
    }
    if container.contains(.etag) {
        self.etag = try container.decode(String?.self, forKey: .etag)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.id != nil {try container.encode(self.id, forKey: .id)}
    if self.properties != nil {try container.encode(self.properties as! VirtualNetworkGatewayIPConfigurationPropertiesFormatData?, forKey: .properties)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.etag != nil {try container.encode(self.etag, forKey: .etag)}
  }
}

extension DataFactory {
  public static func createVirtualNetworkGatewayIPConfigurationProtocol() -> VirtualNetworkGatewayIPConfigurationProtocol {
    return VirtualNetworkGatewayIPConfigurationData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct VirtualNetworkGatewayIPConfigurationPropertiesFormatData : VirtualNetworkGatewayIPConfigurationPropertiesFormatProtocol {
    public var privateIPAllocationMethod: IPAllocationMethodEnum?
    public var subnet: SubResourceProtocol?
    public var publicIPAddress: SubResourceProtocol?
    public var provisioningState: String?

        enum CodingKeys: String, CodingKey {case privateIPAllocationMethod = "privateIPAllocationMethod"
        case subnet = "subnet"
        case publicIPAddress = "publicIPAddress"
        case provisioningState = "provisioningState"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.privateIPAllocationMethod) {
        self.privateIPAllocationMethod = try container.decode(IPAllocationMethodEnum?.self, forKey: .privateIPAllocationMethod)
    }
    if container.contains(.subnet) {
        self.subnet = try container.decode(SubResourceData?.self, forKey: .subnet)
    }
    if container.contains(.publicIPAddress) {
        self.publicIPAddress = try container.decode(SubResourceData?.self, forKey: .publicIPAddress)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(String?.self, forKey: .provisioningState)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.privateIPAllocationMethod != nil {try container.encode(self.privateIPAllocationMethod, forKey: .privateIPAllocationMethod)}
    if self.subnet != nil {try container.encode(self.subnet as! SubResourceData?, forKey: .subnet)}
    if self.publicIPAddress != nil {try container.encode(self.publicIPAddress as! SubResourceData?, forKey: .publicIPAddress)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
  }
}

extension DataFactory {
  public static func createVirtualNetworkGatewayIPConfigurationPropertiesFormatProtocol() -> VirtualNetworkGatewayIPConfigurationPropertiesFormatProtocol {
    return VirtualNetworkGatewayIPConfigurationPropertiesFormatData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct VirtualNetworkGatewayListConnectionsResultData : VirtualNetworkGatewayListConnectionsResultProtocol {
    public var value: [VirtualNetworkGatewayConnectionListEntityProtocol?]?
    public var _nextLink: String?

        enum CodingKeys: String, CodingKey {case value = "value"
        case _nextLink = "nextLink"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.value) {
        self.value = try container.decode([VirtualNetworkGatewayConnectionListEntityData?]?.self, forKey: .value)
    }
    if container.contains(._nextLink) {
        self._nextLink = try container.decode(String?.self, forKey: ._nextLink)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.value != nil {try container.encode(self.value as! [VirtualNetworkGatewayConnectionListEntityData?]?, forKey: .value)}
    if self._nextLink != nil {try container.encode(self._nextLink, forKey: ._nextLink)}
  }
}

extension DataFactory {
  public static func createVirtualNetworkGatewayListConnectionsResultProtocol() -> VirtualNetworkGatewayListConnectionsResultProtocol {
    return VirtualNetworkGatewayListConnectionsResultData()
  }
}