// 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 ApplicationGatewayAvailableWafRuleSetsResultData : ApplicationGatewayAvailableWafRuleSetsResultProtocol {
    public var value: [ApplicationGatewayFirewallRuleSetProtocol?]?

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

  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([ApplicationGatewayFirewallRuleSetData?]?.self, forKey: .value)
    }
    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! [ApplicationGatewayFirewallRuleSetData?]?, forKey: .value)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayAvailableWafRuleSetsResultProtocol() -> ApplicationGatewayAvailableWafRuleSetsResultProtocol {
    return ApplicationGatewayAvailableWafRuleSetsResultData()
  }
}


// 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 ApplicationGatewayBackendAddressData : ApplicationGatewayBackendAddressProtocol {
    public var fqdn: String?
    public var ipAddress: String?

        enum CodingKeys: String, CodingKey {case fqdn = "fqdn"
        case ipAddress = "ipAddress"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.fqdn) {
        self.fqdn = try container.decode(String?.self, forKey: .fqdn)
    }
    if container.contains(.ipAddress) {
        self.ipAddress = try container.decode(String?.self, forKey: .ipAddress)
    }
    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.fqdn != nil {try container.encode(self.fqdn, forKey: .fqdn)}
    if self.ipAddress != nil {try container.encode(self.ipAddress, forKey: .ipAddress)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayBackendAddressProtocol() -> ApplicationGatewayBackendAddressProtocol {
    return ApplicationGatewayBackendAddressData()
  }
}


// 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 ApplicationGatewayBackendAddressPoolData : ApplicationGatewayBackendAddressPoolProtocol, SubResourceProtocol {
    public var id: String?
    public var properties: ApplicationGatewayBackendAddressPoolPropertiesFormatProtocol?
    public var name: String?
    public var etag: String?
    public var type: String?

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

  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(ApplicationGatewayBackendAddressPoolPropertiesFormatData?.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 container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    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! ApplicationGatewayBackendAddressPoolPropertiesFormatData?, forKey: .properties)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.etag != nil {try container.encode(self.etag, forKey: .etag)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayBackendAddressPoolProtocol() -> ApplicationGatewayBackendAddressPoolProtocol {
    return ApplicationGatewayBackendAddressPoolData()
  }
}


// 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 ApplicationGatewayBackendAddressPoolPropertiesFormatData : ApplicationGatewayBackendAddressPoolPropertiesFormatProtocol {
    public var backendIPConfigurations: [NetworkInterfaceIPConfigurationProtocol?]?
    public var backendAddresses: [ApplicationGatewayBackendAddressProtocol?]?
    public var provisioningState: String?

        enum CodingKeys: String, CodingKey {case backendIPConfigurations = "backendIPConfigurations"
        case backendAddresses = "backendAddresses"
        case provisioningState = "provisioningState"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.backendIPConfigurations) {
        self.backendIPConfigurations = try container.decode([NetworkInterfaceIPConfigurationData?]?.self, forKey: .backendIPConfigurations)
    }
    if container.contains(.backendAddresses) {
        self.backendAddresses = try container.decode([ApplicationGatewayBackendAddressData?]?.self, forKey: .backendAddresses)
    }
    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.backendIPConfigurations != nil {try container.encode(self.backendIPConfigurations as! [NetworkInterfaceIPConfigurationData?]?, forKey: .backendIPConfigurations)}
    if self.backendAddresses != nil {try container.encode(self.backendAddresses as! [ApplicationGatewayBackendAddressData?]?, forKey: .backendAddresses)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayBackendAddressPoolPropertiesFormatProtocol() -> ApplicationGatewayBackendAddressPoolPropertiesFormatProtocol {
    return ApplicationGatewayBackendAddressPoolPropertiesFormatData()
  }
}


// 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 ApplicationGatewayBackendHealthData : ApplicationGatewayBackendHealthProtocol {
    public var backendAddressPools: [ApplicationGatewayBackendHealthPoolProtocol?]?

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

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.backendAddressPools) {
        self.backendAddressPools = try container.decode([ApplicationGatewayBackendHealthPoolData?]?.self, forKey: .backendAddressPools)
    }
    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.backendAddressPools != nil {try container.encode(self.backendAddressPools as! [ApplicationGatewayBackendHealthPoolData?]?, forKey: .backendAddressPools)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayBackendHealthProtocol() -> ApplicationGatewayBackendHealthProtocol {
    return ApplicationGatewayBackendHealthData()
  }
}


// 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 ApplicationGatewayBackendHealthHttpSettingsData : ApplicationGatewayBackendHealthHttpSettingsProtocol {
    public var backendHttpSettings: ApplicationGatewayBackendHttpSettingsProtocol?
    public var servers: [ApplicationGatewayBackendHealthServerProtocol?]?

        enum CodingKeys: String, CodingKey {case backendHttpSettings = "backendHttpSettings"
        case servers = "servers"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.backendHttpSettings) {
        self.backendHttpSettings = try container.decode(ApplicationGatewayBackendHttpSettingsData?.self, forKey: .backendHttpSettings)
    }
    if container.contains(.servers) {
        self.servers = try container.decode([ApplicationGatewayBackendHealthServerData?]?.self, forKey: .servers)
    }
    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.backendHttpSettings != nil {try container.encode(self.backendHttpSettings as! ApplicationGatewayBackendHttpSettingsData?, forKey: .backendHttpSettings)}
    if self.servers != nil {try container.encode(self.servers as! [ApplicationGatewayBackendHealthServerData?]?, forKey: .servers)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayBackendHealthHttpSettingsProtocol() -> ApplicationGatewayBackendHealthHttpSettingsProtocol {
    return ApplicationGatewayBackendHealthHttpSettingsData()
  }
}


// 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 ApplicationGatewayBackendHealthPoolData : ApplicationGatewayBackendHealthPoolProtocol {
    public var backendAddressPool: ApplicationGatewayBackendAddressPoolProtocol?
    public var backendHttpSettingsCollection: [ApplicationGatewayBackendHealthHttpSettingsProtocol?]?

        enum CodingKeys: String, CodingKey {case backendAddressPool = "backendAddressPool"
        case backendHttpSettingsCollection = "backendHttpSettingsCollection"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.backendAddressPool) {
        self.backendAddressPool = try container.decode(ApplicationGatewayBackendAddressPoolData?.self, forKey: .backendAddressPool)
    }
    if container.contains(.backendHttpSettingsCollection) {
        self.backendHttpSettingsCollection = try container.decode([ApplicationGatewayBackendHealthHttpSettingsData?]?.self, forKey: .backendHttpSettingsCollection)
    }
    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.backendAddressPool != nil {try container.encode(self.backendAddressPool as! ApplicationGatewayBackendAddressPoolData?, forKey: .backendAddressPool)}
    if self.backendHttpSettingsCollection != nil {try container.encode(self.backendHttpSettingsCollection as! [ApplicationGatewayBackendHealthHttpSettingsData?]?, forKey: .backendHttpSettingsCollection)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayBackendHealthPoolProtocol() -> ApplicationGatewayBackendHealthPoolProtocol {
    return ApplicationGatewayBackendHealthPoolData()
  }
}


