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

extension Commands.Jobs {
// ListOutputFiles list all files inside the given output directory (Only if the output directory is on Azure File
// Share or Azure Storage container).
    internal class ListOutputFilesCommand : BaseCommand, JobsListOutputFiles {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var resourceGroupName : String
        public var jobName : String
        public var subscriptionId : String
        public var outputdirectoryid : String
        public var linkexpiryinminutes : Int32?
        public var maxResults : Int32?
        public var apiVersion = "2017-09-01-preview"

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

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{jobName}"] = String(describing: self.jobName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["outputdirectoryid"] = String(describing: self.outputdirectoryid)
            if self.linkexpiryinminutes != nil { queryParameters["linkexpiryinminutes"] = String(describing: self.linkexpiryinminutes!) }
            if self.maxResults != nil { queryParameters["maxresults"] = String(describing: self.maxResults!) }
            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(FileListResultData?.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 (FileListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: FileListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.Jobs {
// ListRemoteLoginInformation gets the IP address and port information of all the compute nodes which are used for job
// execution.
    internal class ListRemoteLoginInformationCommand : BaseCommand, JobsListRemoteLoginInformation {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var resourceGroupName : String
        public var jobName : String
        public var subscriptionId : String
        public var apiVersion = "2017-09-01-preview"

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

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{jobName}"] = String(describing: self.jobName)
            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(RemoteLoginInformationListResultData?.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 (RemoteLoginInformationListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: RemoteLoginInformationListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.Jobs {
// Terminate terminates a job. This method may poll for completion. Polling can be canceled by passing the cancel
// channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
    internal class TerminateCommand : BaseCommand, JobsTerminate {
        public var resourceGroupName : String
        public var jobName : String
        public var subscriptionId : String
        public var apiVersion = "2017-09-01-preview"

        public init(resourceGroupName: String, jobName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.jobName = jobName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = true
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/jobs/{jobName}/terminate"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{jobName}"] = String(describing: self.jobName)
            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.executeAsyncLRO(command: self) {
                (error) in
                completionHandler(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.

// Operations is the the Azure BatchAI Management API.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Operations {
    public static func List() -> OperationsList {
        return ListCommand()
    }
}
}


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

extension Commands.Operations {
// List lists available operations for the Microsoft.BatchAI provider.
    internal class ListCommand : BaseCommand, OperationsList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var apiVersion = "2017-09-01-preview"

    public override init() {
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/providers/Microsoft.BatchAI/operations"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            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(OperationListResultData?.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 (OperationListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: OperationListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


// AllocationState enumerates the values for allocation state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum AllocationStateEnum: String, Codable
{
// Resizing specifies the resizing state for allocation state.
    case Resizing = "resizing"
// Steady specifies the steady state for allocation state.
    case Steady = "steady"
}


// 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 AutoScaleSettingsData : AutoScaleSettingsProtocol {
    public var minimumNodeCount: Int32
    public var maximumNodeCount: Int32
    public var initialNodeCount: Int32?

        enum CodingKeys: String, CodingKey {case minimumNodeCount = "minimumNodeCount"
        case maximumNodeCount = "maximumNodeCount"
        case initialNodeCount = "initialNodeCount"
        }

  public init(minimumNodeCount: Int32, maximumNodeCount: Int32)  {
    self.minimumNodeCount = minimumNodeCount
    self.maximumNodeCount = maximumNodeCount
  }

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

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

extension DataFactory {
  public static func createAutoScaleSettingsProtocol(minimumNodeCount: Int32, maximumNodeCount: Int32) -> AutoScaleSettingsProtocol {
    return AutoScaleSettingsData(minimumNodeCount: minimumNodeCount, maximumNodeCount: maximumNodeCount)
  }
}


// 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 AzureBlobFileSystemReferenceData : AzureBlobFileSystemReferenceProtocol {
    public var accountName: String
    public var containerName: String
    public var credentials: AzureStorageCredentialsInfoProtocol
    public var relativeMountPath: String
    public var mountOptions: String?

        enum CodingKeys: String, CodingKey {case accountName = "accountName"
        case containerName = "containerName"
        case credentials = "credentials"
        case relativeMountPath = "relativeMountPath"
        case mountOptions = "mountOptions"
        }

  public init(accountName: String, containerName: String, credentials: AzureStorageCredentialsInfoProtocol, relativeMountPath: String)  {
    self.accountName = accountName
    self.containerName = containerName
    self.credentials = credentials
    self.relativeMountPath = relativeMountPath
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.accountName, forKey: .accountName)
    try container.encode(self.containerName, forKey: .containerName)
    try container.encode(self.credentials as! AzureStorageCredentialsInfoData, forKey: .credentials)
    try container.encode(self.relativeMountPath, forKey: .relativeMountPath)
    if self.mountOptions != nil {try container.encode(self.mountOptions, forKey: .mountOptions)}
  }
}

extension DataFactory {
  public static func createAzureBlobFileSystemReferenceProtocol(accountName: String, containerName: String, credentials: AzureStorageCredentialsInfoProtocol, relativeMountPath: String) -> AzureBlobFileSystemReferenceProtocol {
    return AzureBlobFileSystemReferenceData(accountName: accountName, containerName: containerName, credentials: credentials, relativeMountPath: relativeMountPath)
  }
}


// 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 AzureFileShareReferenceData : AzureFileShareReferenceProtocol {
    public var accountName: String
    public var azureFileUrl: String
    public var credentials: AzureStorageCredentialsInfoProtocol
    public var relativeMountPath: String
    public var fileMode: String?
    public var directoryMode: String?

        enum CodingKeys: String, CodingKey {case accountName = "accountName"
        case azureFileUrl = "azureFileUrl"
        case credentials = "credentials"
        case relativeMountPath = "relativeMountPath"
        case fileMode = "fileMode"
        case directoryMode = "directoryMode"
        }

  public init(accountName: String, azureFileUrl: String, credentials: AzureStorageCredentialsInfoProtocol, relativeMountPath: String)  {
    self.accountName = accountName
    self.azureFileUrl = azureFileUrl
    self.credentials = credentials
    self.relativeMountPath = relativeMountPath
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.accountName, forKey: .accountName)
    try container.encode(self.azureFileUrl, forKey: .azureFileUrl)
    try container.encode(self.credentials as! AzureStorageCredentialsInfoData, forKey: .credentials)
    try container.encode(self.relativeMountPath, forKey: .relativeMountPath)
    if self.fileMode != nil {try container.encode(self.fileMode, forKey: .fileMode)}
    if self.directoryMode != nil {try container.encode(self.directoryMode, forKey: .directoryMode)}
  }
}

extension DataFactory {
  public static func createAzureFileShareReferenceProtocol(accountName: String, azureFileUrl: String, credentials: AzureStorageCredentialsInfoProtocol, relativeMountPath: String) -> AzureFileShareReferenceProtocol {
    return AzureFileShareReferenceData(accountName: accountName, azureFileUrl: azureFileUrl, credentials: credentials, relativeMountPath: relativeMountPath)
  }
}


// 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 AzureStorageCredentialsInfoData : AzureStorageCredentialsInfoProtocol {
    public var accountKey: String?
    public var accountKeySecretReference: KeyVaultSecretReferenceProtocol?

        enum CodingKeys: String, CodingKey {case accountKey = "accountKey"
        case accountKeySecretReference = "accountKeySecretReference"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createAzureStorageCredentialsInfoProtocol() -> AzureStorageCredentialsInfoProtocol {
    return AzureStorageCredentialsInfoData()
  }
}


// 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 BatchAIErrorData : BatchAIErrorProtocol {
    public var code: String?
    public var message: String?
    public var details: [NameValuePairProtocol?]?

        enum CodingKeys: String, CodingKey {case code = "code"
        case message = "message"
        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(.details) {
        self.details = try container.decode([NameValuePairData?]?.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.details != nil {try container.encode(self.details as! [NameValuePairData?]?, forKey: .details)}
  }
}

extension DataFactory {
  public static func createBatchAIErrorProtocol() -> BatchAIErrorProtocol {
    return BatchAIErrorData()
  }
}


// CachingType enumerates the values for caching 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 CachingTypeEnum: String, Codable
{
// None specifies the none state for caching type.
    case None = "none"
// Readonly specifies the readonly state for caching type.
    case Readonly = "readonly"
// Readwrite specifies the readwrite state for caching type.
    case Readwrite = "readwrite"
}


// 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 Caffe2SettingsData : Caffe2SettingsProtocol {
    public var pythonScriptFilePath: String
    public var pythonInterpreterPath: String?
    public var commandLineArgs: String?

        enum CodingKeys: String, CodingKey {case pythonScriptFilePath = "pythonScriptFilePath"
        case pythonInterpreterPath = "pythonInterpreterPath"
        case commandLineArgs = "commandLineArgs"
        }

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

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

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

extension DataFactory {
  public static func createCaffe2SettingsProtocol(pythonScriptFilePath: String) -> Caffe2SettingsProtocol {
    return Caffe2SettingsData(pythonScriptFilePath: pythonScriptFilePath)
  }
}


// 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 CaffeSettingsData : CaffeSettingsProtocol {
    public var configFilePath: String?
    public var pythonScriptFilePath: String?
    public var pythonInterpreterPath: String?
    public var commandLineArgs: String?
    public var processCount: Int32?

        enum CodingKeys: String, CodingKey {case configFilePath = "configFilePath"
        case pythonScriptFilePath = "pythonScriptFilePath"
        case pythonInterpreterPath = "pythonInterpreterPath"
        case commandLineArgs = "commandLineArgs"
        case processCount = "processCount"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createCaffeSettingsProtocol() -> CaffeSettingsProtocol {
    return CaffeSettingsData()
  }
}


// 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 ChainerSettingsData : ChainerSettingsProtocol {
    public var pythonScriptFilePath: String
    public var pythonInterpreterPath: String?
    public var commandLineArgs: String?
    public var processCount: Int32?

        enum CodingKeys: String, CodingKey {case pythonScriptFilePath = "pythonScriptFilePath"
        case pythonInterpreterPath = "pythonInterpreterPath"
        case commandLineArgs = "commandLineArgs"
        case processCount = "processCount"
        }

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

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

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

extension DataFactory {
  public static func createChainerSettingsProtocol(pythonScriptFilePath: String) -> ChainerSettingsProtocol {
    return ChainerSettingsData(pythonScriptFilePath: pythonScriptFilePath)
  }
}


// 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 ClusterBasePropertiesData : ClusterBasePropertiesProtocol {
    public var vmSize: String
    public var vmPriority: VmPriorityEnum?
    public var scaleSettings: ScaleSettingsProtocol?
    public var virtualMachineConfiguration: VirtualMachineConfigurationProtocol?
    public var nodeSetup: NodeSetupProtocol?
    public var userAccountSettings: UserAccountSettingsProtocol
    public var subnet: ResourceIdProtocol?

        enum CodingKeys: String, CodingKey {case vmSize = "vmSize"
        case vmPriority = "vmPriority"
        case scaleSettings = "scaleSettings"
        case virtualMachineConfiguration = "virtualMachineConfiguration"
        case nodeSetup = "nodeSetup"
        case userAccountSettings = "userAccountSettings"
        case subnet = "subnet"
        }

  public init(vmSize: String, userAccountSettings: UserAccountSettingsProtocol)  {
    self.vmSize = vmSize
    self.userAccountSettings = userAccountSettings
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.vmSize = try container.decode(String.self, forKey: .vmSize)
    if container.contains(.vmPriority) {
        self.vmPriority = try container.decode(VmPriorityEnum?.self, forKey: .vmPriority)
    }
    if container.contains(.scaleSettings) {
        self.scaleSettings = try container.decode(ScaleSettingsData?.self, forKey: .scaleSettings)
    }
    if container.contains(.virtualMachineConfiguration) {
        self.virtualMachineConfiguration = try container.decode(VirtualMachineConfigurationData?.self, forKey: .virtualMachineConfiguration)
    }
    if container.contains(.nodeSetup) {
        self.nodeSetup = try container.decode(NodeSetupData?.self, forKey: .nodeSetup)
    }
    self.userAccountSettings = try container.decode(UserAccountSettingsData.self, forKey: .userAccountSettings)
    if container.contains(.subnet) {
        self.subnet = try container.decode(ResourceIdData?.self, forKey: .subnet)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.vmSize, forKey: .vmSize)
    if self.vmPriority != nil {try container.encode(self.vmPriority, forKey: .vmPriority)}
    if self.scaleSettings != nil {try container.encode(self.scaleSettings as! ScaleSettingsData?, forKey: .scaleSettings)}
    if self.virtualMachineConfiguration != nil {try container.encode(self.virtualMachineConfiguration as! VirtualMachineConfigurationData?, forKey: .virtualMachineConfiguration)}
    if self.nodeSetup != nil {try container.encode(self.nodeSetup as! NodeSetupData?, forKey: .nodeSetup)}
    try container.encode(self.userAccountSettings as! UserAccountSettingsData, forKey: .userAccountSettings)
    if self.subnet != nil {try container.encode(self.subnet as! ResourceIdData?, forKey: .subnet)}
  }
}

extension DataFactory {
  public static func createClusterBasePropertiesProtocol(vmSize: String, userAccountSettings: UserAccountSettingsProtocol) -> ClusterBasePropertiesProtocol {
    return ClusterBasePropertiesData(vmSize: vmSize, userAccountSettings: userAccountSettings)
  }
}


// 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 ClusterCreateParametersData : ClusterCreateParametersProtocol {
    public var location: String
    public var tags: [String:String]?
    public var properties: ClusterBasePropertiesProtocol?

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

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

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

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

extension DataFactory {
  public static func createClusterCreateParametersProtocol(location: String) -> ClusterCreateParametersProtocol {
    return ClusterCreateParametersData(location: location)
  }
}


// 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 ClusterData : ClusterProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?
    public var properties: ClusterPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createClusterProtocol() -> ClusterProtocol {
    return ClusterData()
  }
}


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

extension DataFactory {
  public static func createClusterListResultProtocol() -> ClusterListResultProtocol {
    return ClusterListResultData()
  }
}


// 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 ClusterPropertiesData : ClusterPropertiesProtocol {
    public var vmSize: String?
    public var vmPriority: VmPriorityEnum?
    public var scaleSettings: ScaleSettingsProtocol?
    public var virtualMachineConfiguration: VirtualMachineConfigurationProtocol?
    public var nodeSetup: NodeSetupProtocol?
    public var userAccountSettings: UserAccountSettingsProtocol?
    public var subnet: ResourceIdProtocol?
    public var creationTime: Date?
    public var provisioningState: ProvisioningStateEnum?
    public var provisioningStateTransitionTime: Date?
    public var allocationState: AllocationStateEnum?
    public var allocationStateTransitionTime: Date?
    public var errors: [BatchAIErrorProtocol?]?
    public var currentNodeCount: Int32?
    public var nodeStateCounts: NodeStateCountsProtocol?

        enum CodingKeys: String, CodingKey {case vmSize = "vmSize"
        case vmPriority = "vmPriority"
        case scaleSettings = "scaleSettings"
        case virtualMachineConfiguration = "virtualMachineConfiguration"
        case nodeSetup = "nodeSetup"
        case userAccountSettings = "userAccountSettings"
        case subnet = "subnet"
        case creationTime = "creationTime"
        case provisioningState = "provisioningState"
        case provisioningStateTransitionTime = "provisioningStateTransitionTime"
        case allocationState = "allocationState"
        case allocationStateTransitionTime = "allocationStateTransitionTime"
        case errors = "errors"
        case currentNodeCount = "currentNodeCount"
        case nodeStateCounts = "nodeStateCounts"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.vmSize) {
        self.vmSize = try container.decode(String?.self, forKey: .vmSize)
    }
    if container.contains(.vmPriority) {
        self.vmPriority = try container.decode(VmPriorityEnum?.self, forKey: .vmPriority)
    }
    if container.contains(.scaleSettings) {
        self.scaleSettings = try container.decode(ScaleSettingsData?.self, forKey: .scaleSettings)
    }
    if container.contains(.virtualMachineConfiguration) {
        self.virtualMachineConfiguration = try container.decode(VirtualMachineConfigurationData?.self, forKey: .virtualMachineConfiguration)
    }
    if container.contains(.nodeSetup) {
        self.nodeSetup = try container.decode(NodeSetupData?.self, forKey: .nodeSetup)
    }
    if container.contains(.userAccountSettings) {
        self.userAccountSettings = try container.decode(UserAccountSettingsData?.self, forKey: .userAccountSettings)
    }
    if container.contains(.subnet) {
        self.subnet = try container.decode(ResourceIdData?.self, forKey: .subnet)
    }
    if container.contains(.creationTime) {
        self.creationTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .creationTime)), format: .dateTime)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(ProvisioningStateEnum?.self, forKey: .provisioningState)
    }
    if container.contains(.provisioningStateTransitionTime) {
        self.provisioningStateTransitionTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .provisioningStateTransitionTime)), format: .dateTime)
    }
    if container.contains(.allocationState) {
        self.allocationState = try container.decode(AllocationStateEnum?.self, forKey: .allocationState)
    }
    if container.contains(.allocationStateTransitionTime) {
        self.allocationStateTransitionTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .allocationStateTransitionTime)), format: .dateTime)
    }
    if container.contains(.errors) {
        self.errors = try container.decode([BatchAIErrorData?]?.self, forKey: .errors)
    }
    if container.contains(.currentNodeCount) {
        self.currentNodeCount = try container.decode(Int32?.self, forKey: .currentNodeCount)
    }
    if container.contains(.nodeStateCounts) {
        self.nodeStateCounts = try container.decode(NodeStateCountsData?.self, forKey: .nodeStateCounts)
    }
    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.vmSize != nil {try container.encode(self.vmSize, forKey: .vmSize)}
    if self.vmPriority != nil {try container.encode(self.vmPriority, forKey: .vmPriority)}
    if self.scaleSettings != nil {try container.encode(self.scaleSettings as! ScaleSettingsData?, forKey: .scaleSettings)}
    if self.virtualMachineConfiguration != nil {try container.encode(self.virtualMachineConfiguration as! VirtualMachineConfigurationData?, forKey: .virtualMachineConfiguration)}
    if self.nodeSetup != nil {try container.encode(self.nodeSetup as! NodeSetupData?, forKey: .nodeSetup)}
    if self.userAccountSettings != nil {try container.encode(self.userAccountSettings as! UserAccountSettingsData?, forKey: .userAccountSettings)}
    if self.subnet != nil {try container.encode(self.subnet as! ResourceIdData?, forKey: .subnet)}
    if self.creationTime != nil {
        try container.encode(DateConverter.toString(date: self.creationTime!, format: .dateTime), forKey: .creationTime)
    }
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.provisioningStateTransitionTime != nil {
        try container.encode(DateConverter.toString(date: self.provisioningStateTransitionTime!, format: .dateTime), forKey: .provisioningStateTransitionTime)
    }
    if self.allocationState != nil {try container.encode(self.allocationState, forKey: .allocationState)}
    if self.allocationStateTransitionTime != nil {
        try container.encode(DateConverter.toString(date: self.allocationStateTransitionTime!, format: .dateTime), forKey: .allocationStateTransitionTime)
    }
    if self.errors != nil {try container.encode(self.errors as! [BatchAIErrorData?]?, forKey: .errors)}
    if self.currentNodeCount != nil {try container.encode(self.currentNodeCount, forKey: .currentNodeCount)}
    if self.nodeStateCounts != nil {try container.encode(self.nodeStateCounts as! NodeStateCountsData?, forKey: .nodeStateCounts)}
  }
}

