import Foundation
import azureSwiftRuntime
public protocol ZonesListByResourceGroup  {
    var nextLink: String? { get }
    var hasAdditionalPages : Bool { get }
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var subscriptionId : String { get set }
    var top : Int32? { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (ZoneListResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Zones {
// ListByResourceGroup lists the DNS zones within a resource group.
    internal class ListByResourceGroupCommand : BaseCommand, ZonesListByResourceGroup {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var resourceGroupName : String
        public var subscriptionId : String
        public var top : Int32?
        public var apiVersion = "2017-10-01"

        public init(resourceGroupName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            if self.top != nil { queryParameters["$top"] = String(describing: self.top!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "NextLink"
                }
                let result = try decoder.decode(ZoneListResultData?.self, from: data)
                if var pageDecoder = decoder as? PageDecoder {
                    self.nextLink = pageDecoder.nextLink
                }
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (ZoneListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: ZoneListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol ZonesUpdate  {
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var zoneName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    var ifMatch : String? { get set }
    var parameters :  ZoneProtocol?  { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (ZoneProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Zones {
// Update updates a DNS zone. Does not modify DNS records within the zone.
    internal class UpdateCommand : BaseCommand, ZonesUpdate {
        public var resourceGroupName : String
        public var zoneName : String
        public var subscriptionId : String
        public var apiVersion = "2017-10-01"
        public var ifMatch : String?
    public var parameters :  ZoneProtocol?

        public init(resourceGroupName: String, zoneName: String, subscriptionId: String, parameters: ZoneProtocol) {
            self.resourceGroupName = resourceGroupName
            self.zoneName = zoneName
            self.subscriptionId = subscriptionId
            self.parameters = parameters
            super.init()
            self.method = "Patch"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{zoneName}"] = String(describing: self.zoneName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.ifMatch != nil { headerParameters["If-Match"] = String(describing: self.ifMatch!) }
            self.body = parameters

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(parameters as? ZoneData)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                let result = try decoder.decode(ZoneData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (ZoneProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: ZoneData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


// 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 AaaaRecordData : AaaaRecordProtocol {
    public var ipv6Address: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createAaaaRecordProtocol() -> AaaaRecordProtocol {
    return AaaaRecordData()
  }
}


// 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 ARecordData : ARecordProtocol {
    public var ipv4Address: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createARecordProtocol() -> ARecordProtocol {
    return ARecordData()
  }
}


// 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 CaaRecordData : CaaRecordProtocol {
    public var flags: Int32?
    public var tag: String?
    public var value: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createCaaRecordProtocol() -> CaaRecordProtocol {
    return CaaRecordData()
  }
}


// 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 CloudErrorBodyData : CloudErrorBodyProtocol {
    public var code: String?
    public var message: String?
    public var target: String?
    public var details: [CloudErrorBodyProtocol?]?

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

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

extension DataFactory {
  public static func createCloudErrorBodyProtocol() -> CloudErrorBodyProtocol {
    return CloudErrorBodyData()
  }
}


// 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 CloudErrorData : CloudErrorProtocol {
    public var error: CloudErrorBodyProtocol?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createCloudErrorProtocol() -> CloudErrorProtocol {
    return CloudErrorData()
  }
}


// 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 CnameRecordData : CnameRecordProtocol {
    public var cname: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createCnameRecordProtocol() -> CnameRecordProtocol {
    return CnameRecordData()
  }
}


// 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 MxRecordData : MxRecordProtocol {
    public var preference: Int32?
    public var exchange: String?

        enum CodingKeys: String, CodingKey {case preference = "preference"
        case exchange = "exchange"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createMxRecordProtocol() -> MxRecordProtocol {
    return MxRecordData()
  }
}


// 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 NsRecordData : NsRecordProtocol {
    public var nsdname: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createNsRecordProtocol() -> NsRecordProtocol {
    return NsRecordData()
  }
}


// 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 PtrRecordData : PtrRecordProtocol {
    public var ptrdname: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createPtrRecordProtocol() -> PtrRecordProtocol {
    return PtrRecordData()
  }
}


// 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 RecordSetData : RecordSetProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var etag: String?
    public var properties: RecordSetPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createRecordSetProtocol() -> RecordSetProtocol {
    return RecordSetData()
  }
}


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

extension DataFactory {
  public static func createRecordSetListResultProtocol() -> RecordSetListResultProtocol {
    return RecordSetListResultData()
  }
}


// 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 RecordSetPropertiesData : RecordSetPropertiesProtocol {
    public var metadata: [String:String]?
    public var tTL: Int64?
    public var fqdn: String?
    public var aRecords: [ARecordProtocol?]?
    public var aaaaRecords: [AaaaRecordProtocol?]?
    public var mxRecords: [MxRecordProtocol?]?
    public var nsRecords: [NsRecordProtocol?]?
    public var ptrRecords: [PtrRecordProtocol?]?
    public var srvRecords: [SrvRecordProtocol?]?
    public var txtRecords: [TxtRecordProtocol?]?
    public var cnameRecord: CnameRecordProtocol?
    public var soaRecord: SoaRecordProtocol?
    public var caaRecords: [CaaRecordProtocol?]?

        enum CodingKeys: String, CodingKey {case metadata = "metadata"
        case tTL = "TTL"
        case fqdn = "fqdn"
        case aRecords = "ARecords"
        case aaaaRecords = "AAAARecords"
        case mxRecords = "MXRecords"
        case nsRecords = "NSRecords"
        case ptrRecords = "PTRRecords"
        case srvRecords = "SRVRecords"
        case txtRecords = "TXTRecords"
        case cnameRecord = "CNAMERecord"
        case soaRecord = "SOARecord"
        case caaRecords = "caaRecords"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.metadata) {
        self.metadata = try container.decode([String:String]?.self, forKey: .metadata)
    }
    if container.contains(.tTL) {
        self.tTL = try container.decode(Int64?.self, forKey: .tTL)
    }
    if container.contains(.fqdn) {
        self.fqdn = try container.decode(String?.self, forKey: .fqdn)
    }
    if container.contains(.aRecords) {
        self.aRecords = try container.decode([ARecordData?]?.self, forKey: .aRecords)
    }
    if container.contains(.aaaaRecords) {
        self.aaaaRecords = try container.decode([AaaaRecordData?]?.self, forKey: .aaaaRecords)
    }
    if container.contains(.mxRecords) {
        self.mxRecords = try container.decode([MxRecordData?]?.self, forKey: .mxRecords)
    }
    if container.contains(.nsRecords) {
        self.nsRecords = try container.decode([NsRecordData?]?.self, forKey: .nsRecords)
    }
    if container.contains(.ptrRecords) {
        self.ptrRecords = try container.decode([PtrRecordData?]?.self, forKey: .ptrRecords)
    }
    if container.contains(.srvRecords) {
        self.srvRecords = try container.decode([SrvRecordData?]?.self, forKey: .srvRecords)
    }
    if container.contains(.txtRecords) {
        self.txtRecords = try container.decode([TxtRecordData?]?.self, forKey: .txtRecords)
    }
    if container.contains(.cnameRecord) {
        self.cnameRecord = try container.decode(CnameRecordData?.self, forKey: .cnameRecord)
    }
    if container.contains(.soaRecord) {
        self.soaRecord = try container.decode(SoaRecordData?.self, forKey: .soaRecord)
    }
    if container.contains(.caaRecords) {
        self.caaRecords = try container.decode([CaaRecordData?]?.self, forKey: .caaRecords)
    }
    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.metadata != nil {try container.encode(self.metadata, forKey: .metadata)}
    if self.tTL != nil {try container.encode(self.tTL, forKey: .tTL)}
    if self.fqdn != nil {try container.encode(self.fqdn, forKey: .fqdn)}
    if self.aRecords != nil {try container.encode(self.aRecords as! [ARecordData?]?, forKey: .aRecords)}
    if self.aaaaRecords != nil {try container.encode(self.aaaaRecords as! [AaaaRecordData?]?, forKey: .aaaaRecords)}
    if self.mxRecords != nil {try container.encode(self.mxRecords as! [MxRecordData?]?, forKey: .mxRecords)}
    if self.nsRecords != nil {try container.encode(self.nsRecords as! [NsRecordData?]?, forKey: .nsRecords)}
    if self.ptrRecords != nil {try container.encode(self.ptrRecords as! [PtrRecordData?]?, forKey: .ptrRecords)}
    if self.srvRecords != nil {try container.encode(self.srvRecords as! [SrvRecordData?]?, forKey: .srvRecords)}
    if self.txtRecords != nil {try container.encode(self.txtRecords as! [TxtRecordData?]?, forKey: .txtRecords)}
    if self.cnameRecord != nil {try container.encode(self.cnameRecord as! CnameRecordData?, forKey: .cnameRecord)}
    if self.soaRecord != nil {try container.encode(self.soaRecord as! SoaRecordData?, forKey: .soaRecord)}
    if self.caaRecords != nil {try container.encode(self.caaRecords as! [CaaRecordData?]?, forKey: .caaRecords)}
  }
}

extension DataFactory {
  public static func createRecordSetPropertiesProtocol() -> RecordSetPropertiesProtocol {
    return RecordSetPropertiesData()
  }
}


// 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 RecordSetUpdateParametersData : RecordSetUpdateParametersProtocol {
    public var recordSet: RecordSetProtocol?

        enum CodingKeys: String, CodingKey {case recordSet = "RecordSet"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createRecordSetUpdateParametersProtocol() -> RecordSetUpdateParametersProtocol {
    return RecordSetUpdateParametersData()
  }
}


// RecordType enumerates the values for record type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum RecordTypeEnum: String, Codable
{
// A specifies the a state for record type.
    case A = "A"
// AAAA specifies the aaaa state for record type.
    case AAAA = "AAAA"
// CAA specifies the caa state for record type.
    case CAA = "CAA"
// CNAME specifies the cname state for record type.
    case CNAME = "CNAME"
// MX specifies the mx state for record type.
    case MX = "MX"
// NS specifies the ns state for record type.
    case NS = "NS"
// PTR specifies the ptr state for record type.
    case PTR = "PTR"
// SOA specifies the soa state for record type.
    case SOA = "SOA"
// SRV specifies the srv state for record type.
    case SRV = "SRV"
// TXT specifies the txt state for record type.
    case TXT = "TXT"
}


// 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 ResourceData : ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?

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

  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 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)}
  }
}

extension DataFactory {
  public static func createResourceProtocol() -> ResourceProtocol {
    return ResourceData()
  }
}


// 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 SoaRecordData : SoaRecordProtocol {
    public var host: String?
    public var email: String?
    public var serialNumber: Int64?
    public var refreshTime: Int64?
    public var retryTime: Int64?
    public var expireTime: Int64?
    public var minimumTtl: Int64?

        enum CodingKeys: String, CodingKey {case host = "host"
        case email = "email"
        case serialNumber = "serialNumber"
        case refreshTime = "refreshTime"
        case retryTime = "retryTime"
        case expireTime = "expireTime"
        case minimumTtl = "minimumTTL"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.host) {
        self.host = try container.decode(String?.self, forKey: .host)
    }
    if container.contains(.email) {
        self.email = try container.decode(String?.self, forKey: .email)
    }
    if container.contains(.serialNumber) {
        self.serialNumber = try container.decode(Int64?.self, forKey: .serialNumber)
    }
    if container.contains(.refreshTime) {
        self.refreshTime = try container.decode(Int64?.self, forKey: .refreshTime)
    }
    if container.contains(.retryTime) {
        self.retryTime = try container.decode(Int64?.self, forKey: .retryTime)
    }
    if container.contains(.expireTime) {
        self.expireTime = try container.decode(Int64?.self, forKey: .expireTime)
    }
    if container.contains(.minimumTtl) {
        self.minimumTtl = try container.decode(Int64?.self, forKey: .minimumTtl)
    }
    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.host != nil {try container.encode(self.host, forKey: .host)}
    if self.email != nil {try container.encode(self.email, forKey: .email)}
    if self.serialNumber != nil {try container.encode(self.serialNumber, forKey: .serialNumber)}
    if self.refreshTime != nil {try container.encode(self.refreshTime, forKey: .refreshTime)}
    if self.retryTime != nil {try container.encode(self.retryTime, forKey: .retryTime)}
    if self.expireTime != nil {try container.encode(self.expireTime, forKey: .expireTime)}
    if self.minimumTtl != nil {try container.encode(self.minimumTtl, forKey: .minimumTtl)}
  }
}

