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

// VirtualNetworks is the the DevTest Labs Client.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct VirtualNetworks {
    public static func CreateOrUpdate(subscriptionId: String, resourceGroupName: String, labName: String, name: String, virtualNetwork: VirtualNetworkProtocol) -> VirtualNetworksCreateOrUpdate {
        return CreateOrUpdateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, labName: labName, name: name, virtualNetwork: virtualNetwork)
    }
    public static func Delete(subscriptionId: String, resourceGroupName: String, labName: String, name: String) -> VirtualNetworksDelete {
        return DeleteCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, labName: labName, name: name)
    }
    public static func Get(subscriptionId: String, resourceGroupName: String, labName: String, name: String) -> VirtualNetworksGet {
        return GetCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, labName: labName, name: name)
    }
    public static func List(subscriptionId: String, resourceGroupName: String, labName: String) -> VirtualNetworksList {
        return ListCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, labName: labName)
    }
    public static func Update(subscriptionId: String, resourceGroupName: String, labName: String, name: String, virtualNetwork: VirtualNetworkFragmentProtocol) -> VirtualNetworksUpdate {
        return UpdateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, labName: labName, name: name, virtualNetwork: virtualNetwork)
    }
}
}


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

extension Commands.VirtualNetworks {
// CreateOrUpdate create or replace an existing virtual network. This operation can take a while to complete. 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 CreateOrUpdateCommand : BaseCommand, VirtualNetworksCreateOrUpdate {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var labName : String
        public var name : String
        public var apiVersion = "2016-05-15"
    public var virtualNetwork :  VirtualNetworkProtocol?

        public init(subscriptionId: String, resourceGroupName: String, labName: String, name: String, virtualNetwork: VirtualNetworkProtocol) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.labName = labName
            self.name = name
            self.virtualNetwork = virtualNetwork
            super.init()
            self.method = "Put"
            self.isLongRunningOperation = true
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{name}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

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

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


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

extension Commands.VirtualNetworks {
// Delete delete virtual network. This operation can take a while to complete. 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 DeleteCommand : BaseCommand, VirtualNetworksDelete {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var labName : String
        public var name : String
        public var apiVersion = "2016-05-15"

        public init(subscriptionId: String, resourceGroupName: String, labName: String, name: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.labName = labName
            self.name = name
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = true
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{name}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{labName}"] = String(describing: self.labName)
            self.pathParameters["{name}"] = String(describing: self.name)
            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)
            }
        }
    }
}


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

extension Commands.VirtualNetworks {
// Get get virtual network.
    internal class GetCommand : BaseCommand, VirtualNetworksGet {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var labName : String
        public var name : String
        public var expand : String?
        public var apiVersion = "2016-05-15"

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

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

        }

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


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

extension Commands.VirtualNetworks {
// List list virtual networks in a given lab.
    internal class ListCommand : BaseCommand, VirtualNetworksList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var labName : String
        public var expand : String?
        public var filter : String?
        public var top : Int32?
        public var orderby : String?
        public var apiVersion = "2016-05-15"

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