// 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 ApplicationGatewayBackendHealthServerData : ApplicationGatewayBackendHealthServerProtocol {
    public var address: String?
    public var ipConfiguration: NetworkInterfaceIPConfigurationProtocol?
    public var health: ApplicationGatewayBackendHealthServerHealthEnum?

        enum CodingKeys: String, CodingKey {case address = "address"
        case ipConfiguration = "ipConfiguration"
        case health = "health"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.address) {
        self.address = try container.decode(String?.self, forKey: .address)
    }
    if container.contains(.ipConfiguration) {
        self.ipConfiguration = try container.decode(NetworkInterfaceIPConfigurationData?.self, forKey: .ipConfiguration)
    }
    if container.contains(.health) {
        self.health = try container.decode(ApplicationGatewayBackendHealthServerHealthEnum?.self, forKey: .health)
    }
    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.address != nil {try container.encode(self.address, forKey: .address)}
    if self.ipConfiguration != nil {try container.encode(self.ipConfiguration as! NetworkInterfaceIPConfigurationData?, forKey: .ipConfiguration)}
    if self.health != nil {try container.encode(self.health, forKey: .health)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayBackendHealthServerProtocol() -> ApplicationGatewayBackendHealthServerProtocol {
    return ApplicationGatewayBackendHealthServerData()
  }
}


// ApplicationGatewayBackendHealthServerHealth enumerates the values for application gateway backend health server
// health.

// 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 ApplicationGatewayBackendHealthServerHealthEnum: String, Codable
{
// Down specifies the down state for application gateway backend health server health.
    case Down = "Down"
// Draining specifies the draining state for application gateway backend health server health.
    case Draining = "Draining"
// Partial specifies the partial state for application gateway backend health server health.
    case Partial = "Partial"
// Unknown specifies the unknown state for application gateway backend health server health.
    case Unknown = "Unknown"
// Up specifies the up state for application gateway backend health server health.
    case Up = "Up"
}


// 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 ApplicationGatewayBackendHttpSettingsData : ApplicationGatewayBackendHttpSettingsProtocol, SubResourceProtocol {
    public var id: String?
    public var properties: ApplicationGatewayBackendHttpSettingsPropertiesFormatProtocol?
    public var name: String?
    public var etag: String?
    public var type: String?

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

  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(ApplicationGatewayBackendHttpSettingsPropertiesFormatData?.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 container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    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! ApplicationGatewayBackendHttpSettingsPropertiesFormatData?, forKey: .properties)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.etag != nil {try container.encode(self.etag, forKey: .etag)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayBackendHttpSettingsProtocol() -> ApplicationGatewayBackendHttpSettingsProtocol {
    return ApplicationGatewayBackendHttpSettingsData()
  }
}


// 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 ApplicationGatewayBackendHttpSettingsPropertiesFormatData : ApplicationGatewayBackendHttpSettingsPropertiesFormatProtocol {
    public var port: Int32?
    public var _protocol: ApplicationGatewayProtocolEnum?
    public var cookieBasedAffinity: ApplicationGatewayCookieBasedAffinityEnum?
    public var requestTimeout: Int32?
    public var probe: SubResourceProtocol?
    public var authenticationCertificates: [SubResourceProtocol?]?
    public var connectionDraining: ApplicationGatewayConnectionDrainingProtocol?
    public var hostName: String?
    public var pickHostNameFromBackendAddress: Bool?
    public var affinityCookieName: String?
    public var probeEnabled: Bool?
    public var path: String?
    public var provisioningState: String?

        enum CodingKeys: String, CodingKey {case port = "port"
        case _protocol = "protocol"
        case cookieBasedAffinity = "cookieBasedAffinity"
        case requestTimeout = "requestTimeout"
        case probe = "probe"
        case authenticationCertificates = "authenticationCertificates"
        case connectionDraining = "connectionDraining"
        case hostName = "hostName"
        case pickHostNameFromBackendAddress = "pickHostNameFromBackendAddress"
        case affinityCookieName = "affinityCookieName"
        case probeEnabled = "probeEnabled"
        case path = "path"
        case provisioningState = "provisioningState"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.port) {
        self.port = try container.decode(Int32?.self, forKey: .port)
    }
    if container.contains(._protocol) {
        self._protocol = try container.decode(ApplicationGatewayProtocolEnum?.self, forKey: ._protocol)
    }
    if container.contains(.cookieBasedAffinity) {
        self.cookieBasedAffinity = try container.decode(ApplicationGatewayCookieBasedAffinityEnum?.self, forKey: .cookieBasedAffinity)
    }
    if container.contains(.requestTimeout) {
        self.requestTimeout = try container.decode(Int32?.self, forKey: .requestTimeout)
    }
    if container.contains(.probe) {
        self.probe = try container.decode(SubResourceData?.self, forKey: .probe)
    }
    if container.contains(.authenticationCertificates) {
        self.authenticationCertificates = try container.decode([SubResourceData?]?.self, forKey: .authenticationCertificates)
    }
    if container.contains(.connectionDraining) {
        self.connectionDraining = try container.decode(ApplicationGatewayConnectionDrainingData?.self, forKey: .connectionDraining)
    }
    if container.contains(.hostName) {
        self.hostName = try container.decode(String?.self, forKey: .hostName)
    }
    if container.contains(.pickHostNameFromBackendAddress) {
        self.pickHostNameFromBackendAddress = try container.decode(Bool?.self, forKey: .pickHostNameFromBackendAddress)
    }
    if container.contains(.affinityCookieName) {
        self.affinityCookieName = try container.decode(String?.self, forKey: .affinityCookieName)
    }
    if container.contains(.probeEnabled) {
        self.probeEnabled = try container.decode(Bool?.self, forKey: .probeEnabled)
    }
    if container.contains(.path) {
        self.path = try container.decode(String?.self, forKey: .path)
    }
    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.port != nil {try container.encode(self.port, forKey: .port)}
    if self._protocol != nil {try container.encode(self._protocol, forKey: ._protocol)}
    if self.cookieBasedAffinity != nil {try container.encode(self.cookieBasedAffinity, forKey: .cookieBasedAffinity)}
    if self.requestTimeout != nil {try container.encode(self.requestTimeout, forKey: .requestTimeout)}
    if self.probe != nil {try container.encode(self.probe as! SubResourceData?, forKey: .probe)}
    if self.authenticationCertificates != nil {try container.encode(self.authenticationCertificates as! [SubResourceData?]?, forKey: .authenticationCertificates)}
    if self.connectionDraining != nil {try container.encode(self.connectionDraining as! ApplicationGatewayConnectionDrainingData?, forKey: .connectionDraining)}
    if self.hostName != nil {try container.encode(self.hostName, forKey: .hostName)}
    if self.pickHostNameFromBackendAddress != nil {try container.encode(self.pickHostNameFromBackendAddress, forKey: .pickHostNameFromBackendAddress)}
    if self.affinityCookieName != nil {try container.encode(self.affinityCookieName, forKey: .affinityCookieName)}
    if self.probeEnabled != nil {try container.encode(self.probeEnabled, forKey: .probeEnabled)}
    if self.path != nil {try container.encode(self.path, forKey: .path)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayBackendHttpSettingsPropertiesFormatProtocol() -> ApplicationGatewayBackendHttpSettingsPropertiesFormatProtocol {
    return ApplicationGatewayBackendHttpSettingsPropertiesFormatData()
  }
}


