// 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 ConnectionMonitorData : ConnectionMonitorProtocol {
    public var location: String?
    public var tags: [String:String]?
    public var properties: ConnectionMonitorParametersProtocol

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

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

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

extension DataFactory {
  public static func createConnectionMonitorProtocol(properties: ConnectionMonitorParametersProtocol) -> ConnectionMonitorProtocol {
    return ConnectionMonitorData(properties: properties)
  }
}


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

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

  public init()  {
  }

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

extension DataFactory {
  public static func createConnectionMonitorDestinationProtocol() -> ConnectionMonitorDestinationProtocol {
    return ConnectionMonitorDestinationData()
  }
}


// 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 ConnectionMonitorListResultData : ConnectionMonitorListResultProtocol {
    public var value: [ConnectionMonitorResultProtocol?]?

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

extension DataFactory {
  public static func createConnectionMonitorListResultProtocol() -> ConnectionMonitorListResultProtocol {
    return ConnectionMonitorListResultData()
  }
}


// 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 ConnectionMonitorParametersData : ConnectionMonitorParametersProtocol {
    public var source: ConnectionMonitorSourceProtocol
    public var destination: ConnectionMonitorDestinationProtocol
    public var autoStart: Bool?
    public var monitoringIntervalInSeconds: Int32?

        enum CodingKeys: String, CodingKey {case source = "source"
        case destination = "destination"
        case autoStart = "autoStart"
        case monitoringIntervalInSeconds = "monitoringIntervalInSeconds"
        }

  public init(source: ConnectionMonitorSourceProtocol, destination: ConnectionMonitorDestinationProtocol)  {
    self.source = source
    self.destination = destination
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.source = try container.decode(ConnectionMonitorSourceData.self, forKey: .source)
    self.destination = try container.decode(ConnectionMonitorDestinationData.self, forKey: .destination)
    if container.contains(.autoStart) {
        self.autoStart = try container.decode(Bool?.self, forKey: .autoStart)
    }
    if container.contains(.monitoringIntervalInSeconds) {
        self.monitoringIntervalInSeconds = try container.decode(Int32?.self, forKey: .monitoringIntervalInSeconds)
    }
    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.source as! ConnectionMonitorSourceData, forKey: .source)
    try container.encode(self.destination as! ConnectionMonitorDestinationData, forKey: .destination)
    if self.autoStart != nil {try container.encode(self.autoStart, forKey: .autoStart)}
    if self.monitoringIntervalInSeconds != nil {try container.encode(self.monitoringIntervalInSeconds, forKey: .monitoringIntervalInSeconds)}
  }
}

extension DataFactory {
  public static func createConnectionMonitorParametersProtocol(source: ConnectionMonitorSourceProtocol, destination: ConnectionMonitorDestinationProtocol) -> ConnectionMonitorParametersProtocol {
    return ConnectionMonitorParametersData(source: source, destination: destination)
  }
}


// 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 ConnectionMonitorQueryResultData : ConnectionMonitorQueryResultProtocol {
    public var states: [ConnectionStateSnapshotProtocol?]?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createConnectionMonitorQueryResultProtocol() -> ConnectionMonitorQueryResultProtocol {
    return ConnectionMonitorQueryResultData()
  }
}