        public override func preCall()  {
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{labName}"] = String(describing: self.labName)
            if self.expand != nil { queryParameters["$expand"] = String(describing: self.expand!) }
            if self.filter != nil { queryParameters["$filter"] = String(describing: self.filter!) }
            if self.top != nil { queryParameters["$top"] = String(describing: self.top!) }
            if self.orderby != nil { queryParameters["$orderby"] = String(describing: self.orderby!) }
            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(ResponseWithContinuationVirtualNetworkData?.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 (ResponseWithContinuationVirtualNetworkProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: ResponseWithContinuationVirtualNetworkData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.VirtualNetworks {
// Update modify properties of virtual networks.
    internal class UpdateCommand : BaseCommand, VirtualNetworksUpdate {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var labName : String
        public var name : String
        public var apiVersion = "2016-05-15"
    public var virtualNetwork :  VirtualNetworkFragmentProtocol?

        public init(subscriptionId: String, resourceGroupName: String, labName: String, name: String, virtualNetwork: VirtualNetworkFragmentProtocol) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.labName = labName
            self.name = name
            self.virtualNetwork = virtualNetwork
            super.init()
            self.method = "Patch"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{name}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

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

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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct ApplicableScheduleData : ApplicableScheduleProtocol, 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: ApplicableSchedulePropertiesProtocol

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

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

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

extension DataFactory {
  public static func createApplicableScheduleProtocol(properties: ApplicableSchedulePropertiesProtocol) -> ApplicableScheduleProtocol {
    return ApplicableScheduleData(properties: properties)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct ApplicableScheduleFragmentData : ApplicableScheduleFragmentProtocol, 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: ApplicableSchedulePropertiesFragmentProtocol?

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

extension DataFactory {
  public static func createApplicableScheduleFragmentProtocol() -> ApplicableScheduleFragmentProtocol {
    return ApplicableScheduleFragmentData()
  }
}


// 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 ApplicableSchedulePropertiesData : ApplicableSchedulePropertiesProtocol {
    public var labVmsShutdown: ScheduleProtocol?
    public var labVmsStartup: ScheduleProtocol?

        enum CodingKeys: String, CodingKey {case labVmsShutdown = "labVmsShutdown"
        case labVmsStartup = "labVmsStartup"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createApplicableSchedulePropertiesProtocol() -> ApplicableSchedulePropertiesProtocol {
    return ApplicableSchedulePropertiesData()
  }
}


// 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 ApplicableSchedulePropertiesFragmentData : ApplicableSchedulePropertiesFragmentProtocol {
    public var labVmsShutdown: ScheduleFragmentProtocol?
    public var labVmsStartup: ScheduleFragmentProtocol?

        enum CodingKeys: String, CodingKey {case labVmsShutdown = "labVmsShutdown"
        case labVmsStartup = "labVmsStartup"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createApplicableSchedulePropertiesFragmentProtocol() -> ApplicableSchedulePropertiesFragmentProtocol {
    return ApplicableSchedulePropertiesFragmentData()
  }
}


// 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 ApplyArtifactsRequestData : ApplyArtifactsRequestProtocol {
    public var artifacts: [ArtifactInstallPropertiesProtocol?]?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createApplyArtifactsRequestProtocol() -> ApplyArtifactsRequestProtocol {
    return ApplyArtifactsRequestData()
  }
}


// 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 ArmTemplateData : ArmTemplateProtocol, 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: ArmTemplatePropertiesProtocol

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

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

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

extension DataFactory {
  public static func createArmTemplateProtocol(properties: ArmTemplatePropertiesProtocol) -> ArmTemplateProtocol {
    return ArmTemplateData(properties: properties)
  }
}


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

        enum CodingKeys: String, CodingKey {case template = "template"
        case parameters = "parameters"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createArmTemplateInfoProtocol() -> ArmTemplateInfoProtocol {
    return ArmTemplateInfoData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createArmTemplateParameterPropertiesProtocol() -> ArmTemplateParameterPropertiesProtocol {
    return ArmTemplateParameterPropertiesData()
  }
}


// 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 ArmTemplatePropertiesData : ArmTemplatePropertiesProtocol {
    public var displayName: String?
    public var description: String?
    public var publisher: String?
    public var icon: String?
    public var contents: [String: String?]?
    public var createdDate: Date?
    public var parametersValueFilesInfo: [ParametersValueFileInfoProtocol?]?

        enum CodingKeys: String, CodingKey {case displayName = "displayName"
        case description = "description"
        case publisher = "publisher"
        case icon = "icon"
        case contents = "contents"
        case createdDate = "createdDate"
        case parametersValueFilesInfo = "parametersValueFilesInfo"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.displayName) {
        self.displayName = try container.decode(String?.self, forKey: .displayName)
    }
    if container.contains(.description) {
        self.description = try container.decode(String?.self, forKey: .description)
    }
    if container.contains(.publisher) {
        self.publisher = try container.decode(String?.self, forKey: .publisher)
    }
    if container.contains(.icon) {
        self.icon = try container.decode(String?.self, forKey: .icon)
    }
    if container.contains(.contents) {
        self.contents = try container.decode([String: String?]?.self, forKey: .contents)
    }
    if container.contains(.createdDate) {
        self.createdDate = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .createdDate)), format: .dateTime)
    }
    if container.contains(.parametersValueFilesInfo) {
        self.parametersValueFilesInfo = try container.decode([ParametersValueFileInfoData?]?.self, forKey: .parametersValueFilesInfo)
    }
    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.displayName != nil {try container.encode(self.displayName, forKey: .displayName)}
    if self.description != nil {try container.encode(self.description, forKey: .description)}
    if self.publisher != nil {try container.encode(self.publisher, forKey: .publisher)}
    if self.icon != nil {try container.encode(self.icon, forKey: .icon)}
    if self.contents != nil {try container.encode(self.contents, forKey: .contents)}
    if self.createdDate != nil {
        try container.encode(DateConverter.toString(date: self.createdDate!, format: .dateTime), forKey: .createdDate)
    }
    if self.parametersValueFilesInfo != nil {try container.encode(self.parametersValueFilesInfo as! [ParametersValueFileInfoData?]?, forKey: .parametersValueFilesInfo)}
  }
}

extension DataFactory {
  public static func createArmTemplatePropertiesProtocol() -> ArmTemplatePropertiesProtocol {
    return ArmTemplatePropertiesData()
  }
}


// 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 ArtifactData : ArtifactProtocol, 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: ArtifactPropertiesProtocol

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

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

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

extension DataFactory {
  public static func createArtifactProtocol(properties: ArtifactPropertiesProtocol) -> ArtifactProtocol {
    return ArtifactData(properties: properties)
  }
}


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

        enum CodingKeys: String, CodingKey {case deploymentStatus = "deploymentStatus"
        case artifactsApplied = "artifactsApplied"
        case totalArtifacts = "totalArtifacts"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createArtifactDeploymentStatusPropertiesProtocol() -> ArtifactDeploymentStatusPropertiesProtocol {
    return ArtifactDeploymentStatusPropertiesData()
  }
}


// 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 ArtifactDeploymentStatusPropertiesFragmentData : ArtifactDeploymentStatusPropertiesFragmentProtocol {
    public var deploymentStatus: String?
    public var artifactsApplied: Int32?
    public var totalArtifacts: Int32?

        enum CodingKeys: String, CodingKey {case deploymentStatus = "deploymentStatus"
        case artifactsApplied = "artifactsApplied"
        case totalArtifacts = "totalArtifacts"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createArtifactDeploymentStatusPropertiesFragmentProtocol() -> ArtifactDeploymentStatusPropertiesFragmentProtocol {
    return ArtifactDeploymentStatusPropertiesFragmentData()
  }
}


// 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 ArtifactInstallPropertiesData : ArtifactInstallPropertiesProtocol {
    public var artifactId: String?
    public var parameters: [ArtifactParameterPropertiesProtocol?]?
    public var status: String?
    public var deploymentStatusMessage: String?
    public var vmExtensionStatusMessage: String?
    public var installTime: Date?

        enum CodingKeys: String, CodingKey {case artifactId = "artifactId"
        case parameters = "parameters"
        case status = "status"
        case deploymentStatusMessage = "deploymentStatusMessage"
        case vmExtensionStatusMessage = "vmExtensionStatusMessage"
        case installTime = "installTime"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.artifactId) {
        self.artifactId = try container.decode(String?.self, forKey: .artifactId)
    }
    if container.contains(.parameters) {
        self.parameters = try container.decode([ArtifactParameterPropertiesData?]?.self, forKey: .parameters)
    }
    if container.contains(.status) {
        self.status = try container.decode(String?.self, forKey: .status)
    }
    if container.contains(.deploymentStatusMessage) {
        self.deploymentStatusMessage = try container.decode(String?.self, forKey: .deploymentStatusMessage)
    }
    if container.contains(.vmExtensionStatusMessage) {
        self.vmExtensionStatusMessage = try container.decode(String?.self, forKey: .vmExtensionStatusMessage)
    }
    if container.contains(.installTime) {
        self.installTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .installTime)), format: .dateTime)
    }
    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.artifactId != nil {try container.encode(self.artifactId, forKey: .artifactId)}
    if self.parameters != nil {try container.encode(self.parameters as! [ArtifactParameterPropertiesData?]?, forKey: .parameters)}
    if self.status != nil {try container.encode(self.status, forKey: .status)}
    if self.deploymentStatusMessage != nil {try container.encode(self.deploymentStatusMessage, forKey: .deploymentStatusMessage)}
    if self.vmExtensionStatusMessage != nil {try container.encode(self.vmExtensionStatusMessage, forKey: .vmExtensionStatusMessage)}
    if self.installTime != nil {
        try container.encode(DateConverter.toString(date: self.installTime!, format: .dateTime), forKey: .installTime)
    }
  }
}