// 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 ApplicationGatewayConnectionDrainingData : ApplicationGatewayConnectionDrainingProtocol {
    public var enabled: Bool
    public var drainTimeoutInSec: Int32

        enum CodingKeys: String, CodingKey {case enabled = "enabled"
        case drainTimeoutInSec = "drainTimeoutInSec"
        }

  public init(enabled: Bool, drainTimeoutInSec: Int32)  {
    self.enabled = enabled
    self.drainTimeoutInSec = drainTimeoutInSec
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.enabled = try container.decode(Bool.self, forKey: .enabled)
    self.drainTimeoutInSec = try container.decode(Int32.self, forKey: .drainTimeoutInSec)
    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.enabled, forKey: .enabled)
    try container.encode(self.drainTimeoutInSec, forKey: .drainTimeoutInSec)
  }
}

extension DataFactory {
  public static func createApplicationGatewayConnectionDrainingProtocol(enabled: Bool, drainTimeoutInSec: Int32) -> ApplicationGatewayConnectionDrainingProtocol {
    return ApplicationGatewayConnectionDrainingData(enabled: enabled, drainTimeoutInSec: drainTimeoutInSec)
  }
}


// ApplicationGatewayCookieBasedAffinity enumerates the values for application gateway cookie based affinity.

// 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 ApplicationGatewayCookieBasedAffinityEnum: String, Codable
{
// Disabled specifies the disabled state for application gateway cookie based affinity.
    case Disabled = "Disabled"
// Enabled specifies the enabled state for application gateway cookie based affinity.
    case Enabled = "Enabled"
}


// 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 ApplicationGatewayData : ApplicationGatewayProtocol, 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: ApplicationGatewayPropertiesFormatProtocol?
    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(ApplicationGatewayPropertiesFormatData?.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! ApplicationGatewayPropertiesFormatData?, forKey: .properties)}
    if self.etag != nil {try container.encode(self.etag, forKey: .etag)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayProtocol() -> ApplicationGatewayProtocol {
    return ApplicationGatewayData()
  }
}


// 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 ApplicationGatewayFirewallDisabledRuleGroupData : ApplicationGatewayFirewallDisabledRuleGroupProtocol {
    public var ruleGroupName: String
    public var rules: [Int32]?

        enum CodingKeys: String, CodingKey {case ruleGroupName = "ruleGroupName"
        case rules = "rules"
        }

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

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.ruleGroupName = try container.decode(String.self, forKey: .ruleGroupName)
    if container.contains(.rules) {
        self.rules = try container.decode([Int32]?.self, forKey: .rules)
    }
    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.ruleGroupName, forKey: .ruleGroupName)
    if self.rules != nil {try container.encode(self.rules as! [Int32]?, forKey: .rules)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayFirewallDisabledRuleGroupProtocol(ruleGroupName: String) -> ApplicationGatewayFirewallDisabledRuleGroupProtocol {
    return ApplicationGatewayFirewallDisabledRuleGroupData(ruleGroupName: ruleGroupName)
  }
}


// ApplicationGatewayFirewallMode enumerates the values for application gateway firewall mode.

// 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 ApplicationGatewayFirewallModeEnum: String, Codable
{
// Detection specifies the detection state for application gateway firewall mode.
    case Detection = "Detection"
// Prevention specifies the prevention state for application gateway firewall mode.
    case Prevention = "Prevention"
}


// 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 ApplicationGatewayFirewallRuleData : ApplicationGatewayFirewallRuleProtocol {
    public var ruleId: Int32
    public var description: String?

        enum CodingKeys: String, CodingKey {case ruleId = "ruleId"
        case description = "description"
        }

  public init(ruleId: Int32)  {
    self.ruleId = ruleId
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.ruleId = try container.decode(Int32.self, forKey: .ruleId)
    if container.contains(.description) {
        self.description = try container.decode(String?.self, forKey: .description)
    }
    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.ruleId, forKey: .ruleId)
    if self.description != nil {try container.encode(self.description, forKey: .description)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayFirewallRuleProtocol(ruleId: Int32) -> ApplicationGatewayFirewallRuleProtocol {
    return ApplicationGatewayFirewallRuleData(ruleId: ruleId)
  }
}


// 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 ApplicationGatewayFirewallRuleGroupData : ApplicationGatewayFirewallRuleGroupProtocol {
    public var ruleGroupName: String
    public var description: String?
    public var rules: [ApplicationGatewayFirewallRuleProtocol]

        enum CodingKeys: String, CodingKey {case ruleGroupName = "ruleGroupName"
        case description = "description"
        case rules = "rules"
        }

  public init(ruleGroupName: String, rules: [ApplicationGatewayFirewallRuleProtocol])  {
    self.ruleGroupName = ruleGroupName
    self.rules = rules
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.ruleGroupName = try container.decode(String.self, forKey: .ruleGroupName)
    if container.contains(.description) {
        self.description = try container.decode(String?.self, forKey: .description)
    }
    self.rules = try container.decode([ApplicationGatewayFirewallRuleData].self, forKey: .rules)
    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.ruleGroupName, forKey: .ruleGroupName)
    if self.description != nil {try container.encode(self.description, forKey: .description)}
    try container.encode(self.rules as! [ApplicationGatewayFirewallRuleData], forKey: .rules)
  }
}