// 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 ConnectionMonitorResultData : ConnectionMonitorResultProtocol {
    public var name: String?
    public var id: String?
    public var etag: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?
    public var properties: ConnectionMonitorResultPropertiesProtocol?

        enum CodingKeys: String, CodingKey {case name = "name"
        case id = "id"
        case etag = "etag"
        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(.name) {
        self.name = try container.decode(String?.self, forKey: .name)
    }
    if container.contains(.id) {
        self.id = try container.decode(String?.self, forKey: .id)
    }
    if container.contains(.etag) {
        self.etag = try container.decode(String?.self, forKey: .etag)
    }
    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(ConnectionMonitorResultPropertiesData?.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.name != nil {try container.encode(self.name, forKey: .name)}
    if self.id != nil {try container.encode(self.id, forKey: .id)}
    if self.etag != nil {try container.encode(self.etag, forKey: .etag)}
    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! ConnectionMonitorResultPropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createConnectionMonitorResultProtocol() -> ConnectionMonitorResultProtocol {
    return ConnectionMonitorResultData()
  }
}


// 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 ConnectionMonitorResultPropertiesData : ConnectionMonitorResultPropertiesProtocol, ConnectionMonitorParametersProtocol {
    public var source: ConnectionMonitorSourceProtocol
    public var destination: ConnectionMonitorDestinationProtocol
    public var autoStart: Bool?
    public var monitoringIntervalInSeconds: Int32?
    public var provisioningState: ProvisioningStateEnum?
    public var startTime: Date?
    public var monitoringStatus: String?

        enum CodingKeys: String, CodingKey {case source = "source"
        case destination = "destination"
        case autoStart = "autoStart"
        case monitoringIntervalInSeconds = "monitoringIntervalInSeconds"
        case provisioningState = "provisioningState"
        case startTime = "startTime"
        case monitoringStatus = "monitoringStatus"
        }

  public init(source: ConnectionMonitorSourceProtocol, destination: ConnectionMonitorDestinationProtocol)  {
    self.source = source
    self.destination = destination
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.source = try container.decode(ConnectionMonitorSourceData.self, forKey: .source)
    self.destination = try container.decode(ConnectionMonitorDestinationData.self, forKey: .destination)
    if container.contains(.autoStart) {
        self.autoStart = try container.decode(Bool?.self, forKey: .autoStart)
    }
    if container.contains(.monitoringIntervalInSeconds) {
        self.monitoringIntervalInSeconds = try container.decode(Int32?.self, forKey: .monitoringIntervalInSeconds)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(ProvisioningStateEnum?.self, forKey: .provisioningState)
    }
    if container.contains(.startTime) {
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)
    }
    if container.contains(.monitoringStatus) {
        self.monitoringStatus = try container.decode(String?.self, forKey: .monitoringStatus)
    }
    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.source as! ConnectionMonitorSourceData, forKey: .source)
    try container.encode(self.destination as! ConnectionMonitorDestinationData, forKey: .destination)
    if self.autoStart != nil {try container.encode(self.autoStart, forKey: .autoStart)}
    if self.monitoringIntervalInSeconds != nil {try container.encode(self.monitoringIntervalInSeconds, forKey: .monitoringIntervalInSeconds)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.startTime != nil {
        try container.encode(DateConverter.toString(date: self.startTime!, format: .dateTime), forKey: .startTime)
    }
    if self.monitoringStatus != nil {try container.encode(self.monitoringStatus, forKey: .monitoringStatus)}
  }
}

extension DataFactory {
  public static func createConnectionMonitorResultPropertiesProtocol(source: ConnectionMonitorSourceProtocol, destination: ConnectionMonitorDestinationProtocol) -> ConnectionMonitorResultPropertiesProtocol {
    return ConnectionMonitorResultPropertiesData(source: source, destination: destination)
  }
}


// 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 ConnectionMonitorSourceData : ConnectionMonitorSourceProtocol {
    public var resourceId: String
    public var port: Int32?

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

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

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

extension DataFactory {
  public static func createConnectionMonitorSourceProtocol(resourceId: String) -> ConnectionMonitorSourceProtocol {
    return ConnectionMonitorSourceData(resourceId: resourceId)
  }
}


// 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 ConnectionResetSharedKeyData : ConnectionResetSharedKeyProtocol {
    public var keyLength: Int32

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

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

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

extension DataFactory {
  public static func createConnectionResetSharedKeyProtocol(keyLength: Int32) -> ConnectionResetSharedKeyProtocol {
    return ConnectionResetSharedKeyData(keyLength: keyLength)
  }
}


// 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 ConnectionSharedKeyData : ConnectionSharedKeyProtocol {
    public var value: String

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

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

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

extension DataFactory {
  public static func createConnectionSharedKeyProtocol(value: String) -> ConnectionSharedKeyProtocol {
    return ConnectionSharedKeyData(value: value)
  }
}


// ConnectionState enumerates the values for connection 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 ConnectionStateEnum: String, Codable
{
// ConnectionStateReachable specifies the connection state reachable state for connection state.
    case ConnectionStateReachable = "Reachable"
// ConnectionStateUnknown specifies the connection state unknown state for connection state.
    case ConnectionStateUnknown = "Unknown"
// ConnectionStateUnreachable specifies the connection state unreachable state for connection state.
    case ConnectionStateUnreachable = "Unreachable"
}


// 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 ConnectionStateSnapshotData : ConnectionStateSnapshotProtocol {
    public var connectionState: ConnectionStateEnum?
    public var startTime: Date?
    public var endTime: Date?
    public var evaluationState: EvaluationStateEnum?
    public var hops: [ConnectivityHopProtocol?]?

        enum CodingKeys: String, CodingKey {case connectionState = "connectionState"
        case startTime = "startTime"
        case endTime = "endTime"
        case evaluationState = "evaluationState"
        case hops = "hops"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.connectionState) {
        self.connectionState = try container.decode(ConnectionStateEnum?.self, forKey: .connectionState)
    }
    if container.contains(.startTime) {
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)
    }
    if container.contains(.endTime) {
        self.endTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .endTime)), format: .dateTime)
    }
    if container.contains(.evaluationState) {
        self.evaluationState = try container.decode(EvaluationStateEnum?.self, forKey: .evaluationState)
    }
    if container.contains(.hops) {
        self.hops = try container.decode([ConnectivityHopData?]?.self, forKey: .hops)
    }
    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.connectionState != nil {try container.encode(self.connectionState, forKey: .connectionState)}
    if self.startTime != nil {
        try container.encode(DateConverter.toString(date: self.startTime!, format: .dateTime), forKey: .startTime)
    }
    if self.endTime != nil {
        try container.encode(DateConverter.toString(date: self.endTime!, format: .dateTime), forKey: .endTime)
    }
    if self.evaluationState != nil {try container.encode(self.evaluationState, forKey: .evaluationState)}
    if self.hops != nil {try container.encode(self.hops as! [ConnectivityHopData?]?, forKey: .hops)}
  }
}