extension DataFactory {
  public static func createClusterPropertiesProtocol() -> ClusterPropertiesProtocol {
    return ClusterPropertiesData()
  }
}


// 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 ClusterUpdateParametersData : ClusterUpdateParametersProtocol {
    public var tags: [String:String]?
    public var properties: ClusterUpdatePropertiesProtocol?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createClusterUpdateParametersProtocol() -> ClusterUpdateParametersProtocol {
    return ClusterUpdateParametersData()
  }
}


// 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 ClusterUpdatePropertiesData : ClusterUpdatePropertiesProtocol {
    public var scaleSettings: ScaleSettingsProtocol?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createClusterUpdatePropertiesProtocol() -> ClusterUpdatePropertiesProtocol {
    return ClusterUpdatePropertiesData()
  }
}


// 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 CNTKsettingsData : CNTKsettingsProtocol {
    public var languageType: String?
    public var configFilePath: String?
    public var pythonScriptFilePath: String?
    public var pythonInterpreterPath: String?
    public var commandLineArgs: String?
    public var processCount: Int32?

        enum CodingKeys: String, CodingKey {case languageType = "languageType"
        case configFilePath = "configFilePath"
        case pythonScriptFilePath = "pythonScriptFilePath"
        case pythonInterpreterPath = "pythonInterpreterPath"
        case commandLineArgs = "commandLineArgs"
        case processCount = "processCount"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createCNTKsettingsProtocol() -> CNTKsettingsProtocol {
    return CNTKsettingsData()
  }
}