extension DataFactory {
  public static func createApplicationGatewayFirewallRuleGroupProtocol(ruleGroupName: String, rules: [ApplicationGatewayFirewallRuleProtocol]) -> ApplicationGatewayFirewallRuleGroupProtocol {
    return ApplicationGatewayFirewallRuleGroupData(ruleGroupName: ruleGroupName, rules: rules)
  }
}


// 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 ApplicationGatewayFirewallRuleSetData : ApplicationGatewayFirewallRuleSetProtocol, 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: ApplicationGatewayFirewallRuleSetPropertiesFormatProtocol?

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

  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(ApplicationGatewayFirewallRuleSetPropertiesFormatData?.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)
    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! ApplicationGatewayFirewallRuleSetPropertiesFormatData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayFirewallRuleSetProtocol() -> ApplicationGatewayFirewallRuleSetProtocol {
    return ApplicationGatewayFirewallRuleSetData()
  }
}


// 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 ApplicationGatewayFirewallRuleSetPropertiesFormatData : ApplicationGatewayFirewallRuleSetPropertiesFormatProtocol {
    public var provisioningState: String?
    public var ruleSetType: String
    public var ruleSetVersion: String
    public var ruleGroups: [ApplicationGatewayFirewallRuleGroupProtocol]

        enum CodingKeys: String, CodingKey {case provisioningState = "provisioningState"
        case ruleSetType = "ruleSetType"
        case ruleSetVersion = "ruleSetVersion"
        case ruleGroups = "ruleGroups"
        }

  public init(ruleSetType: String, ruleSetVersion: String, ruleGroups: [ApplicationGatewayFirewallRuleGroupProtocol])  {
    self.ruleSetType = ruleSetType
    self.ruleSetVersion = ruleSetVersion
    self.ruleGroups = ruleGroups
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(String?.self, forKey: .provisioningState)
    }
    self.ruleSetType = try container.decode(String.self, forKey: .ruleSetType)
    self.ruleSetVersion = try container.decode(String.self, forKey: .ruleSetVersion)
    self.ruleGroups = try container.decode([ApplicationGatewayFirewallRuleGroupData].self, forKey: .ruleGroups)
    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.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    try container.encode(self.ruleSetType, forKey: .ruleSetType)
    try container.encode(self.ruleSetVersion, forKey: .ruleSetVersion)
    try container.encode(self.ruleGroups as! [ApplicationGatewayFirewallRuleGroupData], forKey: .ruleGroups)
  }
}

extension DataFactory {
  public static func createApplicationGatewayFirewallRuleSetPropertiesFormatProtocol(ruleSetType: String, ruleSetVersion: String, ruleGroups: [ApplicationGatewayFirewallRuleGroupProtocol]) -> ApplicationGatewayFirewallRuleSetPropertiesFormatProtocol {
    return ApplicationGatewayFirewallRuleSetPropertiesFormatData(ruleSetType: ruleSetType, ruleSetVersion: ruleSetVersion, ruleGroups: ruleGroups)
  }
}


// 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 ApplicationGatewayFrontendIPConfigurationData : ApplicationGatewayFrontendIPConfigurationProtocol, SubResourceProtocol {
    public var id: String?
    public var properties: ApplicationGatewayFrontendIPConfigurationPropertiesFormatProtocol?
    public var name: String?
    public var etag: String?
    public var type: String?

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

  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(ApplicationGatewayFrontendIPConfigurationPropertiesFormatData?.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 container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    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! ApplicationGatewayFrontendIPConfigurationPropertiesFormatData?, forKey: .properties)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.etag != nil {try container.encode(self.etag, forKey: .etag)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayFrontendIPConfigurationProtocol() -> ApplicationGatewayFrontendIPConfigurationProtocol {
    return ApplicationGatewayFrontendIPConfigurationData()
  }
}


// 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 ApplicationGatewayFrontendIPConfigurationPropertiesFormatData : ApplicationGatewayFrontendIPConfigurationPropertiesFormatProtocol {
    public var privateIPAddress: String?
    public var privateIPAllocationMethod: IPAllocationMethodEnum?
    public var subnet: SubResourceProtocol?
    public var publicIPAddress: SubResourceProtocol?
    public var provisioningState: String?

        enum CodingKeys: String, CodingKey {case privateIPAddress = "privateIPAddress"
        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(.privateIPAddress) {
        self.privateIPAddress = try container.decode(String?.self, forKey: .privateIPAddress)
    }
    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.privateIPAddress != nil {try container.encode(self.privateIPAddress, forKey: .privateIPAddress)}
    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 createApplicationGatewayFrontendIPConfigurationPropertiesFormatProtocol() -> ApplicationGatewayFrontendIPConfigurationPropertiesFormatProtocol {
    return ApplicationGatewayFrontendIPConfigurationPropertiesFormatData()
  }
}


// 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 ApplicationGatewayFrontendPortData : ApplicationGatewayFrontendPortProtocol, SubResourceProtocol {
    public var id: String?
    public var properties: ApplicationGatewayFrontendPortPropertiesFormatProtocol?
    public var name: String?
    public var etag: String?
    public var type: String?

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

  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(ApplicationGatewayFrontendPortPropertiesFormatData?.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 container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    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! ApplicationGatewayFrontendPortPropertiesFormatData?, forKey: .properties)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.etag != nil {try container.encode(self.etag, forKey: .etag)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayFrontendPortProtocol() -> ApplicationGatewayFrontendPortProtocol {
    return ApplicationGatewayFrontendPortData()
  }
}


// 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 ApplicationGatewayFrontendPortPropertiesFormatData : ApplicationGatewayFrontendPortPropertiesFormatProtocol {
    public var port: Int32?
    public var provisioningState: String?

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

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.port) {
        self.port = try container.decode(Int32?.self, forKey: .port)
    }
    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.port != nil {try container.encode(self.port, forKey: .port)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayFrontendPortPropertiesFormatProtocol() -> ApplicationGatewayFrontendPortPropertiesFormatProtocol {
    return ApplicationGatewayFrontendPortPropertiesFormatData()
  }
}


// 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 ApplicationGatewayHttpListenerData : ApplicationGatewayHttpListenerProtocol, SubResourceProtocol {
    public var id: String?
    public var properties: ApplicationGatewayHttpListenerPropertiesFormatProtocol?
    public var name: String?
    public var etag: String?
    public var type: String?

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

  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(ApplicationGatewayHttpListenerPropertiesFormatData?.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 container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    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! ApplicationGatewayHttpListenerPropertiesFormatData?, forKey: .properties)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.etag != nil {try container.encode(self.etag, forKey: .etag)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayHttpListenerProtocol() -> ApplicationGatewayHttpListenerProtocol {
    return ApplicationGatewayHttpListenerData()
  }
}