extension DataFactory {
  public static func createConnectionStateSnapshotProtocol() -> ConnectionStateSnapshotProtocol {
    return ConnectionStateSnapshotData()
  }
}


// ConnectionStatus enumerates the values for connection status.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum ConnectionStatusEnum: String, Codable
{
// ConnectionStatusConnected specifies the connection status connected state for connection status.
    case ConnectionStatusConnected = "Connected"
// ConnectionStatusDegraded specifies the connection status degraded state for connection status.
    case ConnectionStatusDegraded = "Degraded"
// ConnectionStatusDisconnected specifies the connection status disconnected state for connection status.
    case ConnectionStatusDisconnected = "Disconnected"
// ConnectionStatusUnknown specifies the connection status unknown state for connection status.
    case ConnectionStatusUnknown = "Unknown"
}


// 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 ConnectivityDestinationData : ConnectivityDestinationProtocol {
    public var resourceId: String?
    public var address: String?
    public var port: Int32?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createConnectivityDestinationProtocol() -> ConnectivityDestinationProtocol {
    return ConnectivityDestinationData()
  }
}


// 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 ConnectivityHopData : ConnectivityHopProtocol {
    public var type: String?
    public var id: String?
    public var address: String?
    public var resourceId: String?
    public var nextHopIds: [String]?
    public var issues: [ConnectivityIssueProtocol?]?

        enum CodingKeys: String, CodingKey {case type = "type"
        case id = "id"
        case address = "address"
        case resourceId = "resourceId"
        case nextHopIds = "nextHopIds"
        case issues = "issues"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createConnectivityHopProtocol() -> ConnectivityHopProtocol {
    return ConnectivityHopData()
  }
}


// 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 ConnectivityInformationData : ConnectivityInformationProtocol {
    public var hops: [ConnectivityHopProtocol?]?
    public var connectionStatus: ConnectionStatusEnum?
    public var avgLatencyInMs: Int32?
    public var minLatencyInMs: Int32?
    public var maxLatencyInMs: Int32?
    public var probesSent: Int32?
    public var probesFailed: Int32?

        enum CodingKeys: String, CodingKey {case hops = "hops"
        case connectionStatus = "connectionStatus"
        case avgLatencyInMs = "avgLatencyInMs"
        case minLatencyInMs = "minLatencyInMs"
        case maxLatencyInMs = "maxLatencyInMs"
        case probesSent = "probesSent"
        case probesFailed = "probesFailed"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.hops) {
        self.hops = try container.decode([ConnectivityHopData?]?.self, forKey: .hops)
    }
    if container.contains(.connectionStatus) {
        self.connectionStatus = try container.decode(ConnectionStatusEnum?.self, forKey: .connectionStatus)
    }
    if container.contains(.avgLatencyInMs) {
        self.avgLatencyInMs = try container.decode(Int32?.self, forKey: .avgLatencyInMs)
    }
    if container.contains(.minLatencyInMs) {
        self.minLatencyInMs = try container.decode(Int32?.self, forKey: .minLatencyInMs)
    }
    if container.contains(.maxLatencyInMs) {
        self.maxLatencyInMs = try container.decode(Int32?.self, forKey: .maxLatencyInMs)
    }
    if container.contains(.probesSent) {
        self.probesSent = try container.decode(Int32?.self, forKey: .probesSent)
    }
    if container.contains(.probesFailed) {
        self.probesFailed = try container.decode(Int32?.self, forKey: .probesFailed)
    }
    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.hops != nil {try container.encode(self.hops as! [ConnectivityHopData?]?, forKey: .hops)}
    if self.connectionStatus != nil {try container.encode(self.connectionStatus, forKey: .connectionStatus)}
    if self.avgLatencyInMs != nil {try container.encode(self.avgLatencyInMs, forKey: .avgLatencyInMs)}
    if self.minLatencyInMs != nil {try container.encode(self.minLatencyInMs, forKey: .minLatencyInMs)}
    if self.maxLatencyInMs != nil {try container.encode(self.maxLatencyInMs, forKey: .maxLatencyInMs)}
    if self.probesSent != nil {try container.encode(self.probesSent, forKey: .probesSent)}
    if self.probesFailed != nil {try container.encode(self.probesFailed, forKey: .probesFailed)}
  }
}