extension DataFactory {
  public static func createArtifactInstallPropertiesProtocol() -> ArtifactInstallPropertiesProtocol {
    return ArtifactInstallPropertiesData()
  }
}


// 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 ArtifactInstallPropertiesFragmentData : ArtifactInstallPropertiesFragmentProtocol {
    public var artifactId: String?
    public var parameters: [ArtifactParameterPropertiesFragmentProtocol?]?
    public var status: String?
    public var deploymentStatusMessage: String?
    public var vmExtensionStatusMessage: String?
    public var installTime: Date?

        enum CodingKeys: String, CodingKey {case artifactId = "artifactId"
        case parameters = "parameters"
        case status = "status"
        case deploymentStatusMessage = "deploymentStatusMessage"
        case vmExtensionStatusMessage = "vmExtensionStatusMessage"
        case installTime = "installTime"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.artifactId) {
        self.artifactId = try container.decode(String?.self, forKey: .artifactId)
    }
    if container.contains(.parameters) {
        self.parameters = try container.decode([ArtifactParameterPropertiesFragmentData?]?.self, forKey: .parameters)
    }
    if container.contains(.status) {
        self.status = try container.decode(String?.self, forKey: .status)
    }
    if container.contains(.deploymentStatusMessage) {
        self.deploymentStatusMessage = try container.decode(String?.self, forKey: .deploymentStatusMessage)
    }
    if container.contains(.vmExtensionStatusMessage) {
        self.vmExtensionStatusMessage = try container.decode(String?.self, forKey: .vmExtensionStatusMessage)
    }
    if container.contains(.installTime) {
        self.installTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .installTime)), format: .dateTime)
    }
    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.artifactId != nil {try container.encode(self.artifactId, forKey: .artifactId)}
    if self.parameters != nil {try container.encode(self.parameters as! [ArtifactParameterPropertiesFragmentData?]?, forKey: .parameters)}
    if self.status != nil {try container.encode(self.status, forKey: .status)}
    if self.deploymentStatusMessage != nil {try container.encode(self.deploymentStatusMessage, forKey: .deploymentStatusMessage)}
    if self.vmExtensionStatusMessage != nil {try container.encode(self.vmExtensionStatusMessage, forKey: .vmExtensionStatusMessage)}
    if self.installTime != nil {
        try container.encode(DateConverter.toString(date: self.installTime!, format: .dateTime), forKey: .installTime)
    }
  }
}