// 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 ApplicationGatewayHttpListenerPropertiesFormatData : ApplicationGatewayHttpListenerPropertiesFormatProtocol {
    public var frontendIPConfiguration: SubResourceProtocol?
    public var frontendPort: SubResourceProtocol?
    public var _protocol: ApplicationGatewayProtocolEnum?
    public var hostName: String?
    public var sslCertificate: SubResourceProtocol?
    public var requireServerNameIndication: Bool?
    public var provisioningState: String?

        enum CodingKeys: String, CodingKey {case frontendIPConfiguration = "frontendIPConfiguration"
        case frontendPort = "frontendPort"
        case _protocol = "protocol"
        case hostName = "hostName"
        case sslCertificate = "sslCertificate"
        case requireServerNameIndication = "requireServerNameIndication"
        case provisioningState = "provisioningState"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.frontendIPConfiguration) {
        self.frontendIPConfiguration = try container.decode(SubResourceData?.self, forKey: .frontendIPConfiguration)
    }
    if container.contains(.frontendPort) {
        self.frontendPort = try container.decode(SubResourceData?.self, forKey: .frontendPort)
    }
    if container.contains(._protocol) {
        self._protocol = try container.decode(ApplicationGatewayProtocolEnum?.self, forKey: ._protocol)
    }
    if container.contains(.hostName) {
        self.hostName = try container.decode(String?.self, forKey: .hostName)
    }
    if container.contains(.sslCertificate) {
        self.sslCertificate = try container.decode(SubResourceData?.self, forKey: .sslCertificate)
    }
    if container.contains(.requireServerNameIndication) {
        self.requireServerNameIndication = try container.decode(Bool?.self, forKey: .requireServerNameIndication)
    }
    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.frontendIPConfiguration != nil {try container.encode(self.frontendIPConfiguration as! SubResourceData?, forKey: .frontendIPConfiguration)}
    if self.frontendPort != nil {try container.encode(self.frontendPort as! SubResourceData?, forKey: .frontendPort)}
    if self._protocol != nil {try container.encode(self._protocol, forKey: ._protocol)}
    if self.hostName != nil {try container.encode(self.hostName, forKey: .hostName)}
    if self.sslCertificate != nil {try container.encode(self.sslCertificate as! SubResourceData?, forKey: .sslCertificate)}
    if self.requireServerNameIndication != nil {try container.encode(self.requireServerNameIndication, forKey: .requireServerNameIndication)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayHttpListenerPropertiesFormatProtocol() -> ApplicationGatewayHttpListenerPropertiesFormatProtocol {
    return ApplicationGatewayHttpListenerPropertiesFormatData()
  }
}


// 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 ApplicationGatewayIPConfigurationData : ApplicationGatewayIPConfigurationProtocol, SubResourceProtocol {
    public var id: String?
    public var properties: ApplicationGatewayIPConfigurationPropertiesFormatProtocol?
    public var name: String?
    public var etag: String?
    public var type: String?

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

  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(ApplicationGatewayIPConfigurationPropertiesFormatData?.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 container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    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! ApplicationGatewayIPConfigurationPropertiesFormatData?, forKey: .properties)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.etag != nil {try container.encode(self.etag, forKey: .etag)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayIPConfigurationProtocol() -> ApplicationGatewayIPConfigurationProtocol {
    return ApplicationGatewayIPConfigurationData()
  }
}


// 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 ApplicationGatewayIPConfigurationPropertiesFormatData : ApplicationGatewayIPConfigurationPropertiesFormatProtocol {
    public var subnet: SubResourceProtocol?
    public var provisioningState: String?

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

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.subnet) {
        self.subnet = try container.decode(SubResourceData?.self, forKey: .subnet)
    }
    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.subnet != nil {try container.encode(self.subnet as! SubResourceData?, forKey: .subnet)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayIPConfigurationPropertiesFormatProtocol() -> ApplicationGatewayIPConfigurationPropertiesFormatProtocol {
    return ApplicationGatewayIPConfigurationPropertiesFormatData()
  }
}


// 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 ApplicationGatewayListResultData : ApplicationGatewayListResultProtocol {
    public var value: [ApplicationGatewayProtocol?]?
    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([ApplicationGatewayData?]?.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! [ApplicationGatewayData?]?, forKey: .value)}
    if self._nextLink != nil {try container.encode(self._nextLink, forKey: ._nextLink)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayListResultProtocol() -> ApplicationGatewayListResultProtocol {
    return ApplicationGatewayListResultData()
  }
}


// ApplicationGatewayOperationalState enumerates the values for application gateway operational 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 ApplicationGatewayOperationalStateEnum: String, Codable
{
// Running specifies the running state for application gateway operational state.
    case Running = "Running"
// Starting specifies the starting state for application gateway operational state.
    case Starting = "Starting"
// Stopped specifies the stopped state for application gateway operational state.
    case Stopped = "Stopped"
// Stopping specifies the stopping state for application gateway operational state.
    case Stopping = "Stopping"
}


// 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 ApplicationGatewayPathRuleData : ApplicationGatewayPathRuleProtocol, SubResourceProtocol {
    public var id: String?
    public var properties: ApplicationGatewayPathRulePropertiesFormatProtocol?
    public var name: String?
    public var etag: String?
    public var type: String?

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

  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(ApplicationGatewayPathRulePropertiesFormatData?.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 container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    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! ApplicationGatewayPathRulePropertiesFormatData?, forKey: .properties)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.etag != nil {try container.encode(self.etag, forKey: .etag)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayPathRuleProtocol() -> ApplicationGatewayPathRuleProtocol {
    return ApplicationGatewayPathRuleData()
  }
}