extension DataFactory {
  public static func createSoaRecordProtocol() -> SoaRecordProtocol {
    return SoaRecordData()
  }
}


// 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 SrvRecordData : SrvRecordProtocol {
    public var priority: Int32?
    public var weight: Int32?
    public var port: Int32?
    public var target: String?

        enum CodingKeys: String, CodingKey {case priority = "priority"
        case weight = "weight"
        case port = "port"
        case target = "target"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createSrvRecordProtocol() -> SrvRecordProtocol {
    return SrvRecordData()
  }
}


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

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

  public init()  {
  }

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

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

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


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

        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([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)
    if self.value != nil {try container.encode(self.value as! [String]?, forKey: .value)}
  }
}

extension DataFactory {
  public static func createTxtRecordProtocol() -> TxtRecordProtocol {
    return TxtRecordData()
  }
}


// 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 ZoneData : ZoneProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?
    public var etag: String?
    public var properties: ZonePropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createZoneProtocol() -> ZoneProtocol {
    return ZoneData()
  }
}


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

extension DataFactory {
  public static func createZoneListResultProtocol() -> ZoneListResultProtocol {
    return ZoneListResultData()
  }
}


// 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 ZonePropertiesData : ZonePropertiesProtocol {
    public var maxNumberOfRecordSets: Int64?
    public var numberOfRecordSets: Int64?
    public var nameServers: [String]?

        enum CodingKeys: String, CodingKey {case maxNumberOfRecordSets = "maxNumberOfRecordSets"
        case numberOfRecordSets = "numberOfRecordSets"
        case nameServers = "nameServers"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createZonePropertiesProtocol() -> ZonePropertiesProtocol {
    return ZonePropertiesData()
  }
}