// 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 ContainerSettingsData : ContainerSettingsProtocol {
    public var imageSourceRegistry: ImageSourceRegistryProtocol

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

  public init(imageSourceRegistry: ImageSourceRegistryProtocol)  {
    self.imageSourceRegistry = imageSourceRegistry
  }

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

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

extension DataFactory {
  public static func createContainerSettingsProtocol(imageSourceRegistry: ImageSourceRegistryProtocol) -> ContainerSettingsProtocol {
    return ContainerSettingsData(imageSourceRegistry: imageSourceRegistry)
  }
}


// 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 CustomToolkitSettingsData : CustomToolkitSettingsProtocol {
    public var commandLine: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createCustomToolkitSettingsProtocol() -> CustomToolkitSettingsProtocol {
    return CustomToolkitSettingsData()
  }
}


// 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 DataDisksData : DataDisksProtocol {
    public var diskSizeInGB: Int32
    public var cachingType: CachingTypeEnum?
    public var diskCount: Int32
    public var storageAccountType: StorageAccountTypeEnum

        enum CodingKeys: String, CodingKey {case diskSizeInGB = "diskSizeInGB"
        case cachingType = "cachingType"
        case diskCount = "diskCount"
        case storageAccountType = "storageAccountType"
        }

  public init(diskSizeInGB: Int32, diskCount: Int32, storageAccountType: StorageAccountTypeEnum)  {
    self.diskSizeInGB = diskSizeInGB
    self.diskCount = diskCount
    self.storageAccountType = storageAccountType
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.diskSizeInGB = try container.decode(Int32.self, forKey: .diskSizeInGB)
    if container.contains(.cachingType) {
        self.cachingType = try container.decode(CachingTypeEnum?.self, forKey: .cachingType)
    }
    self.diskCount = try container.decode(Int32.self, forKey: .diskCount)
    self.storageAccountType = try container.decode(StorageAccountTypeEnum.self, forKey: .storageAccountType)
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

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

extension DataFactory {
  public static func createDataDisksProtocol(diskSizeInGB: Int32, diskCount: Int32, storageAccountType: StorageAccountTypeEnum) -> DataDisksProtocol {
    return DataDisksData(diskSizeInGB: diskSizeInGB, diskCount: diskCount, storageAccountType: storageAccountType)
  }
}


// DeallocationOption enumerates the values for deallocation option.

// 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 DeallocationOptionEnum: String, Codable
{
// Requeue specifies the requeue state for deallocation option.
    case Requeue = "requeue"
// Terminate specifies the terminate state for deallocation option.
    case Terminate = "terminate"
// Unknown specifies the unknown state for deallocation option.
    case Unknown = "unknown"
// Waitforjobcompletion specifies the waitforjobcompletion state for deallocation option.
    case Waitforjobcompletion = "waitforjobcompletion"
}


// 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 EnvironmentSettingData : EnvironmentSettingProtocol {
    public var name: String
    public var value: String?

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

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

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

extension DataFactory {
  public static func createEnvironmentSettingProtocol(name: String) -> EnvironmentSettingProtocol {
    return EnvironmentSettingData(name: name)
  }
}


// ExecutionState enumerates the values for execution state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum ExecutionStateEnum: String, Codable
{
// Failed specifies the failed state for execution state.
    case Failed = "failed"
// Queued specifies the queued state for execution state.
    case Queued = "queued"
// Running specifies the running state for execution state.
    case Running = "running"
// Succeeded specifies the succeeded state for execution state.
    case Succeeded = "succeeded"
// Terminating specifies the terminating state for execution state.
    case Terminating = "terminating"
}


// 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 FileData : FileProtocol {
    public var name: String
    public var downloadUrl: String
    public var properties: FilePropertiesProtocol?

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

  public init(name: String, downloadUrl: String)  {
    self.name = name
    self.downloadUrl = downloadUrl
  }

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

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

extension DataFactory {
  public static func createFileProtocol(name: String, downloadUrl: String) -> FileProtocol {
    return FileData(name: name, downloadUrl: downloadUrl)
  }
}


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

extension DataFactory {
  public static func createFileListResultProtocol() -> FileListResultProtocol {
    return FileListResultData()
  }
}


// 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 FilePropertiesData : FilePropertiesProtocol {
    public var lastModified: Date?
    public var contentLength: Int64?

        enum CodingKeys: String, CodingKey {case lastModified = "lastModified"
        case contentLength = "contentLength"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.lastModified) {
        self.lastModified = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastModified)), format: .dateTime)
    }
    if container.contains(.contentLength) {
        self.contentLength = try container.decode(Int64?.self, forKey: .contentLength)
    }
    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.lastModified != nil {
        try container.encode(DateConverter.toString(date: self.lastModified!, format: .dateTime), forKey: .lastModified)
    }
    if self.contentLength != nil {try container.encode(self.contentLength, forKey: .contentLength)}
  }
}