extension DataFactory {
  public static func createConnectivityInformationProtocol() -> ConnectivityInformationProtocol {
    return ConnectivityInformationData()
  }
}


// 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 ConnectivityIssueData : ConnectivityIssueProtocol {
    public var origin: OriginEnum?
    public var severity: SeverityEnum?
    public var type: IssueTypeEnum?
    public var context: [[String:String]?]?

        enum CodingKeys: String, CodingKey {case origin = "origin"
        case severity = "severity"
        case type = "type"
        case context = "context"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createConnectivityIssueProtocol() -> ConnectivityIssueProtocol {
    return ConnectivityIssueData()
  }
}


// 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 ConnectivityParametersData : ConnectivityParametersProtocol {
    public var source: ConnectivitySourceProtocol
    public var destination: ConnectivityDestinationProtocol

        enum CodingKeys: String, CodingKey {case source = "source"
        case destination = "destination"
        }

  public init(source: ConnectivitySourceProtocol, destination: ConnectivityDestinationProtocol)  {
    self.source = source
    self.destination = destination
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.source = try container.decode(ConnectivitySourceData.self, forKey: .source)
    self.destination = try container.decode(ConnectivityDestinationData.self, forKey: .destination)
    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.source as! ConnectivitySourceData, forKey: .source)
    try container.encode(self.destination as! ConnectivityDestinationData, forKey: .destination)
  }
}

extension DataFactory {
  public static func createConnectivityParametersProtocol(source: ConnectivitySourceProtocol, destination: ConnectivityDestinationProtocol) -> ConnectivityParametersProtocol {
    return ConnectivityParametersData(source: source, destination: destination)
  }
}


// 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 ConnectivitySourceData : ConnectivitySourceProtocol {
    public var resourceId: String
    public var port: Int32?

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

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

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

extension DataFactory {
  public static func createConnectivitySourceProtocol(resourceId: String) -> ConnectivitySourceProtocol {
    return ConnectivitySourceData(resourceId: resourceId)
  }
}


// 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 DhcpOptionsData : DhcpOptionsProtocol {
    public var dnsServers: [String]?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createDhcpOptionsProtocol() -> DhcpOptionsProtocol {
    return DhcpOptionsData()
  }
}


// DhGroup enumerates the values for dh group.

// 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 DhGroupEnum: String, Codable
{
// DHGroup1 specifies the dh group 1 state for dh group.
    case DHGroup1 = "DHGroup1"
// DHGroup14 specifies the dh group 14 state for dh group.
    case DHGroup14 = "DHGroup14"
// DHGroup2 specifies the dh group 2 state for dh group.
    case DHGroup2 = "DHGroup2"
// DHGroup2048 specifies the dh group 2048 state for dh group.
    case DHGroup2048 = "DHGroup2048"
// DHGroup24 specifies the dh group 24 state for dh group.
    case DHGroup24 = "DHGroup24"
// ECP256 specifies the ecp256 state for dh group.
    case ECP256 = "ECP256"
// ECP384 specifies the ecp384 state for dh group.
    case ECP384 = "ECP384"
// None specifies the none state for dh group.
    case None = "None"
}


// 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 DimensionData : DimensionProtocol {
    public var name: String?
    public var displayName: String?
    public var internalName: String?

        enum CodingKeys: String, CodingKey {case name = "name"
        case displayName = "displayName"
        case internalName = "internalName"
        }

  public init()  {
  }

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

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

extension DataFactory {
  public static func createDimensionProtocol() -> DimensionProtocol {
    return DimensionData()
  }
}


// Direction enumerates the values for direction.

// 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 DirectionEnum: String, Codable
{
// Inbound specifies the inbound state for direction.
    case Inbound = "Inbound"
// Outbound specifies the outbound state for direction.
    case Outbound = "Outbound"
}


// 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 DnsNameAvailabilityResultData : DnsNameAvailabilityResultProtocol {
    public var available: Bool?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createDnsNameAvailabilityResultProtocol() -> DnsNameAvailabilityResultProtocol {
    return DnsNameAvailabilityResultData()
  }
}


// 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 EffectiveNetworkSecurityGroupAssociationData : EffectiveNetworkSecurityGroupAssociationProtocol {
    public var subnet: SubResourceProtocol?
    public var networkInterface: SubResourceProtocol?

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

  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(.networkInterface) {
        self.networkInterface = try container.decode(SubResourceData?.self, forKey: .networkInterface)
    }
    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.networkInterface != nil {try container.encode(self.networkInterface as! SubResourceData?, forKey: .networkInterface)}
  }
}

extension DataFactory {
  public static func createEffectiveNetworkSecurityGroupAssociationProtocol() -> EffectiveNetworkSecurityGroupAssociationProtocol {
    return EffectiveNetworkSecurityGroupAssociationData()
  }
}