// 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
// AaaaRecordProtocol is an AAAA record.
public protocol AaaaRecordProtocol : Codable {
     var ipv6Address: String? { get set }
}


// 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
// ARecordProtocol is an A record.
public protocol ARecordProtocol : Codable {
     var ipv4Address: String? { get set }
}


// 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
// CaaRecordProtocol is a CAA record.
public protocol CaaRecordProtocol : Codable {
     var flags: Int32? { get set }
     var tag: String? { get set }
     var value: String? { get set }
}


// 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
// CloudErrorBodyProtocol is the body of an error message
public protocol CloudErrorBodyProtocol : Codable {
     var code: String? { get set }
     var message: String? { get set }
     var target: String? { get set }
     var details: [CloudErrorBodyProtocol?]? { get set }
}


// 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
// CloudErrorProtocol is an error message
public protocol CloudErrorProtocol : Codable {
     var error: CloudErrorBodyProtocol? { get set }
}


// 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
// CnameRecordProtocol is a CNAME record.
public protocol CnameRecordProtocol : Codable {
     var cname: String? { get set }
}


// 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
// MxRecordProtocol is an MX record.
public protocol MxRecordProtocol : Codable {
     var preference: Int32? { get set }
     var exchange: String? { get set }
}


// 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
// NsRecordProtocol is an NS record.
public protocol NsRecordProtocol : Codable {
     var nsdname: String? { get set }
}