extension DataFactory {
  public static func createFilePropertiesProtocol() -> FilePropertiesProtocol {
    return FilePropertiesData()
  }
}


// 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 FileServerBasePropertiesData : FileServerBasePropertiesProtocol {
    public var vmSize: String
    public var sshConfiguration: SshConfigurationProtocol
    public var dataDisks: DataDisksProtocol
    public var subnet: ResourceIdProtocol?

        enum CodingKeys: String, CodingKey {case vmSize = "vmSize"
        case sshConfiguration = "sshConfiguration"
        case dataDisks = "dataDisks"
        case subnet = "subnet"
        }

  public init(vmSize: String, sshConfiguration: SshConfigurationProtocol, dataDisks: DataDisksProtocol)  {
    self.vmSize = vmSize
    self.sshConfiguration = sshConfiguration
    self.dataDisks = dataDisks
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.vmSize, forKey: .vmSize)
    try container.encode(self.sshConfiguration as! SshConfigurationData, forKey: .sshConfiguration)
    try container.encode(self.dataDisks as! DataDisksData, forKey: .dataDisks)
    if self.subnet != nil {try container.encode(self.subnet as! ResourceIdData?, forKey: .subnet)}
  }
}

extension DataFactory {
  public static func createFileServerBasePropertiesProtocol(vmSize: String, sshConfiguration: SshConfigurationProtocol, dataDisks: DataDisksProtocol) -> FileServerBasePropertiesProtocol {
    return FileServerBasePropertiesData(vmSize: vmSize, sshConfiguration: sshConfiguration, dataDisks: dataDisks)
  }
}