extension DataFactory {
  public static func createArtifactInstallPropertiesFragmentProtocol() -> ArtifactInstallPropertiesFragmentProtocol {
    return ArtifactInstallPropertiesFragmentData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createArtifactParameterPropertiesProtocol() -> ArtifactParameterPropertiesProtocol {
    return ArtifactParameterPropertiesData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createArtifactParameterPropertiesFragmentProtocol() -> ArtifactParameterPropertiesFragmentProtocol {
    return ArtifactParameterPropertiesFragmentData()
  }
}


// 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 ArtifactPropertiesData : ArtifactPropertiesProtocol {
    public var title: String?
    public var description: String?
    public var publisher: String?
    public var filePath: String?
    public var icon: String?
    public var targetOsType: String?
    public var parameters: [String: String?]?
    public var createdDate: Date?

        enum CodingKeys: String, CodingKey {case title = "title"
        case description = "description"
        case publisher = "publisher"
        case filePath = "filePath"
        case icon = "icon"
        case targetOsType = "targetOsType"
        case parameters = "parameters"
        case createdDate = "createdDate"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.title) {
        self.title = try container.decode(String?.self, forKey: .title)
    }
    if container.contains(.description) {
        self.description = try container.decode(String?.self, forKey: .description)
    }
    if container.contains(.publisher) {
        self.publisher = try container.decode(String?.self, forKey: .publisher)
    }
    if container.contains(.filePath) {
        self.filePath = try container.decode(String?.self, forKey: .filePath)
    }
    if container.contains(.icon) {
        self.icon = try container.decode(String?.self, forKey: .icon)
    }
    if container.contains(.targetOsType) {
        self.targetOsType = try container.decode(String?.self, forKey: .targetOsType)
    }
    if container.contains(.parameters) {
        self.parameters = try container.decode([String: String?]?.self, forKey: .parameters)
    }
    if container.contains(.createdDate) {
        self.createdDate = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .createdDate)), format: .dateTime)
    }
    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.title != nil {try container.encode(self.title, forKey: .title)}
    if self.description != nil {try container.encode(self.description, forKey: .description)}
    if self.publisher != nil {try container.encode(self.publisher, forKey: .publisher)}
    if self.filePath != nil {try container.encode(self.filePath, forKey: .filePath)}
    if self.icon != nil {try container.encode(self.icon, forKey: .icon)}
    if self.targetOsType != nil {try container.encode(self.targetOsType, forKey: .targetOsType)}
    if self.parameters != nil {try container.encode(self.parameters, forKey: .parameters)}
    if self.createdDate != nil {
        try container.encode(DateConverter.toString(date: self.createdDate!, format: .dateTime), forKey: .createdDate)
    }
  }
}