// 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 EffectiveNetworkSecurityGroupData : EffectiveNetworkSecurityGroupProtocol {
    public var networkSecurityGroup: SubResourceProtocol?
    public var association: EffectiveNetworkSecurityGroupAssociationProtocol?
    public var effectiveSecurityRules: [EffectiveNetworkSecurityRuleProtocol?]?
    public var tagMap: [String:[String]?]?

        enum CodingKeys: String, CodingKey {case networkSecurityGroup = "networkSecurityGroup"
        case association = "association"
        case effectiveSecurityRules = "effectiveSecurityRules"
        case tagMap = "tagMap"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createEffectiveNetworkSecurityGroupProtocol() -> EffectiveNetworkSecurityGroupProtocol {
    return EffectiveNetworkSecurityGroupData()
  }
}


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

extension DataFactory {
  public static func createEffectiveNetworkSecurityGroupListResultProtocol() -> EffectiveNetworkSecurityGroupListResultProtocol {
    return EffectiveNetworkSecurityGroupListResultData()
  }
}


// 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 EffectiveNetworkSecurityRuleData : EffectiveNetworkSecurityRuleProtocol {
    public var name: String?
    public var _protocol: EffectiveSecurityRuleProtocolEnum?
    public var sourcePortRange: String?
    public var destinationPortRange: String?
    public var sourcePortRanges: [String]?
    public var destinationPortRanges: [String]?
    public var sourceAddressPrefix: String?
    public var destinationAddressPrefix: String?
    public var sourceAddressPrefixes: [String]?
    public var destinationAddressPrefixes: [String]?
    public var expandedSourceAddressPrefix: [String]?
    public var expandedDestinationAddressPrefix: [String]?
    public var access: SecurityRuleAccessEnum?
    public var priority: Int32?
    public var direction: SecurityRuleDirectionEnum?

        enum CodingKeys: String, CodingKey {case name = "name"
        case _protocol = "protocol"
        case sourcePortRange = "sourcePortRange"
        case destinationPortRange = "destinationPortRange"
        case sourcePortRanges = "sourcePortRanges"
        case destinationPortRanges = "destinationPortRanges"
        case sourceAddressPrefix = "sourceAddressPrefix"
        case destinationAddressPrefix = "destinationAddressPrefix"
        case sourceAddressPrefixes = "sourceAddressPrefixes"
        case destinationAddressPrefixes = "destinationAddressPrefixes"
        case expandedSourceAddressPrefix = "expandedSourceAddressPrefix"
        case expandedDestinationAddressPrefix = "expandedDestinationAddressPrefix"
        case access = "access"
        case priority = "priority"
        case direction = "direction"
        }

  public init()  {
  }

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

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

extension DataFactory {
  public static func createEffectiveNetworkSecurityRuleProtocol() -> EffectiveNetworkSecurityRuleProtocol {
    return EffectiveNetworkSecurityRuleData()
  }
}


// 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 EffectiveRouteData : EffectiveRouteProtocol {
    public var name: String?
    public var source: EffectiveRouteSourceEnum?
    public var state: EffectiveRouteStateEnum?
    public var addressPrefix: [String]?
    public var nextHopIpAddress: [String]?
    public var nextHopType: RouteNextHopTypeEnum?

        enum CodingKeys: String, CodingKey {case name = "name"
        case source = "source"
        case state = "state"
        case addressPrefix = "addressPrefix"
        case nextHopIpAddress = "nextHopIpAddress"
        case nextHopType = "nextHopType"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.name) {
        self.name = try container.decode(String?.self, forKey: .name)
    }
    if container.contains(.source) {
        self.source = try container.decode(EffectiveRouteSourceEnum?.self, forKey: .source)
    }
    if container.contains(.state) {
        self.state = try container.decode(EffectiveRouteStateEnum?.self, forKey: .state)
    }
    if container.contains(.addressPrefix) {
        self.addressPrefix = try container.decode([String]?.self, forKey: .addressPrefix)
    }
    if container.contains(.nextHopIpAddress) {
        self.nextHopIpAddress = try container.decode([String]?.self, forKey: .nextHopIpAddress)
    }
    if container.contains(.nextHopType) {
        self.nextHopType = try container.decode(RouteNextHopTypeEnum?.self, forKey: .nextHopType)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.source != nil {try container.encode(self.source, forKey: .source)}
    if self.state != nil {try container.encode(self.state, forKey: .state)}
    if self.addressPrefix != nil {try container.encode(self.addressPrefix as! [String]?, forKey: .addressPrefix)}
    if self.nextHopIpAddress != nil {try container.encode(self.nextHopIpAddress as! [String]?, forKey: .nextHopIpAddress)}
    if self.nextHopType != nil {try container.encode(self.nextHopType, forKey: .nextHopType)}
  }
}

extension DataFactory {
  public static func createEffectiveRouteProtocol() -> EffectiveRouteProtocol {
    return EffectiveRouteData()
  }
}


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