// 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 FileServerCreateParametersData : FileServerCreateParametersProtocol {
    public var location: String
    public var tags: [String:String]?
    public var properties: FileServerBasePropertiesProtocol?

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

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

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

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

extension DataFactory {
  public static func createFileServerCreateParametersProtocol(location: String) -> FileServerCreateParametersProtocol {
    return FileServerCreateParametersData(location: location)
  }
}


// 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 FileServerData : FileServerProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?
    public var properties: FileServerPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createFileServerProtocol() -> FileServerProtocol {
    return FileServerData()
  }
}


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

extension DataFactory {
  public static func createFileServerListResultProtocol() -> FileServerListResultProtocol {
    return FileServerListResultData()
  }
}


// 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 FileServerPropertiesData : FileServerPropertiesProtocol {
    public var vmSize: String?
    public var sshConfiguration: SshConfigurationProtocol?
    public var dataDisks: DataDisksProtocol?
    public var subnet: ResourceIdProtocol?
    public var mountSettings: MountSettingsProtocol?
    public var provisioningStateTransitionTime: Date?
    public var creationTime: Date?
    public var provisioningState: FileServerProvisioningStateEnum?

        enum CodingKeys: String, CodingKey {case vmSize = "vmSize"
        case sshConfiguration = "sshConfiguration"
        case dataDisks = "dataDisks"
        case subnet = "subnet"
        case mountSettings = "mountSettings"
        case provisioningStateTransitionTime = "provisioningStateTransitionTime"
        case creationTime = "creationTime"
        case provisioningState = "provisioningState"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.vmSize) {
        self.vmSize = try container.decode(String?.self, forKey: .vmSize)
    }
    if container.contains(.sshConfiguration) {
        self.sshConfiguration = try container.decode(SshConfigurationData?.self, forKey: .sshConfiguration)
    }
    if container.contains(.dataDisks) {
        self.dataDisks = try container.decode(DataDisksData?.self, forKey: .dataDisks)
    }
    if container.contains(.subnet) {
        self.subnet = try container.decode(ResourceIdData?.self, forKey: .subnet)
    }
    if container.contains(.mountSettings) {
        self.mountSettings = try container.decode(MountSettingsData?.self, forKey: .mountSettings)
    }
    if container.contains(.provisioningStateTransitionTime) {
        self.provisioningStateTransitionTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .provisioningStateTransitionTime)), format: .dateTime)
    }
    if container.contains(.creationTime) {
        self.creationTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .creationTime)), format: .dateTime)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(FileServerProvisioningStateEnum?.self, forKey: .provisioningState)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.vmSize != nil {try container.encode(self.vmSize, forKey: .vmSize)}
    if self.sshConfiguration != nil {try container.encode(self.sshConfiguration as! SshConfigurationData?, forKey: .sshConfiguration)}
    if self.dataDisks != nil {try container.encode(self.dataDisks as! DataDisksData?, forKey: .dataDisks)}
    if self.subnet != nil {try container.encode(self.subnet as! ResourceIdData?, forKey: .subnet)}
    if self.mountSettings != nil {try container.encode(self.mountSettings as! MountSettingsData?, forKey: .mountSettings)}
    if self.provisioningStateTransitionTime != nil {
        try container.encode(DateConverter.toString(date: self.provisioningStateTransitionTime!, format: .dateTime), forKey: .provisioningStateTransitionTime)
    }
    if self.creationTime != nil {
        try container.encode(DateConverter.toString(date: self.creationTime!, format: .dateTime), forKey: .creationTime)
    }
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
  }
}