extension DataFactory {
  public static func createArtifactPropertiesProtocol() -> ArtifactPropertiesProtocol {
    return ArtifactPropertiesData()
  }
}


// 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 ArtifactSourceData : ArtifactSourceProtocol, 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: ArtifactSourcePropertiesProtocol

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

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

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

extension DataFactory {
  public static func createArtifactSourceProtocol(properties: ArtifactSourcePropertiesProtocol) -> ArtifactSourceProtocol {
    return ArtifactSourceData(properties: properties)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct ArtifactSourceFragmentData : ArtifactSourceFragmentProtocol, 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: ArtifactSourcePropertiesFragmentProtocol?

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

extension DataFactory {
  public static func createArtifactSourceFragmentProtocol() -> ArtifactSourceFragmentProtocol {
    return ArtifactSourceFragmentData()
  }
}


// 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 ArtifactSourcePropertiesData : ArtifactSourcePropertiesProtocol {
    public var displayName: String?
    public var uri: String?
    public var sourceType: SourceControlTypeEnum?
    public var folderPath: String?
    public var armTemplateFolderPath: String?
    public var branchRef: String?
    public var securityToken: String?
    public var status: EnableStatusEnum?
    public var createdDate: Date?
    public var provisioningState: String?
    public var uniqueIdentifier: String?

        enum CodingKeys: String, CodingKey {case displayName = "displayName"
        case uri = "uri"
        case sourceType = "sourceType"
        case folderPath = "folderPath"
        case armTemplateFolderPath = "armTemplateFolderPath"
        case branchRef = "branchRef"
        case securityToken = "securityToken"
        case status = "status"
        case createdDate = "createdDate"
        case provisioningState = "provisioningState"
        case uniqueIdentifier = "uniqueIdentifier"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.displayName) {
        self.displayName = try container.decode(String?.self, forKey: .displayName)
    }
    if container.contains(.uri) {
        self.uri = try container.decode(String?.self, forKey: .uri)
    }
    if container.contains(.sourceType) {
        self.sourceType = try container.decode(SourceControlTypeEnum?.self, forKey: .sourceType)
    }
    if container.contains(.folderPath) {
        self.folderPath = try container.decode(String?.self, forKey: .folderPath)
    }
    if container.contains(.armTemplateFolderPath) {
        self.armTemplateFolderPath = try container.decode(String?.self, forKey: .armTemplateFolderPath)
    }
    if container.contains(.branchRef) {
        self.branchRef = try container.decode(String?.self, forKey: .branchRef)
    }
    if container.contains(.securityToken) {
        self.securityToken = try container.decode(String?.self, forKey: .securityToken)
    }
    if container.contains(.status) {
        self.status = try container.decode(EnableStatusEnum?.self, forKey: .status)
    }
    if container.contains(.createdDate) {
        self.createdDate = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .createdDate)), format: .dateTime)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(String?.self, forKey: .provisioningState)
    }
    if container.contains(.uniqueIdentifier) {
        self.uniqueIdentifier = try container.decode(String?.self, forKey: .uniqueIdentifier)
    }
    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.displayName != nil {try container.encode(self.displayName, forKey: .displayName)}
    if self.uri != nil {try container.encode(self.uri, forKey: .uri)}
    if self.sourceType != nil {try container.encode(self.sourceType, forKey: .sourceType)}
    if self.folderPath != nil {try container.encode(self.folderPath, forKey: .folderPath)}
    if self.armTemplateFolderPath != nil {try container.encode(self.armTemplateFolderPath, forKey: .armTemplateFolderPath)}
    if self.branchRef != nil {try container.encode(self.branchRef, forKey: .branchRef)}
    if self.securityToken != nil {try container.encode(self.securityToken, forKey: .securityToken)}
    if self.status != nil {try container.encode(self.status, forKey: .status)}
    if self.createdDate != nil {
        try container.encode(DateConverter.toString(date: self.createdDate!, format: .dateTime), forKey: .createdDate)
    }
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.uniqueIdentifier != nil {try container.encode(self.uniqueIdentifier, forKey: .uniqueIdentifier)}
  }
}