extension DataFactory {
  public static func createEffectiveRouteListResultProtocol() -> EffectiveRouteListResultProtocol {
    return EffectiveRouteListResultData()
  }
}


// EffectiveRouteSource enumerates the values for effective route source.

// 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 EffectiveRouteSourceEnum: String, Codable
{
// EffectiveRouteSourceDefault specifies the effective route source default state for effective route source.
    case EffectiveRouteSourceDefault = "Default"
// EffectiveRouteSourceUnknown specifies the effective route source unknown state for effective route source.
    case EffectiveRouteSourceUnknown = "Unknown"
// EffectiveRouteSourceUser specifies the effective route source user state for effective route source.
    case EffectiveRouteSourceUser = "User"
// EffectiveRouteSourceVirtualNetworkGateway specifies the effective route source virtual network gateway state for
// effective route source.
    case EffectiveRouteSourceVirtualNetworkGateway = "VirtualNetworkGateway"
}


// EffectiveRouteState enumerates the values for effective route 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 EffectiveRouteStateEnum: String, Codable
{
// Active specifies the active state for effective route state.
    case Active = "Active"
// Invalid specifies the invalid state for effective route state.
    case Invalid = "Invalid"
}


// EffectiveSecurityRuleProtocol enumerates the values for effective security rule protocol.

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


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

        enum CodingKeys: String, CodingKey {case id = "id"
        case name = "name"
        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(.name) {
        self.name = try container.decode(String?.self, forKey: .name)
    }
    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.name != nil {try container.encode(self.name, forKey: .name)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
  }
}

extension DataFactory {
  public static func createEndpointServiceResultProtocol() -> EndpointServiceResultProtocol {
    return EndpointServiceResultData()
  }
}


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

extension DataFactory {
  public static func createEndpointServicesListResultProtocol() -> EndpointServicesListResultProtocol {
    return EndpointServicesListResultData()
  }
}


// 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 ErrorData : ErrorProtocol {
    public var code: String?
    public var message: String?
    public var target: String?
    public var details: [ErrorDetailsProtocol?]?
    public var innerError: String?

        enum CodingKeys: String, CodingKey {case code = "code"
        case message = "message"
        case target = "target"
        case details = "details"
        case innerError = "innerError"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createErrorProtocol() -> ErrorProtocol {
    return ErrorData()
  }
}


// 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 ErrorDetailsData : ErrorDetailsProtocol {
    public var code: String?
    public var target: String?
    public var message: String?

        enum CodingKeys: String, CodingKey {case code = "code"
        case target = "target"
        case message = "message"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createErrorDetailsProtocol() -> ErrorDetailsProtocol {
    return ErrorDetailsData()
  }
}


// EvaluationState enumerates the values for evaluation 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 EvaluationStateEnum: String, Codable
{
// Completed specifies the completed state for evaluation state.
    case Completed = "Completed"
// InProgress specifies the in progress state for evaluation state.
    case InProgress = "InProgress"
// NotStarted specifies the not started state for evaluation state.
    case NotStarted = "NotStarted"
}


// 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 ExpressRouteCircuitArpTableData : ExpressRouteCircuitArpTableProtocol {
    public var age: Int32?
    public var interface: String?
    public var ipAddress: String?
    public var macAddress: String?

        enum CodingKeys: String, CodingKey {case age = "age"
        case interface = "interface"
        case ipAddress = "ipAddress"
        case macAddress = "macAddress"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createExpressRouteCircuitArpTableProtocol() -> ExpressRouteCircuitArpTableProtocol {
    return ExpressRouteCircuitArpTableData()
  }
}


// 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 ExpressRouteCircuitAuthorizationData : ExpressRouteCircuitAuthorizationProtocol, SubResourceProtocol {
    public var id: String?
    public var properties: AuthorizationPropertiesFormatProtocol?
    public var name: String?
    public var etag: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createExpressRouteCircuitAuthorizationProtocol() -> ExpressRouteCircuitAuthorizationProtocol {
    return ExpressRouteCircuitAuthorizationData()
  }
}