// 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 ApplicationGatewayPathRulePropertiesFormatData : ApplicationGatewayPathRulePropertiesFormatProtocol {
    public var paths: [String]?
    public var backendAddressPool: SubResourceProtocol?
    public var backendHttpSettings: SubResourceProtocol?
    public var redirectConfiguration: SubResourceProtocol?
    public var provisioningState: String?

        enum CodingKeys: String, CodingKey {case paths = "paths"
        case backendAddressPool = "backendAddressPool"
        case backendHttpSettings = "backendHttpSettings"
        case redirectConfiguration = "redirectConfiguration"
        case provisioningState = "provisioningState"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.paths) {
        self.paths = try container.decode([String]?.self, forKey: .paths)
    }
    if container.contains(.backendAddressPool) {
        self.backendAddressPool = try container.decode(SubResourceData?.self, forKey: .backendAddressPool)
    }
    if container.contains(.backendHttpSettings) {
        self.backendHttpSettings = try container.decode(SubResourceData?.self, forKey: .backendHttpSettings)
    }
    if container.contains(.redirectConfiguration) {
        self.redirectConfiguration = try container.decode(SubResourceData?.self, forKey: .redirectConfiguration)
    }
    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.paths != nil {try container.encode(self.paths as! [String]?, forKey: .paths)}
    if self.backendAddressPool != nil {try container.encode(self.backendAddressPool as! SubResourceData?, forKey: .backendAddressPool)}
    if self.backendHttpSettings != nil {try container.encode(self.backendHttpSettings as! SubResourceData?, forKey: .backendHttpSettings)}
    if self.redirectConfiguration != nil {try container.encode(self.redirectConfiguration as! SubResourceData?, forKey: .redirectConfiguration)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayPathRulePropertiesFormatProtocol() -> ApplicationGatewayPathRulePropertiesFormatProtocol {
    return ApplicationGatewayPathRulePropertiesFormatData()
  }
}


// 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 ApplicationGatewayProbeData : ApplicationGatewayProbeProtocol, SubResourceProtocol {
    public var id: String?
    public var properties: ApplicationGatewayProbePropertiesFormatProtocol?
    public var name: String?
    public var etag: String?
    public var type: String?

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

  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(ApplicationGatewayProbePropertiesFormatData?.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 container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    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! ApplicationGatewayProbePropertiesFormatData?, forKey: .properties)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.etag != nil {try container.encode(self.etag, forKey: .etag)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayProbeProtocol() -> ApplicationGatewayProbeProtocol {
    return ApplicationGatewayProbeData()
  }
}