// 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
// PtrRecordProtocol is a PTR record.
public protocol PtrRecordProtocol : Codable {
     var ptrdname: String? { get set }
}


// 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
// RecordSetListResultProtocol is the response to a record set List operation.
public protocol RecordSetListResultProtocol : Codable {
     var value: [RecordSetProtocol?]? { get set }
     var _nextLink: String? { get set }
}


// 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
// RecordSetPropertiesProtocol is represents the properties of the records in the record set.
public protocol RecordSetPropertiesProtocol : Codable {
     var metadata: [String:String]? { get set }
     var tTL: Int64? { get set }
     var fqdn: String? { get set }
     var aRecords: [ARecordProtocol?]? { get set }
     var aaaaRecords: [AaaaRecordProtocol?]? { get set }
     var mxRecords: [MxRecordProtocol?]? { get set }
     var nsRecords: [NsRecordProtocol?]? { get set }
     var ptrRecords: [PtrRecordProtocol?]? { get set }
     var srvRecords: [SrvRecordProtocol?]? { get set }
     var txtRecords: [TxtRecordProtocol?]? { get set }
     var cnameRecord: CnameRecordProtocol? { get set }
     var soaRecord: SoaRecordProtocol? { get set }
     var caaRecords: [CaaRecordProtocol?]? { get set }
}


// 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
// RecordSetProtocol is describes a DNS record set (a collection of DNS records with the same name and type).
public protocol RecordSetProtocol : Codable {
     var id: String? { get set }
     var name: String? { get set }
     var type: String? { get set }
     var etag: String? { get set }
     var properties: RecordSetPropertiesProtocol? { get set }
}


// 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
// RecordSetUpdateParametersProtocol is parameters supplied to update a record set.
public protocol RecordSetUpdateParametersProtocol : Codable {
     var recordSet: RecordSetProtocol? { get set }
}