extension DataFactory {
  public static func createArtifactSourcePropertiesProtocol() -> ArtifactSourcePropertiesProtocol {
    return ArtifactSourcePropertiesData()
  }
}


// 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 ArtifactSourcePropertiesFragmentData : ArtifactSourcePropertiesFragmentProtocol {
    public var displayName: String?
    public var uri: String?
    public var sourceType: SourceControlTypeEnum?
    public var folderPath: String?
    public var armTemplateFolderPath: String?
    public var branchRef: String?
    public var securityToken: String?
    public var status: EnableStatusEnum?
    public var provisioningState: String?
    public var uniqueIdentifier: String?

        enum CodingKeys: String, CodingKey {case displayName = "displayName"
        case uri = "uri"
        case sourceType = "sourceType"
        case folderPath = "folderPath"
        case armTemplateFolderPath = "armTemplateFolderPath"
        case branchRef = "branchRef"
        case securityToken = "securityToken"
        case status = "status"
        case provisioningState = "provisioningState"
        case uniqueIdentifier = "uniqueIdentifier"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.displayName) {
        self.displayName = try container.decode(String?.self, forKey: .displayName)
    }
    if container.contains(.uri) {
        self.uri = try container.decode(String?.self, forKey: .uri)
    }
    if container.contains(.sourceType) {
        self.sourceType = try container.decode(SourceControlTypeEnum?.self, forKey: .sourceType)
    }
    if container.contains(.folderPath) {
        self.folderPath = try container.decode(String?.self, forKey: .folderPath)
    }
    if container.contains(.armTemplateFolderPath) {
        self.armTemplateFolderPath = try container.decode(String?.self, forKey: .armTemplateFolderPath)
    }
    if container.contains(.branchRef) {
        self.branchRef = try container.decode(String?.self, forKey: .branchRef)
    }
    if container.contains(.securityToken) {
        self.securityToken = try container.decode(String?.self, forKey: .securityToken)
    }
    if container.contains(.status) {
        self.status = try container.decode(EnableStatusEnum?.self, forKey: .status)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(String?.self, forKey: .provisioningState)
    }
    if container.contains(.uniqueIdentifier) {
        self.uniqueIdentifier = try container.decode(String?.self, forKey: .uniqueIdentifier)
    }
    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.displayName != nil {try container.encode(self.displayName, forKey: .displayName)}
    if self.uri != nil {try container.encode(self.uri, forKey: .uri)}
    if self.sourceType != nil {try container.encode(self.sourceType, forKey: .sourceType)}
    if self.folderPath != nil {try container.encode(self.folderPath, forKey: .folderPath)}
    if self.armTemplateFolderPath != nil {try container.encode(self.armTemplateFolderPath, forKey: .armTemplateFolderPath)}
    if self.branchRef != nil {try container.encode(self.branchRef, forKey: .branchRef)}
    if self.securityToken != nil {try container.encode(self.securityToken, forKey: .securityToken)}
    if self.status != nil {try container.encode(self.status, forKey: .status)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.uniqueIdentifier != nil {try container.encode(self.uniqueIdentifier, forKey: .uniqueIdentifier)}
  }
}

extension DataFactory {
  public static func createArtifactSourcePropertiesFragmentProtocol() -> ArtifactSourcePropertiesFragmentProtocol {
    return ArtifactSourcePropertiesFragmentData()
  }
}


// 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 AttachDiskPropertiesData : AttachDiskPropertiesProtocol {
    public var leasedByLabVmId: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createAttachDiskPropertiesProtocol() -> AttachDiskPropertiesProtocol {
    return AttachDiskPropertiesData()
  }
}