// 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 ExpressRouteCircuitData : ExpressRouteCircuitProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?
    public var sku: ExpressRouteCircuitSkuProtocol?
    public var properties: ExpressRouteCircuitPropertiesFormatProtocol?
    public var etag: String?

        enum CodingKeys: String, CodingKey {case id = "id"
        case name = "name"
        case type = "type"
        case location = "location"
        case tags = "tags"
        case sku = "sku"
        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(.sku) {
        self.sku = try container.decode(ExpressRouteCircuitSkuData?.self, forKey: .sku)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(ExpressRouteCircuitPropertiesFormatData?.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.sku != nil {try container.encode(self.sku as! ExpressRouteCircuitSkuData?, forKey: .sku)}
    if self.properties != nil {try container.encode(self.properties as! ExpressRouteCircuitPropertiesFormatData?, forKey: .properties)}
    if self.etag != nil {try container.encode(self.etag, forKey: .etag)}
  }
}

extension DataFactory {
  public static func createExpressRouteCircuitProtocol() -> ExpressRouteCircuitProtocol {
    return ExpressRouteCircuitData()
  }
}


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

extension DataFactory {
  public static func createExpressRouteCircuitListResultProtocol() -> ExpressRouteCircuitListResultProtocol {
    return ExpressRouteCircuitListResultData()
  }
}


// ExpressRouteCircuitPeeringAdvertisedPublicPrefixState enumerates the values for express route circuit peering
// advertised public prefix 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 ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateEnum: String, Codable
{
// Configured specifies the configured state for express route circuit peering advertised public prefix state.
    case Configured = "Configured"
// Configuring specifies the configuring state for express route circuit peering advertised public prefix state.
    case Configuring = "Configuring"
// NotConfigured specifies the not configured state for express route circuit peering advertised public prefix state.
    case NotConfigured = "NotConfigured"
// ValidationNeeded specifies the validation needed state for express route circuit peering advertised public prefix
// state.
    case ValidationNeeded = "ValidationNeeded"
}


// 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 ExpressRouteCircuitPeeringConfigData : ExpressRouteCircuitPeeringConfigProtocol {
    public var advertisedPublicPrefixes: [String]?
    public var advertisedCommunities: [String]?
    public var advertisedPublicPrefixesState: ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateEnum?
    public var legacyMode: Int32?
    public var customerASN: Int32?
    public var routingRegistryName: String?

        enum CodingKeys: String, CodingKey {case advertisedPublicPrefixes = "advertisedPublicPrefixes"
        case advertisedCommunities = "advertisedCommunities"
        case advertisedPublicPrefixesState = "advertisedPublicPrefixesState"
        case legacyMode = "legacyMode"
        case customerASN = "customerASN"
        case routingRegistryName = "routingRegistryName"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createExpressRouteCircuitPeeringConfigProtocol() -> ExpressRouteCircuitPeeringConfigProtocol {
    return ExpressRouteCircuitPeeringConfigData()
  }
}


// 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 ExpressRouteCircuitPeeringData : ExpressRouteCircuitPeeringProtocol, SubResourceProtocol {
    public var id: String?
    public var properties: ExpressRouteCircuitPeeringPropertiesFormatProtocol?
    public var name: String?
    public var etag: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createExpressRouteCircuitPeeringProtocol() -> ExpressRouteCircuitPeeringProtocol {
    return ExpressRouteCircuitPeeringData()
  }
}


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

extension DataFactory {
  public static func createExpressRouteCircuitPeeringListResultProtocol() -> ExpressRouteCircuitPeeringListResultProtocol {
    return ExpressRouteCircuitPeeringListResultData()
  }
}