// 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
// ResourceProtocol is common properties of an Azure Resource Manager resource
public protocol ResourceProtocol : Codable {
     var id: String? { get set }
     var name: String? { get set }
     var type: String? { get set }
     var location: String? { get set }
     var tags: [String:String]? { get set }
}


// 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
// SoaRecordProtocol is an SOA record.
public protocol SoaRecordProtocol : Codable {
     var host: String? { get set }
     var email: String? { get set }
     var serialNumber: Int64? { get set }
     var refreshTime: Int64? { get set }
     var retryTime: Int64? { get set }
     var expireTime: Int64? { get set }
     var minimumTtl: Int64? { get set }
}


// 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
// SrvRecordProtocol is an SRV record.
public protocol SrvRecordProtocol : Codable {
     var priority: Int32? { get set }
     var weight: Int32? { get set }
     var port: Int32? { get set }
     var target: String? { get set }
}


// 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
// SubResourceProtocol is a reference to a another resource
public protocol SubResourceProtocol : Codable {
     var id: String? { get set }
}


// 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
// TxtRecordProtocol is a TXT record.
public protocol TxtRecordProtocol : Codable {
     var value: [String]? { get set }
}


// 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
// ZoneListResultProtocol is the response to a Zone List or ListAll operation.
public protocol ZoneListResultProtocol : Codable {
     var value: [ZoneProtocol?]? { get set }
     var _nextLink: String? { get set }
}


// 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
// ZonePropertiesProtocol is represents the properties of the zone.
public protocol ZonePropertiesProtocol : Codable {
     var maxNumberOfRecordSets: Int64? { get set }
     var numberOfRecordSets: Int64? { get set }
     var nameServers: [String]? { get set }
}


// 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
// ZoneProtocol is describes a DNS zone.
public protocol ZoneProtocol : ResourceProtocol {
     var etag: String? { get set }
     var properties: ZonePropertiesProtocol? { get set }
}


// swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
    name: "eventhub",
    products: [
        // Products define the executables and libraries produced by a package, and make them visible to other packages.
        .library(
            name: "eventhub",
            targets: ["eventhub"]),
    ],
    dependencies: [
        // Dependencies declare other packages that this package depends on.
        .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.0.10"),
        .package(url: "https://github.com/ReactiveX/RxSwift.git", from: "3.4.2"),
        .package(url: "https://github.com/SwiftyJSON/SwiftyJSON.git", from: "3.1.4"),
        .package(url: "git@github.com:alvadb/autorest-clientruntime-for-swift.git", .branch("master"))
    ],
    targets: [
        // Targets are the basic building blocks of a package. A target can define a module or a test suite.
        // Targets can depend on other targets in this package, and on products in packages which this package depends on.
        .target(
            name: "eventhub",
            dependencies: ["Alamofire", "RxSwift", "SwiftyJSON", "azureSwiftRuntime"])
    ]
)


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