// 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 ApplicationGatewayProbeHealthResponseMatchData : ApplicationGatewayProbeHealthResponseMatchProtocol {
    public var _body: String?
    public var statusCodes: [String]?

        enum CodingKeys: String, CodingKey {case _body = "body"
        case statusCodes = "statusCodes"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(._body) {
        self._body = try container.decode(String?.self, forKey: ._body)
    }
    if container.contains(.statusCodes) {
        self.statusCodes = try container.decode([String]?.self, forKey: .statusCodes)
    }
    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._body != nil {try container.encode(self._body, forKey: ._body)}
    if self.statusCodes != nil {try container.encode(self.statusCodes as! [String]?, forKey: .statusCodes)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayProbeHealthResponseMatchProtocol() -> ApplicationGatewayProbeHealthResponseMatchProtocol {
    return ApplicationGatewayProbeHealthResponseMatchData()
  }
}


// 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 ApplicationGatewayProbePropertiesFormatData : ApplicationGatewayProbePropertiesFormatProtocol {
    public var _protocol: ApplicationGatewayProtocolEnum?
    public var host: String?
    public var path: String?
    public var interval: Int32?
    public var timeout: Int32?
    public var unhealthyThreshold: Int32?
    public var pickHostNameFromBackendHttpSettings: Bool?
    public var minServers: Int32?
    public var match: ApplicationGatewayProbeHealthResponseMatchProtocol?
    public var provisioningState: String?

        enum CodingKeys: String, CodingKey {case _protocol = "protocol"
        case host = "host"
        case path = "path"
        case interval = "interval"
        case timeout = "timeout"
        case unhealthyThreshold = "unhealthyThreshold"
        case pickHostNameFromBackendHttpSettings = "pickHostNameFromBackendHttpSettings"
        case minServers = "minServers"
        case match = "match"
        case provisioningState = "provisioningState"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(._protocol) {
        self._protocol = try container.decode(ApplicationGatewayProtocolEnum?.self, forKey: ._protocol)
    }
    if container.contains(.host) {
        self.host = try container.decode(String?.self, forKey: .host)
    }
    if container.contains(.path) {
        self.path = try container.decode(String?.self, forKey: .path)
    }
    if container.contains(.interval) {
        self.interval = try container.decode(Int32?.self, forKey: .interval)
    }
    if container.contains(.timeout) {
        self.timeout = try container.decode(Int32?.self, forKey: .timeout)
    }
    if container.contains(.unhealthyThreshold) {
        self.unhealthyThreshold = try container.decode(Int32?.self, forKey: .unhealthyThreshold)
    }
    if container.contains(.pickHostNameFromBackendHttpSettings) {
        self.pickHostNameFromBackendHttpSettings = try container.decode(Bool?.self, forKey: .pickHostNameFromBackendHttpSettings)
    }
    if container.contains(.minServers) {
        self.minServers = try container.decode(Int32?.self, forKey: .minServers)
    }
    if container.contains(.match) {
        self.match = try container.decode(ApplicationGatewayProbeHealthResponseMatchData?.self, forKey: .match)
    }
    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._protocol != nil {try container.encode(self._protocol, forKey: ._protocol)}
    if self.host != nil {try container.encode(self.host, forKey: .host)}
    if self.path != nil {try container.encode(self.path, forKey: .path)}
    if self.interval != nil {try container.encode(self.interval, forKey: .interval)}
    if self.timeout != nil {try container.encode(self.timeout, forKey: .timeout)}
    if self.unhealthyThreshold != nil {try container.encode(self.unhealthyThreshold, forKey: .unhealthyThreshold)}
    if self.pickHostNameFromBackendHttpSettings != nil {try container.encode(self.pickHostNameFromBackendHttpSettings, forKey: .pickHostNameFromBackendHttpSettings)}
    if self.minServers != nil {try container.encode(self.minServers, forKey: .minServers)}
    if self.match != nil {try container.encode(self.match as! ApplicationGatewayProbeHealthResponseMatchData?, forKey: .match)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayProbePropertiesFormatProtocol() -> ApplicationGatewayProbePropertiesFormatProtocol {
    return ApplicationGatewayProbePropertiesFormatData()
  }
}


// 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 ApplicationGatewayPropertiesFormatData : ApplicationGatewayPropertiesFormatProtocol {
    public var sku: ApplicationGatewaySkuProtocol?
    public var sslPolicy: ApplicationGatewaySslPolicyProtocol?
    public var operationalState: ApplicationGatewayOperationalStateEnum?
    public var gatewayIPConfigurations: [ApplicationGatewayIPConfigurationProtocol?]?
    public var authenticationCertificates: [ApplicationGatewayAuthenticationCertificateProtocol?]?
    public var sslCertificates: [ApplicationGatewaySslCertificateProtocol?]?
    public var frontendIPConfigurations: [ApplicationGatewayFrontendIPConfigurationProtocol?]?
    public var frontendPorts: [ApplicationGatewayFrontendPortProtocol?]?
    public var probes: [ApplicationGatewayProbeProtocol?]?
    public var backendAddressPools: [ApplicationGatewayBackendAddressPoolProtocol?]?
    public var backendHttpSettingsCollection: [ApplicationGatewayBackendHttpSettingsProtocol?]?
    public var httpListeners: [ApplicationGatewayHttpListenerProtocol?]?
    public var urlPathMaps: [ApplicationGatewayUrlPathMapProtocol?]?
    public var requestRoutingRules: [ApplicationGatewayRequestRoutingRuleProtocol?]?
    public var redirectConfigurations: [ApplicationGatewayRedirectConfigurationProtocol?]?
    public var webApplicationFirewallConfiguration: ApplicationGatewayWebApplicationFirewallConfigurationProtocol?
    public var enableHttp2: Bool?
    public var resourceGuid: String?
    public var provisioningState: String?

        enum CodingKeys: String, CodingKey {case sku = "sku"
        case sslPolicy = "sslPolicy"
        case operationalState = "operationalState"
        case gatewayIPConfigurations = "gatewayIPConfigurations"
        case authenticationCertificates = "authenticationCertificates"
        case sslCertificates = "sslCertificates"
        case frontendIPConfigurations = "frontendIPConfigurations"
        case frontendPorts = "frontendPorts"
        case probes = "probes"
        case backendAddressPools = "backendAddressPools"
        case backendHttpSettingsCollection = "backendHttpSettingsCollection"
        case httpListeners = "httpListeners"
        case urlPathMaps = "urlPathMaps"
        case requestRoutingRules = "requestRoutingRules"
        case redirectConfigurations = "redirectConfigurations"
        case webApplicationFirewallConfiguration = "webApplicationFirewallConfiguration"
        case enableHttp2 = "enableHttp2"
        case resourceGuid = "resourceGuid"
        case provisioningState = "provisioningState"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.sku) {
        self.sku = try container.decode(ApplicationGatewaySkuData?.self, forKey: .sku)
    }
    if container.contains(.sslPolicy) {
        self.sslPolicy = try container.decode(ApplicationGatewaySslPolicyData?.self, forKey: .sslPolicy)
    }
    if container.contains(.operationalState) {
        self.operationalState = try container.decode(ApplicationGatewayOperationalStateEnum?.self, forKey: .operationalState)
    }
    if container.contains(.gatewayIPConfigurations) {
        self.gatewayIPConfigurations = try container.decode([ApplicationGatewayIPConfigurationData?]?.self, forKey: .gatewayIPConfigurations)
    }
    if container.contains(.authenticationCertificates) {
        self.authenticationCertificates = try container.decode([ApplicationGatewayAuthenticationCertificateData?]?.self, forKey: .authenticationCertificates)
    }
    if container.contains(.sslCertificates) {
        self.sslCertificates = try container.decode([ApplicationGatewaySslCertificateData?]?.self, forKey: .sslCertificates)
    }
    if container.contains(.frontendIPConfigurations) {
        self.frontendIPConfigurations = try container.decode([ApplicationGatewayFrontendIPConfigurationData?]?.self, forKey: .frontendIPConfigurations)
    }
    if container.contains(.frontendPorts) {
        self.frontendPorts = try container.decode([ApplicationGatewayFrontendPortData?]?.self, forKey: .frontendPorts)
    }
    if container.contains(.probes) {
        self.probes = try container.decode([ApplicationGatewayProbeData?]?.self, forKey: .probes)
    }
    if container.contains(.backendAddressPools) {
        self.backendAddressPools = try container.decode([ApplicationGatewayBackendAddressPoolData?]?.self, forKey: .backendAddressPools)
    }
    if container.contains(.backendHttpSettingsCollection) {
        self.backendHttpSettingsCollection = try container.decode([ApplicationGatewayBackendHttpSettingsData?]?.self, forKey: .backendHttpSettingsCollection)
    }
    if container.contains(.httpListeners) {
        self.httpListeners = try container.decode([ApplicationGatewayHttpListenerData?]?.self, forKey: .httpListeners)
    }
    if container.contains(.urlPathMaps) {
        self.urlPathMaps = try container.decode([ApplicationGatewayUrlPathMapData?]?.self, forKey: .urlPathMaps)
    }
    if container.contains(.requestRoutingRules) {
        self.requestRoutingRules = try container.decode([ApplicationGatewayRequestRoutingRuleData?]?.self, forKey: .requestRoutingRules)
    }
    if container.contains(.redirectConfigurations) {
        self.redirectConfigurations = try container.decode([ApplicationGatewayRedirectConfigurationData?]?.self, forKey: .redirectConfigurations)
    }
    if container.contains(.webApplicationFirewallConfiguration) {
        self.webApplicationFirewallConfiguration = try container.decode(ApplicationGatewayWebApplicationFirewallConfigurationData?.self, forKey: .webApplicationFirewallConfiguration)
    }
    if container.contains(.enableHttp2) {
        self.enableHttp2 = try container.decode(Bool?.self, forKey: .enableHttp2)
    }
    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.sku != nil {try container.encode(self.sku as! ApplicationGatewaySkuData?, forKey: .sku)}
    if self.sslPolicy != nil {try container.encode(self.sslPolicy as! ApplicationGatewaySslPolicyData?, forKey: .sslPolicy)}
    if self.operationalState != nil {try container.encode(self.operationalState, forKey: .operationalState)}
    if self.gatewayIPConfigurations != nil {try container.encode(self.gatewayIPConfigurations as! [ApplicationGatewayIPConfigurationData?]?, forKey: .gatewayIPConfigurations)}
    if self.authenticationCertificates != nil {try container.encode(self.authenticationCertificates as! [ApplicationGatewayAuthenticationCertificateData?]?, forKey: .authenticationCertificates)}
    if self.sslCertificates != nil {try container.encode(self.sslCertificates as! [ApplicationGatewaySslCertificateData?]?, forKey: .sslCertificates)}
    if self.frontendIPConfigurations != nil {try container.encode(self.frontendIPConfigurations as! [ApplicationGatewayFrontendIPConfigurationData?]?, forKey: .frontendIPConfigurations)}
    if self.frontendPorts != nil {try container.encode(self.frontendPorts as! [ApplicationGatewayFrontendPortData?]?, forKey: .frontendPorts)}
    if self.probes != nil {try container.encode(self.probes as! [ApplicationGatewayProbeData?]?, forKey: .probes)}
    if self.backendAddressPools != nil {try container.encode(self.backendAddressPools as! [ApplicationGatewayBackendAddressPoolData?]?, forKey: .backendAddressPools)}
    if self.backendHttpSettingsCollection != nil {try container.encode(self.backendHttpSettingsCollection as! [ApplicationGatewayBackendHttpSettingsData?]?, forKey: .backendHttpSettingsCollection)}
    if self.httpListeners != nil {try container.encode(self.httpListeners as! [ApplicationGatewayHttpListenerData?]?, forKey: .httpListeners)}
    if self.urlPathMaps != nil {try container.encode(self.urlPathMaps as! [ApplicationGatewayUrlPathMapData?]?, forKey: .urlPathMaps)}
    if self.requestRoutingRules != nil {try container.encode(self.requestRoutingRules as! [ApplicationGatewayRequestRoutingRuleData?]?, forKey: .requestRoutingRules)}
    if self.redirectConfigurations != nil {try container.encode(self.redirectConfigurations as! [ApplicationGatewayRedirectConfigurationData?]?, forKey: .redirectConfigurations)}
    if self.webApplicationFirewallConfiguration != nil {try container.encode(self.webApplicationFirewallConfiguration as! ApplicationGatewayWebApplicationFirewallConfigurationData?, forKey: .webApplicationFirewallConfiguration)}
    if self.enableHttp2 != nil {try container.encode(self.enableHttp2, forKey: .enableHttp2)}
    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 createApplicationGatewayPropertiesFormatProtocol() -> ApplicationGatewayPropertiesFormatProtocol {
    return ApplicationGatewayPropertiesFormatData()
  }
}


// ApplicationGatewayProtocol enumerates the values for application gateway 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 ApplicationGatewayProtocolEnum: String, Codable
{
// Http specifies the http state for application gateway protocol.
    case Http = "Http"
// Https specifies the https state for application gateway protocol.
    case Https = "Https"
}


// 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 ApplicationGatewayRedirectConfigurationData : ApplicationGatewayRedirectConfigurationProtocol, SubResourceProtocol {
    public var id: String?
    public var properties: ApplicationGatewayRedirectConfigurationPropertiesFormatProtocol?
    public var name: String?
    public var etag: String?
    public var type: String?

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

  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(ApplicationGatewayRedirectConfigurationPropertiesFormatData?.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 container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    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! ApplicationGatewayRedirectConfigurationPropertiesFormatData?, forKey: .properties)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.etag != nil {try container.encode(self.etag, forKey: .etag)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayRedirectConfigurationProtocol() -> ApplicationGatewayRedirectConfigurationProtocol {
    return ApplicationGatewayRedirectConfigurationData()
  }
}


// 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 ApplicationGatewayRedirectConfigurationPropertiesFormatData : ApplicationGatewayRedirectConfigurationPropertiesFormatProtocol {
    public var redirectType: ApplicationGatewayRedirectTypeEnum?
    public var targetListener: SubResourceProtocol?
    public var targetUrl: String?
    public var includePath: Bool?
    public var includeQueryString: Bool?
    public var requestRoutingRules: [SubResourceProtocol?]?
    public var urlPathMaps: [SubResourceProtocol?]?
    public var pathRules: [SubResourceProtocol?]?

        enum CodingKeys: String, CodingKey {case redirectType = "redirectType"
        case targetListener = "targetListener"
        case targetUrl = "targetUrl"
        case includePath = "includePath"
        case includeQueryString = "includeQueryString"
        case requestRoutingRules = "requestRoutingRules"
        case urlPathMaps = "urlPathMaps"
        case pathRules = "pathRules"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.redirectType) {
        self.redirectType = try container.decode(ApplicationGatewayRedirectTypeEnum?.self, forKey: .redirectType)
    }
    if container.contains(.targetListener) {
        self.targetListener = try container.decode(SubResourceData?.self, forKey: .targetListener)
    }
    if container.contains(.targetUrl) {
        self.targetUrl = try container.decode(String?.self, forKey: .targetUrl)
    }
    if container.contains(.includePath) {
        self.includePath = try container.decode(Bool?.self, forKey: .includePath)
    }
    if container.contains(.includeQueryString) {
        self.includeQueryString = try container.decode(Bool?.self, forKey: .includeQueryString)
    }
    if container.contains(.requestRoutingRules) {
        self.requestRoutingRules = try container.decode([SubResourceData?]?.self, forKey: .requestRoutingRules)
    }
    if container.contains(.urlPathMaps) {
        self.urlPathMaps = try container.decode([SubResourceData?]?.self, forKey: .urlPathMaps)
    }
    if container.contains(.pathRules) {
        self.pathRules = try container.decode([SubResourceData?]?.self, forKey: .pathRules)
    }
    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.redirectType != nil {try container.encode(self.redirectType, forKey: .redirectType)}
    if self.targetListener != nil {try container.encode(self.targetListener as! SubResourceData?, forKey: .targetListener)}
    if self.targetUrl != nil {try container.encode(self.targetUrl, forKey: .targetUrl)}
    if self.includePath != nil {try container.encode(self.includePath, forKey: .includePath)}
    if self.includeQueryString != nil {try container.encode(self.includeQueryString, forKey: .includeQueryString)}
    if self.requestRoutingRules != nil {try container.encode(self.requestRoutingRules as! [SubResourceData?]?, forKey: .requestRoutingRules)}
    if self.urlPathMaps != nil {try container.encode(self.urlPathMaps as! [SubResourceData?]?, forKey: .urlPathMaps)}
    if self.pathRules != nil {try container.encode(self.pathRules as! [SubResourceData?]?, forKey: .pathRules)}
  }
}

extension DataFactory {
  public static func createApplicationGatewayRedirectConfigurationPropertiesFormatProtocol() -> ApplicationGatewayRedirectConfigurationPropertiesFormatProtocol {
    return ApplicationGatewayRedirectConfigurationPropertiesFormatData()
  }
}


// ApplicationGatewayRedirectType enumerates the values for application gateway redirect 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 ApplicationGatewayRedirectTypeEnum: String, Codable
{
// Found specifies the found state for application gateway redirect type.
    case Found = "Found"
// Permanent specifies the permanent state for application gateway redirect type.
    case Permanent = "Permanent"
// SeeOther specifies the see other state for application gateway redirect type.
    case SeeOther = "SeeOther"
// Temporary specifies the temporary state for application gateway redirect type.
    case Temporary = "Temporary"
}