// 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 ExpressRouteCircuitPeeringPropertiesFormatData : ExpressRouteCircuitPeeringPropertiesFormatProtocol {
    public var peeringType: ExpressRouteCircuitPeeringTypeEnum?
    public var state: ExpressRouteCircuitPeeringStateEnum?
    public var azureASN: Int32?
    public var peerASN: Int64?
    public var primaryPeerAddressPrefix: String?
    public var secondaryPeerAddressPrefix: String?
    public var primaryAzurePort: String?
    public var secondaryAzurePort: String?
    public var sharedKey: String?
    public var vlanId: Int32?
    public var microsoftPeeringConfig: ExpressRouteCircuitPeeringConfigProtocol?
    public var stats: ExpressRouteCircuitStatsProtocol?
    public var provisioningState: String?
    public var gatewayManagerEtag: String?
    public var lastModifiedBy: String?
    public var routeFilter: RouteFilterProtocol?
    public var ipv6PeeringConfig: Ipv6ExpressRouteCircuitPeeringConfigProtocol?

        enum CodingKeys: String, CodingKey {case peeringType = "peeringType"
        case state = "state"
        case azureASN = "azureASN"
        case peerASN = "peerASN"
        case primaryPeerAddressPrefix = "primaryPeerAddressPrefix"
        case secondaryPeerAddressPrefix = "secondaryPeerAddressPrefix"
        case primaryAzurePort = "primaryAzurePort"
        case secondaryAzurePort = "secondaryAzurePort"
        case sharedKey = "sharedKey"
        case vlanId = "vlanId"
        case microsoftPeeringConfig = "microsoftPeeringConfig"
        case stats = "stats"
        case provisioningState = "provisioningState"
        case gatewayManagerEtag = "gatewayManagerEtag"
        case lastModifiedBy = "lastModifiedBy"
        case routeFilter = "routeFilter"
        case ipv6PeeringConfig = "ipv6PeeringConfig"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.peeringType) {
        self.peeringType = try container.decode(ExpressRouteCircuitPeeringTypeEnum?.self, forKey: .peeringType)
    }
    if container.contains(.state) {
        self.state = try container.decode(ExpressRouteCircuitPeeringStateEnum?.self, forKey: .state)
    }
    if container.contains(.azureASN) {
        self.azureASN = try container.decode(Int32?.self, forKey: .azureASN)
    }
    if container.contains(.peerASN) {
        self.peerASN = try container.decode(Int64?.self, forKey: .peerASN)
    }
    if container.contains(.primaryPeerAddressPrefix) {
        self.primaryPeerAddressPrefix = try container.decode(String?.self, forKey: .primaryPeerAddressPrefix)
    }
    if container.contains(.secondaryPeerAddressPrefix) {
        self.secondaryPeerAddressPrefix = try container.decode(String?.self, forKey: .secondaryPeerAddressPrefix)
    }
    if container.contains(.primaryAzurePort) {
        self.primaryAzurePort = try container.decode(String?.self, forKey: .primaryAzurePort)
    }
    if container.contains(.secondaryAzurePort) {
        self.secondaryAzurePort = try container.decode(String?.self, forKey: .secondaryAzurePort)
    }
    if container.contains(.sharedKey) {
        self.sharedKey = try container.decode(String?.self, forKey: .sharedKey)
    }
    if container.contains(.vlanId) {
        self.vlanId = try container.decode(Int32?.self, forKey: .vlanId)
    }
    if container.contains(.microsoftPeeringConfig) {
        self.microsoftPeeringConfig = try container.decode(ExpressRouteCircuitPeeringConfigData?.self, forKey: .microsoftPeeringConfig)
    }
    if container.contains(.stats) {
        self.stats = try container.decode(ExpressRouteCircuitStatsData?.self, forKey: .stats)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(String?.self, forKey: .provisioningState)
    }
    if container.contains(.gatewayManagerEtag) {
        self.gatewayManagerEtag = try container.decode(String?.self, forKey: .gatewayManagerEtag)
    }
    if container.contains(.lastModifiedBy) {
        self.lastModifiedBy = try container.decode(String?.self, forKey: .lastModifiedBy)
    }
    if container.contains(.routeFilter) {
        self.routeFilter = try container.decode(RouteFilterData?.self, forKey: .routeFilter)
    }
    if container.contains(.ipv6PeeringConfig) {
        self.ipv6PeeringConfig = try container.decode(Ipv6ExpressRouteCircuitPeeringConfigData?.self, forKey: .ipv6PeeringConfig)
    }
    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.peeringType != nil {try container.encode(self.peeringType, forKey: .peeringType)}
    if self.state != nil {try container.encode(self.state, forKey: .state)}
    if self.azureASN != nil {try container.encode(self.azureASN, forKey: .azureASN)}
    if self.peerASN != nil {try container.encode(self.peerASN, forKey: .peerASN)}
    if self.primaryPeerAddressPrefix != nil {try container.encode(self.primaryPeerAddressPrefix, forKey: .primaryPeerAddressPrefix)}
    if self.secondaryPeerAddressPrefix != nil {try container.encode(self.secondaryPeerAddressPrefix, forKey: .secondaryPeerAddressPrefix)}
    if self.primaryAzurePort != nil {try container.encode(self.primaryAzurePort, forKey: .primaryAzurePort)}
    if self.secondaryAzurePort != nil {try container.encode(self.secondaryAzurePort, forKey: .secondaryAzurePort)}
    if self.sharedKey != nil {try container.encode(self.sharedKey, forKey: .sharedKey)}
    if self.vlanId != nil {try container.encode(self.vlanId, forKey: .vlanId)}
    if self.microsoftPeeringConfig != nil {try container.encode(self.microsoftPeeringConfig as! ExpressRouteCircuitPeeringConfigData?, forKey: .microsoftPeeringConfig)}
    if self.stats != nil {try container.encode(self.stats as! ExpressRouteCircuitStatsData?, forKey: .stats)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.gatewayManagerEtag != nil {try container.encode(self.gatewayManagerEtag, forKey: .gatewayManagerEtag)}
    if self.lastModifiedBy != nil {try container.encode(self.lastModifiedBy, forKey: .lastModifiedBy)}
    if self.routeFilter != nil {try container.encode(self.routeFilter as! RouteFilterData?, forKey: .routeFilter)}
    if self.ipv6PeeringConfig != nil {try container.encode(self.ipv6PeeringConfig as! Ipv6ExpressRouteCircuitPeeringConfigData?, forKey: .ipv6PeeringConfig)}
  }
}

extension DataFactory {
  public static func createExpressRouteCircuitPeeringPropertiesFormatProtocol() -> ExpressRouteCircuitPeeringPropertiesFormatProtocol {
    return ExpressRouteCircuitPeeringPropertiesFormatData()
  }
}