// ConsumerGroups is the azure Event Hubs client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct ConsumerGroups {
    public static func CreateOrUpdate(resourceGroupName: String, namespaceName: String, eventHubName: String, consumerGroupName: String, subscriptionId: String, parameters: ConsumerGroupProtocol) -> ConsumerGroupsCreateOrUpdate {
        return CreateOrUpdateCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, eventHubName: eventHubName, consumerGroupName: consumerGroupName, subscriptionId: subscriptionId, parameters: parameters)
    }
    public static func Delete(resourceGroupName: String, namespaceName: String, eventHubName: String, consumerGroupName: String, subscriptionId: String) -> ConsumerGroupsDelete {
        return DeleteCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, eventHubName: eventHubName, consumerGroupName: consumerGroupName, subscriptionId: subscriptionId)
    }
    public static func Get(resourceGroupName: String, namespaceName: String, eventHubName: String, consumerGroupName: String, subscriptionId: String) -> ConsumerGroupsGet {
        return GetCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, eventHubName: eventHubName, consumerGroupName: consumerGroupName, subscriptionId: subscriptionId)
    }
    public static func ListByEventHub(resourceGroupName: String, namespaceName: String, eventHubName: String, subscriptionId: String) -> ConsumerGroupsListByEventHub {
        return ListByEventHubCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, eventHubName: eventHubName, subscriptionId: subscriptionId)
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol ConsumerGroupsCreateOrUpdate  {
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var namespaceName : String { get set }
    var eventHubName : String { get set }
    var consumerGroupName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    var parameters :  ConsumerGroupProtocol?  { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (ConsumerGroupProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.ConsumerGroups {
// CreateOrUpdate creates or updates an Event Hubs consumer group as a nested resource within a Namespace.
    internal class CreateOrUpdateCommand : BaseCommand, ConsumerGroupsCreateOrUpdate {
        public var resourceGroupName : String
        public var namespaceName : String
        public var eventHubName : String
        public var consumerGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"
    public var parameters :  ConsumerGroupProtocol?

        public init(resourceGroupName: String, namespaceName: String, eventHubName: String, consumerGroupName: String, subscriptionId: String, parameters: ConsumerGroupProtocol) {
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.eventHubName = eventHubName
            self.consumerGroupName = consumerGroupName
            self.subscriptionId = subscriptionId
            self.parameters = parameters
            super.init()
            self.method = "Put"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{namespaceName}"] = String(describing: self.namespaceName)
            self.pathParameters["{eventHubName}"] = String(describing: self.eventHubName)
            self.pathParameters["{consumerGroupName}"] = String(describing: self.consumerGroupName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            self.body = parameters

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(parameters as? ConsumerGroupData)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                let result = try decoder.decode(ConsumerGroupData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (ConsumerGroupProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: ConsumerGroupData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol ConsumerGroupsDelete  {
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var namespaceName : String { get set }
    var eventHubName : String { get set }
    var consumerGroupName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.ConsumerGroups {
// Delete deletes a consumer group from the specified Event Hub and resource group.
    internal class DeleteCommand : BaseCommand, ConsumerGroupsDelete {
        public var resourceGroupName : String
        public var namespaceName : String
        public var eventHubName : String
        public var consumerGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

        public init(resourceGroupName: String, namespaceName: String, eventHubName: String, consumerGroupName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.eventHubName = eventHubName
            self.consumerGroupName = consumerGroupName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{namespaceName}"] = String(describing: self.namespaceName)
            self.pathParameters["{eventHubName}"] = String(describing: self.eventHubName)
            self.pathParameters["{consumerGroupName}"] = String(describing: self.consumerGroupName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol ConsumerGroupsGet  {
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var namespaceName : String { get set }
    var eventHubName : String { get set }
    var consumerGroupName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (ConsumerGroupProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.ConsumerGroups {
// Get gets a description for the specified consumer group.
    internal class GetCommand : BaseCommand, ConsumerGroupsGet {
        public var resourceGroupName : String
        public var namespaceName : String
        public var eventHubName : String
        public var consumerGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

        public init(resourceGroupName: String, namespaceName: String, eventHubName: String, consumerGroupName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.eventHubName = eventHubName
            self.consumerGroupName = consumerGroupName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{namespaceName}"] = String(describing: self.namespaceName)
            self.pathParameters["{eventHubName}"] = String(describing: self.eventHubName)
            self.pathParameters["{consumerGroupName}"] = String(describing: self.consumerGroupName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                let result = try decoder.decode(ConsumerGroupData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (ConsumerGroupProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: ConsumerGroupData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol ConsumerGroupsListByEventHub  {
    var nextLink: String? { get }
    var hasAdditionalPages : Bool { get }
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var namespaceName : String { get set }
    var eventHubName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (ConsumerGroupListResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.ConsumerGroups {
// ListByEventHub gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in
// the Namespace.
    internal class ListByEventHubCommand : BaseCommand, ConsumerGroupsListByEventHub {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var resourceGroupName : String
        public var namespaceName : String
        public var eventHubName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

        public init(resourceGroupName: String, namespaceName: String, eventHubName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.eventHubName = eventHubName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{namespaceName}"] = String(describing: self.namespaceName)
            self.pathParameters["{eventHubName}"] = String(describing: self.eventHubName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "NextLink"
                }
                let result = try decoder.decode(ConsumerGroupListResultData?.self, from: data)
                if var pageDecoder = decoder as? PageDecoder {
                    self.nextLink = pageDecoder.nextLink
                }
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (ConsumerGroupListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: ConsumerGroupListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


// 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 class DataFactory {
}
public class Commands {
}


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

// DisasterRecoveryConfigs is the azure Event Hubs client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct DisasterRecoveryConfigs {
    public static func BreakPairing(resourceGroupName: String, namespaceName: String, alias: String, subscriptionId: String) -> DisasterRecoveryConfigsBreakPairing {
        return BreakPairingCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, alias: alias, subscriptionId: subscriptionId)
    }
    public static func CheckNameAvailability(subscriptionId: String, resourceGroupName: String, namespaceName: String, parameters: CheckNameAvailabilityParameterProtocol) -> DisasterRecoveryConfigsCheckNameAvailability {
        return CheckNameAvailabilityCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, namespaceName: namespaceName, parameters: parameters)
    }
    public static func CreateOrUpdate(resourceGroupName: String, namespaceName: String, alias: String, subscriptionId: String, parameters: ArmDisasterRecoveryProtocol) -> DisasterRecoveryConfigsCreateOrUpdate {
        return CreateOrUpdateCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, alias: alias, subscriptionId: subscriptionId, parameters: parameters)
    }
    public static func Delete(resourceGroupName: String, namespaceName: String, alias: String, subscriptionId: String) -> DisasterRecoveryConfigsDelete {
        return DeleteCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, alias: alias, subscriptionId: subscriptionId)
    }
    public static func FailOver(resourceGroupName: String, namespaceName: String, alias: String, subscriptionId: String) -> DisasterRecoveryConfigsFailOver {
        return FailOverCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, alias: alias, subscriptionId: subscriptionId)
    }
    public static func Get(resourceGroupName: String, namespaceName: String, alias: String, subscriptionId: String) -> DisasterRecoveryConfigsGet {
        return GetCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, alias: alias, subscriptionId: subscriptionId)
    }
    public static func GetAuthorizationRule(resourceGroupName: String, namespaceName: String, alias: String, authorizationRuleName: String, subscriptionId: String) -> DisasterRecoveryConfigsGetAuthorizationRule {
        return GetAuthorizationRuleCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, alias: alias, authorizationRuleName: authorizationRuleName, subscriptionId: subscriptionId)
    }
    public static func List(resourceGroupName: String, namespaceName: String, subscriptionId: String) -> DisasterRecoveryConfigsList {
        return ListCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, subscriptionId: subscriptionId)
    }
    public static func ListAuthorizationRules(resourceGroupName: String, namespaceName: String, alias: String, subscriptionId: String) -> DisasterRecoveryConfigsListAuthorizationRules {
        return ListAuthorizationRulesCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, alias: alias, subscriptionId: subscriptionId)
    }
    public static func ListKeys(resourceGroupName: String, namespaceName: String, alias: String, authorizationRuleName: String, subscriptionId: String) -> DisasterRecoveryConfigsListKeys {
        return ListKeysCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, alias: alias, authorizationRuleName: authorizationRuleName, subscriptionId: subscriptionId)
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol DisasterRecoveryConfigsBreakPairing  {
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var namespaceName : String { get set }
    var alias : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.DisasterRecoveryConfigs {
// BreakPairing this operation disables the Disaster Recovery and stops replicating changes from primary to secondary
// namespaces
    internal class BreakPairingCommand : BaseCommand, DisasterRecoveryConfigsBreakPairing {
        public var resourceGroupName : String
        public var namespaceName : String
        public var alias : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

        public init(resourceGroupName: String, namespaceName: String, alias: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.alias = alias
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/breakPairing"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{namespaceName}"] = String(describing: self.namespaceName)
            self.pathParameters["{alias}"] = String(describing: self.alias)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol DisasterRecoveryConfigsCheckNameAvailability  {
    var headerParameters: [String: String] { get set }
    var subscriptionId : String { get set }
    var resourceGroupName : String { get set }
    var namespaceName : String { get set }
    var apiVersion : String { get set }
    var parameters :  CheckNameAvailabilityParameterProtocol?  { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (CheckNameAvailabilityResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.DisasterRecoveryConfigs {
// CheckNameAvailability check the give Namespace name availability.
    internal class CheckNameAvailabilityCommand : BaseCommand, DisasterRecoveryConfigsCheckNameAvailability {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var namespaceName : String
        public var apiVersion = "2017-04-01"
    public var parameters :  CheckNameAvailabilityParameterProtocol?

        public init(subscriptionId: String, resourceGroupName: String, namespaceName: String, parameters: CheckNameAvailabilityParameterProtocol) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.parameters = parameters
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/CheckNameAvailability"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{namespaceName}"] = String(describing: self.namespaceName)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            self.body = parameters

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(parameters as? CheckNameAvailabilityParameterData)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                let result = try decoder.decode(CheckNameAvailabilityResultData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (CheckNameAvailabilityResultProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: CheckNameAvailabilityResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol DisasterRecoveryConfigsCreateOrUpdate  {
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var namespaceName : String { get set }
    var alias : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    var parameters :  ArmDisasterRecoveryProtocol?  { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (ArmDisasterRecoveryProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.DisasterRecoveryConfigs {
// CreateOrUpdate creates or updates a new Alias(Disaster Recovery configuration)
    internal class CreateOrUpdateCommand : BaseCommand, DisasterRecoveryConfigsCreateOrUpdate {
        public var resourceGroupName : String
        public var namespaceName : String
        public var alias : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"
    public var parameters :  ArmDisasterRecoveryProtocol?

        public init(resourceGroupName: String, namespaceName: String, alias: String, subscriptionId: String, parameters: ArmDisasterRecoveryProtocol) {
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.alias = alias
            self.subscriptionId = subscriptionId
            self.parameters = parameters
            super.init()
            self.method = "Put"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{namespaceName}"] = String(describing: self.namespaceName)
            self.pathParameters["{alias}"] = String(describing: self.alias)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            self.body = parameters

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(parameters as? ArmDisasterRecoveryData)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                let result = try decoder.decode(ArmDisasterRecoveryData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (ArmDisasterRecoveryProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: ArmDisasterRecoveryData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol DisasterRecoveryConfigsDelete  {
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var namespaceName : String { get set }
    var alias : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.DisasterRecoveryConfigs {
// Delete deletes an Alias(Disaster Recovery configuration)
    internal class DeleteCommand : BaseCommand, DisasterRecoveryConfigsDelete {
        public var resourceGroupName : String
        public var namespaceName : String
        public var alias : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

        public init(resourceGroupName: String, namespaceName: String, alias: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.alias = alias
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{namespaceName}"] = String(describing: self.namespaceName)
            self.pathParameters["{alias}"] = String(describing: self.alias)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol DisasterRecoveryConfigsFailOver  {
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var namespaceName : String { get set }
    var alias : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.DisasterRecoveryConfigs {
// FailOver envokes GEO DR failover and reconfigure the alias to point to the secondary namespace
    internal class FailOverCommand : BaseCommand, DisasterRecoveryConfigsFailOver {
        public var resourceGroupName : String
        public var namespaceName : String
        public var alias : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

        public init(resourceGroupName: String, namespaceName: String, alias: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.alias = alias
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/failover"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{namespaceName}"] = String(describing: self.namespaceName)
            self.pathParameters["{alias}"] = String(describing: self.alias)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol DisasterRecoveryConfigsGet  {
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var namespaceName : String { get set }
    var alias : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (ArmDisasterRecoveryProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.DisasterRecoveryConfigs {
// Get retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace
    internal class GetCommand : BaseCommand, DisasterRecoveryConfigsGet {
        public var resourceGroupName : String
        public var namespaceName : String
        public var alias : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

        public init(resourceGroupName: String, namespaceName: String, alias: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.alias = alias
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{namespaceName}"] = String(describing: self.namespaceName)
            self.pathParameters["{alias}"] = String(describing: self.alias)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                let result = try decoder.decode(ArmDisasterRecoveryData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (ArmDisasterRecoveryProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: ArmDisasterRecoveryData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol DisasterRecoveryConfigsGetAuthorizationRule  {
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var namespaceName : String { get set }
    var alias : String { get set }
    var authorizationRuleName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (AuthorizationRuleProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.DisasterRecoveryConfigs {
// GetAuthorizationRule gets an AuthorizationRule for a Namespace by rule name.
    internal class GetAuthorizationRuleCommand : BaseCommand, DisasterRecoveryConfigsGetAuthorizationRule {
        public var resourceGroupName : String
        public var namespaceName : String
        public var alias : String
        public var authorizationRuleName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

        public init(resourceGroupName: String, namespaceName: String, alias: String, authorizationRuleName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.alias = alias
            self.authorizationRuleName = authorizationRuleName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/AuthorizationRules/{authorizationRuleName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{namespaceName}"] = String(describing: self.namespaceName)
            self.pathParameters["{alias}"] = String(describing: self.alias)
            self.pathParameters["{authorizationRuleName}"] = String(describing: self.authorizationRuleName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                let result = try decoder.decode(AuthorizationRuleData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (AuthorizationRuleProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: AuthorizationRuleData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}