extension DataFactory {
  public static func createFileServerPropertiesProtocol() -> FileServerPropertiesProtocol {
    return FileServerPropertiesData()
  }
}


// FileServerProvisioningState enumerates the values for file server provisioning state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum FileServerProvisioningStateEnum: String, Codable
{
// FileServerProvisioningStateCreating specifies the file server provisioning state creating state for file server
// provisioning state.
    case FileServerProvisioningStateCreating = "creating"
// FileServerProvisioningStateDeleting specifies the file server provisioning state deleting state for file server
// provisioning state.
    case FileServerProvisioningStateDeleting = "deleting"
// FileServerProvisioningStateFailed specifies the file server provisioning state failed state for file server
// provisioning state.
    case FileServerProvisioningStateFailed = "failed"
// FileServerProvisioningStateSucceeded specifies the file server provisioning state succeeded state for file server
// provisioning state.
    case FileServerProvisioningStateSucceeded = "succeeded"
// FileServerProvisioningStateUpdating specifies the file server provisioning state updating state for file server
// provisioning state.
    case FileServerProvisioningStateUpdating = "updating"
}


// 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 FileServerReferenceData : FileServerReferenceProtocol {
    public var fileServer: ResourceIdProtocol
    public var sourceDirectory: String?
    public var relativeMountPath: String
    public var mountOptions: String?

        enum CodingKeys: String, CodingKey {case fileServer = "fileServer"
        case sourceDirectory = "sourceDirectory"
        case relativeMountPath = "relativeMountPath"
        case mountOptions = "mountOptions"
        }

  public init(fileServer: ResourceIdProtocol, relativeMountPath: String)  {
    self.fileServer = fileServer
    self.relativeMountPath = relativeMountPath
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.fileServer as! ResourceIdData, forKey: .fileServer)
    if self.sourceDirectory != nil {try container.encode(self.sourceDirectory, forKey: .sourceDirectory)}
    try container.encode(self.relativeMountPath, forKey: .relativeMountPath)
    if self.mountOptions != nil {try container.encode(self.mountOptions, forKey: .mountOptions)}
  }
}