// 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 AttachNewDataDiskOptionsData : AttachNewDataDiskOptionsProtocol {
    public var diskSizeGiB: Int32?
    public var diskName: String?
    public var diskType: StorageTypeEnum?

        enum CodingKeys: String, CodingKey {case diskSizeGiB = "diskSizeGiB"
        case diskName = "diskName"
        case diskType = "diskType"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createAttachNewDataDiskOptionsProtocol() -> AttachNewDataDiskOptionsProtocol {
    return AttachNewDataDiskOptionsData()
  }
}


// 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 BulkCreationParametersData : BulkCreationParametersProtocol {
    public var instanceCount: Int32?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createBulkCreationParametersProtocol() -> BulkCreationParametersProtocol {
    return BulkCreationParametersData()
  }
}


// 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 ComputeDataDiskData : ComputeDataDiskProtocol {
    public var name: String?
    public var diskUri: String?
    public var managedDiskId: String?
    public var diskSizeGiB: Int32?

        enum CodingKeys: String, CodingKey {case name = "name"
        case diskUri = "diskUri"
        case managedDiskId = "managedDiskId"
        case diskSizeGiB = "diskSizeGiB"
        }

  public init()  {
  }

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

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

extension DataFactory {
  public static func createComputeDataDiskProtocol() -> ComputeDataDiskProtocol {
    return ComputeDataDiskData()
  }
}


// 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 ComputeDataDiskFragmentData : ComputeDataDiskFragmentProtocol {
    public var name: String?
    public var diskUri: String?
    public var managedDiskId: String?
    public var diskSizeGiB: Int32?

        enum CodingKeys: String, CodingKey {case name = "name"
        case diskUri = "diskUri"
        case managedDiskId = "managedDiskId"
        case diskSizeGiB = "diskSizeGiB"
        }

  public init()  {
  }

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

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

extension DataFactory {
  public static func createComputeDataDiskFragmentProtocol() -> ComputeDataDiskFragmentProtocol {
    return ComputeDataDiskFragmentData()
  }
}


// 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 ComputeVmInstanceViewStatusData : ComputeVmInstanceViewStatusProtocol {
    public var code: String?
    public var displayStatus: String?
    public var message: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createComputeVmInstanceViewStatusProtocol() -> ComputeVmInstanceViewStatusProtocol {
    return ComputeVmInstanceViewStatusData()
  }
}


// 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 ComputeVmInstanceViewStatusFragmentData : ComputeVmInstanceViewStatusFragmentProtocol {
    public var code: String?
    public var displayStatus: String?
    public var message: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createComputeVmInstanceViewStatusFragmentProtocol() -> ComputeVmInstanceViewStatusFragmentProtocol {
    return ComputeVmInstanceViewStatusFragmentData()
  }
}


// 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 ComputeVmPropertiesData : ComputeVmPropertiesProtocol {
    public var statuses: [ComputeVmInstanceViewStatusProtocol?]?
    public var osType: String?
    public var vmSize: String?
    public var networkInterfaceId: String?
    public var osDiskId: String?
    public var dataDiskIds: [String]?
    public var dataDisks: [ComputeDataDiskProtocol?]?

        enum CodingKeys: String, CodingKey {case statuses = "statuses"
        case osType = "osType"
        case vmSize = "vmSize"
        case networkInterfaceId = "networkInterfaceId"
        case osDiskId = "osDiskId"
        case dataDiskIds = "dataDiskIds"
        case dataDisks = "dataDisks"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createComputeVmPropertiesProtocol() -> ComputeVmPropertiesProtocol {
    return ComputeVmPropertiesData()
  }
}


// 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 ComputeVmPropertiesFragmentData : ComputeVmPropertiesFragmentProtocol {
    public var statuses: [ComputeVmInstanceViewStatusFragmentProtocol?]?
    public var osType: String?
    public var vmSize: String?
    public var networkInterfaceId: String?
    public var osDiskId: String?
    public var dataDiskIds: [String]?
    public var dataDisks: [ComputeDataDiskFragmentProtocol?]?

        enum CodingKeys: String, CodingKey {case statuses = "statuses"
        case osType = "osType"
        case vmSize = "vmSize"
        case networkInterfaceId = "networkInterfaceId"
        case osDiskId = "osDiskId"
        case dataDiskIds = "dataDiskIds"
        case dataDisks = "dataDisks"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createComputeVmPropertiesFragmentProtocol() -> ComputeVmPropertiesFragmentProtocol {
    return ComputeVmPropertiesFragmentData()
  }
}