extension DataFactory {
  public static func createFileServerReferenceProtocol(fileServer: ResourceIdProtocol, relativeMountPath: String) -> FileServerReferenceProtocol {
    return FileServerReferenceData(fileServer: fileServer, relativeMountPath: relativeMountPath)
  }
}


// FileServerType enumerates the values for file server 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 FileServerTypeEnum: String, Codable
{
// Glusterfs specifies the glusterfs state for file server type.
    case Glusterfs = "glusterfs"
// Nfs specifies the nfs state for file server type.
    case Nfs = "nfs"
}


// 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 ImageReferenceData : ImageReferenceProtocol {
    public var publisher: String
    public var offer: String
    public var sku: String
    public var version: String?

        enum CodingKeys: String, CodingKey {case publisher = "publisher"
        case offer = "offer"
        case sku = "sku"
        case version = "version"
        }

  public init(publisher: String, offer: String, sku: String)  {
    self.publisher = publisher
    self.offer = offer
    self.sku = sku
  }

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

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

extension DataFactory {
  public static func createImageReferenceProtocol(publisher: String, offer: String, sku: String) -> ImageReferenceProtocol {
    return ImageReferenceData(publisher: publisher, offer: offer, sku: sku)
  }
}


// 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 ImageSourceRegistryData : ImageSourceRegistryProtocol {
    public var serverUrl: String?
    public var image: String
    public var credentials: PrivateRegistryCredentialsProtocol?

        enum CodingKeys: String, CodingKey {case serverUrl = "serverUrl"
        case image = "image"
        case credentials = "credentials"
        }

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

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

extension DataFactory {
  public static func createImageSourceRegistryProtocol(image: String) -> ImageSourceRegistryProtocol {
    return ImageSourceRegistryData(image: image)
  }
}


// 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 InputDirectoryData : InputDirectoryProtocol {
    public var id: String
    public var path: String

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

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

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

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

extension DataFactory {
  public static func createInputDirectoryProtocol(id: String, path: String) -> InputDirectoryProtocol {
    return InputDirectoryData(id: id, path: path)
  }
}


// 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 JobBasePropertiesConstraintsData : JobBasePropertiesConstraintsProtocol {
    public var maxWallClockTime: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createJobBasePropertiesConstraintsProtocol() -> JobBasePropertiesConstraintsProtocol {
    return JobBasePropertiesConstraintsData()
  }
}