// 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 RollingUpgradePolicyData : RollingUpgradePolicyProtocol {
    public var maxBatchInstancePercent: Int32?
    public var maxUnhealthyInstancePercent: Int32?
    public var maxUnhealthyUpgradedInstancePercent: Int32?
    public var pauseTimeBetweenBatches: String?

        enum CodingKeys: String, CodingKey {case maxBatchInstancePercent = "maxBatchInstancePercent"
        case maxUnhealthyInstancePercent = "maxUnhealthyInstancePercent"
        case maxUnhealthyUpgradedInstancePercent = "maxUnhealthyUpgradedInstancePercent"
        case pauseTimeBetweenBatches = "pauseTimeBetweenBatches"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createRollingUpgradePolicyProtocol() -> RollingUpgradePolicyProtocol {
    return RollingUpgradePolicyData()
  }
}


// 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 RollingUpgradeProgressInfoData : RollingUpgradeProgressInfoProtocol {
    public var successfulInstanceCount: Int32?
    public var failedInstanceCount: Int32?
    public var inProgressInstanceCount: Int32?
    public var pendingInstanceCount: Int32?

        enum CodingKeys: String, CodingKey {case successfulInstanceCount = "successfulInstanceCount"
        case failedInstanceCount = "failedInstanceCount"
        case inProgressInstanceCount = "inProgressInstanceCount"
        case pendingInstanceCount = "pendingInstanceCount"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createRollingUpgradeProgressInfoProtocol() -> RollingUpgradeProgressInfoProtocol {
    return RollingUpgradeProgressInfoData()
  }
}


// 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 RollingUpgradeRunningStatusData : RollingUpgradeRunningStatusProtocol {
    public var code: RollingUpgradeStatusCodeEnum?
    public var startTime: Date?
    public var lastAction: RollingUpgradeActionTypeEnum?
    public var lastActionTime: Date?

        enum CodingKeys: String, CodingKey {case code = "code"
        case startTime = "startTime"
        case lastAction = "lastAction"
        case lastActionTime = "lastActionTime"
        }

  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(RollingUpgradeStatusCodeEnum?.self, forKey: .code)
    }
    if container.contains(.startTime) {
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)
    }
    if container.contains(.lastAction) {
        self.lastAction = try container.decode(RollingUpgradeActionTypeEnum?.self, forKey: .lastAction)
    }
    if container.contains(.lastActionTime) {
        self.lastActionTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastActionTime)), 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.code != nil {try container.encode(self.code, forKey: .code)}
    if self.startTime != nil {
        try container.encode(DateConverter.toString(date: self.startTime!, format: .dateTime), forKey: .startTime)
    }
    if self.lastAction != nil {try container.encode(self.lastAction, forKey: .lastAction)}
    if self.lastActionTime != nil {
        try container.encode(DateConverter.toString(date: self.lastActionTime!, format: .dateTime), forKey: .lastActionTime)
    }
  }
}

extension DataFactory {
  public static func createRollingUpgradeRunningStatusProtocol() -> RollingUpgradeRunningStatusProtocol {
    return RollingUpgradeRunningStatusData()
  }
}


// RollingUpgradeStatusCode enumerates the values for rolling upgrade status code.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum RollingUpgradeStatusCodeEnum: String, Codable
{
// Cancelled specifies the cancelled state for rolling upgrade status code.
    case Cancelled = "Cancelled"
// Completed specifies the completed state for rolling upgrade status code.
    case Completed = "Completed"
// Faulted specifies the faulted state for rolling upgrade status code.
    case Faulted = "Faulted"
// RollingForward specifies the rolling forward state for rolling upgrade status code.
    case RollingForward = "RollingForward"
}


// 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 RollingUpgradeStatusInfoData : RollingUpgradeStatusInfoProtocol, 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: RollingUpgradeStatusInfoPropertiesProtocol?

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

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

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

extension DataFactory {
  public static func createRollingUpgradeStatusInfoProtocol(location: String) -> RollingUpgradeStatusInfoProtocol {
    return RollingUpgradeStatusInfoData(location: location)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct RollingUpgradeStatusInfoPropertiesData : RollingUpgradeStatusInfoPropertiesProtocol {
    public var policy: RollingUpgradePolicyProtocol?
    public var runningStatus: RollingUpgradeRunningStatusProtocol?
    public var progress: RollingUpgradeProgressInfoProtocol?
    public var error: ApiErrorProtocol?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createRollingUpgradeStatusInfoPropertiesProtocol() -> RollingUpgradeStatusInfoPropertiesProtocol {
    return RollingUpgradeStatusInfoPropertiesData()
  }
}


// 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 RunCommandDocumentBaseData : RunCommandDocumentBaseProtocol {
    public var schema: String
    public var id: String
    public var osType: OperatingSystemTypesEnum
    public var label: String
    public var description: String

        enum CodingKeys: String, CodingKey {case schema = "$schema"
        case id = "id"
        case osType = "osType"
        case label = "label"
        case description = "description"
        }

  public init(schema: String, id: String, osType: OperatingSystemTypesEnum, label: String, description: String)  {
    self.schema = schema
    self.id = id
    self.osType = osType
    self.label = label
    self.description = description
  }

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

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

extension DataFactory {
  public static func createRunCommandDocumentBaseProtocol(schema: String, id: String, osType: OperatingSystemTypesEnum, label: String, description: String) -> RunCommandDocumentBaseProtocol {
    return RunCommandDocumentBaseData(schema: schema, id: id, osType: osType, label: label, description: description)
  }
}


// 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 RunCommandDocumentData : RunCommandDocumentProtocol, RunCommandDocumentBaseProtocol {
    public var schema: String
    public var id: String
    public var osType: OperatingSystemTypesEnum
    public var label: String
    public var description: String
    public var script: [String]
    public var parameters: [RunCommandParameterDefinitionProtocol?]?

        enum CodingKeys: String, CodingKey {case schema = "$schema"
        case id = "id"
        case osType = "osType"
        case label = "label"
        case description = "description"
        case script = "script"
        case parameters = "parameters"
        }

  public init(schema: String, id: String, osType: OperatingSystemTypesEnum, label: String, description: String, script: [String])  {
    self.schema = schema
    self.id = id
    self.osType = osType
    self.label = label
    self.description = description
    self.script = script
  }

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

extension DataFactory {
  public static func createRunCommandDocumentProtocol(schema: String, id: String, osType: OperatingSystemTypesEnum, label: String, description: String, script: [String]) -> RunCommandDocumentProtocol {
    return RunCommandDocumentData(schema: schema, id: id, osType: osType, label: label, description: description, script: script)
  }
}


// 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 RunCommandInputData : RunCommandInputProtocol {
    public var commandId: String
    public var script: [String]?
    public var parameters: [RunCommandInputParameterProtocol?]?

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

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

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

extension DataFactory {
  public static func createRunCommandInputProtocol(commandId: String) -> RunCommandInputProtocol {
    return RunCommandInputData(commandId: commandId)
  }
}


// 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 RunCommandInputParameterData : RunCommandInputParameterProtocol {
    public var name: String
    public var value: String

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

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

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

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

extension DataFactory {
  public static func createRunCommandInputParameterProtocol(name: String, value: String) -> RunCommandInputParameterProtocol {
    return RunCommandInputParameterData(name: name, value: value)
  }
}


// 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 RunCommandListResultData : RunCommandListResultProtocol {
    public var value: [RunCommandDocumentBaseProtocol]
    public var _nextLink: String?

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

  public init(value: [RunCommandDocumentBaseProtocol])  {
    self.value = value
  }

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

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

extension DataFactory {
  public static func createRunCommandListResultProtocol(value: [RunCommandDocumentBaseProtocol]) -> RunCommandListResultProtocol {
    return RunCommandListResultData(value: value)
  }
}


// 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 RunCommandParameterDefinitionData : RunCommandParameterDefinitionProtocol {
    public var name: String
    public var type: String
    public var defaultValue: String?
    public var _required: Bool?

        enum CodingKeys: String, CodingKey {case name = "name"
        case type = "type"
        case defaultValue = "defaultValue"
        case _required = "required"
        }

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

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

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

extension DataFactory {
  public static func createRunCommandParameterDefinitionProtocol(name: String, type: String) -> RunCommandParameterDefinitionProtocol {
    return RunCommandParameterDefinitionData(name: name, type: type)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct RunCommandResultData : RunCommandResultProtocol, OperationStatusResponseProtocol {
    public var name: String?
    public var status: String?
    public var startTime: Date?
    public var endTime: Date?
    public var error: ApiErrorProtocol?
    public var properties: RunCommandResultPropertiesProtocol?

        enum CodingKeys: String, CodingKey {case name = "name"
        case status = "status"
        case startTime = "startTime"
        case endTime = "endTime"
        case error = "error"
        case properties = "properties"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.name) {
        self.name = try container.decode(String?.self, forKey: .name)
    }
    if container.contains(.status) {
        self.status = try container.decode(String?.self, forKey: .status)
    }
    if container.contains(.startTime) {
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)
    }
    if container.contains(.endTime) {
        self.endTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .endTime)), format: .dateTime)
    }
    if container.contains(.error) {
        self.error = try container.decode(ApiErrorData?.self, forKey: .error)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(RunCommandResultPropertiesData?.self, forKey: .properties)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.status != nil {try container.encode(self.status, forKey: .status)}
    if self.startTime != nil {
        try container.encode(DateConverter.toString(date: self.startTime!, format: .dateTime), forKey: .startTime)
    }
    if self.endTime != nil {
        try container.encode(DateConverter.toString(date: self.endTime!, format: .dateTime), forKey: .endTime)
    }
    if self.error != nil {try container.encode(self.error as! ApiErrorData?, forKey: .error)}
    if self.properties != nil {try container.encode(self.properties as! RunCommandResultPropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createRunCommandResultProtocol() -> RunCommandResultProtocol {
    return RunCommandResultData()
  }
}


// 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 RunCommandResultPropertiesData : RunCommandResultPropertiesProtocol {
    public var output: [String: String?]?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createRunCommandResultPropertiesProtocol() -> RunCommandResultPropertiesProtocol {
    return RunCommandResultPropertiesData()
  }
}


// SettingNames enumerates the values for setting names.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum SettingNamesEnum: String, Codable
{
// AutoLogon specifies the auto logon state for setting names.
    case AutoLogon = "AutoLogon"
// FirstLogonCommands specifies the first logon commands state for setting names.
    case FirstLogonCommands = "FirstLogonCommands"
}


// 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 SkuData : SkuProtocol {
    public var name: String?
    public var tier: String?
    public var capacity: Int64?

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

  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(.tier) {
        self.tier = try container.decode(String?.self, forKey: .tier)
    }
    if container.contains(.capacity) {
        self.capacity = try container.decode(Int64?.self, forKey: .capacity)
    }
    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.tier != nil {try container.encode(self.tier, forKey: .tier)}
    if self.capacity != nil {try container.encode(self.capacity, forKey: .capacity)}
  }
}

extension DataFactory {
  public static func createSkuProtocol() -> SkuProtocol {
    return SkuData()
  }
}


// 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 SnapshotData : SnapshotProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String
    public var tags: [String:String]?
    public var managedBy: String?
    public var sku: DiskSkuProtocol?
    public var properties: DiskPropertiesProtocol?

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

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

  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)
    }
    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(.managedBy) {
        self.managedBy = try container.decode(String?.self, forKey: .managedBy)
    }
    if container.contains(.sku) {
        self.sku = try container.decode(DiskSkuData?.self, forKey: .sku)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(DiskPropertiesData?.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)}
    try container.encode(self.location, forKey: .location)
    if self.tags != nil {try container.encode(self.tags, forKey: .tags)}
    if self.managedBy != nil {try container.encode(self.managedBy, forKey: .managedBy)}
    if self.sku != nil {try container.encode(self.sku as! DiskSkuData?, forKey: .sku)}
    if self.properties != nil {try container.encode(self.properties as! DiskPropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createSnapshotProtocol(location: String) -> SnapshotProtocol {
    return SnapshotData(location: location)
  }
}


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

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

  public init(value: [SnapshotProtocol])  {
    self.value = value
  }

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

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

extension DataFactory {
  public static func createSnapshotListProtocol(value: [SnapshotProtocol]) -> SnapshotListProtocol {
    return SnapshotListData(value: value)
  }
}


// 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 SnapshotUpdateData : SnapshotUpdateProtocol, ResourceUpdateProtocol {
    public var tags: [String:String]?
    public var sku: DiskSkuProtocol?
    public var properties: DiskUpdatePropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createSnapshotUpdateProtocol() -> SnapshotUpdateProtocol {
    return SnapshotUpdateData()
  }
}


// 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 SourceVaultData : SourceVaultProtocol {
    public var id: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createSourceVaultProtocol() -> SourceVaultProtocol {
    return SourceVaultData()
  }
}


// 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 SshConfigurationData : SshConfigurationProtocol {
    public var publicKeys: [SshPublicKeyProtocol?]?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createSshConfigurationProtocol() -> SshConfigurationProtocol {
    return SshConfigurationData()
  }
}


// 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 SshPublicKeyData : SshPublicKeyProtocol {
    public var path: String?
    public var keyData: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createSshPublicKeyProtocol() -> SshPublicKeyProtocol {
    return SshPublicKeyData()
  }
}


// StatusLevelTypes enumerates the values for status level types.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum StatusLevelTypesEnum: String, Codable
{
// Error specifies the error state for status level types.
    case Error = "Error"
// Info specifies the info state for status level types.
    case Info = "Info"
// Warning specifies the warning state for status level types.
    case Warning = "Warning"
}


// StorageAccountTypes enumerates the values for storage account types.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum StorageAccountTypesEnum: String, Codable
{
// PremiumLRS specifies the premium lrs state for storage account types.
    case PremiumLRS = "Premium_LRS"
// StandardLRS specifies the standard lrs state for storage account types.
    case StandardLRS = "Standard_LRS"
}


// 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 StorageProfileData : StorageProfileProtocol {
    public var imageReference: ImageReferenceProtocol?
    public var osDisk: OSDiskProtocol?
    public var dataDisks: [DataDiskProtocol?]?

        enum CodingKeys: String, CodingKey {case imageReference = "imageReference"
        case osDisk = "osDisk"
        case dataDisks = "dataDisks"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createStorageProfileProtocol() -> StorageProfileProtocol {
    return StorageProfileData()
  }
}


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

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

  public init()  {
  }

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

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

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


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createSubResourceReadOnlyProtocol() -> SubResourceReadOnlyProtocol {
    return SubResourceReadOnlyData()
  }
}


// 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 ThrottledRequestsInputData : ThrottledRequestsInputProtocol, LogAnalyticsInputBaseProtocol {
    public var blobContainerSasUri: String
    public var fromTime: Date
    public var toTime: Date
    public var groupByThrottlePolicy: Bool?
    public var groupByOperationName: Bool?
    public var groupByResourceName: Bool?

        enum CodingKeys: String, CodingKey {case blobContainerSasUri = "blobContainerSasUri"
        case fromTime = "fromTime"
        case toTime = "toTime"
        case groupByThrottlePolicy = "groupByThrottlePolicy"
        case groupByOperationName = "groupByOperationName"
        case groupByResourceName = "groupByResourceName"
        }

  public init(blobContainerSasUri: String, fromTime: Date, toTime: Date)  {
    self.blobContainerSasUri = blobContainerSasUri
    self.fromTime = fromTime
    self.toTime = toTime
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.blobContainerSasUri = try container.decode(String.self, forKey: .blobContainerSasUri)
        self.fromTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .fromTime)), format: .dateTime)!
        self.toTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .toTime)), format: .dateTime)!
    if container.contains(.groupByThrottlePolicy) {
        self.groupByThrottlePolicy = try container.decode(Bool?.self, forKey: .groupByThrottlePolicy)
    }
    if container.contains(.groupByOperationName) {
        self.groupByOperationName = try container.decode(Bool?.self, forKey: .groupByOperationName)
    }
    if container.contains(.groupByResourceName) {
        self.groupByResourceName = try container.decode(Bool?.self, forKey: .groupByResourceName)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.blobContainerSasUri, forKey: .blobContainerSasUri)
    try container.encode(DateConverter.toString(date: self.fromTime, format: .dateTime), forKey: .fromTime)
    try container.encode(DateConverter.toString(date: self.toTime, format: .dateTime), forKey: .toTime)
    if self.groupByThrottlePolicy != nil {try container.encode(self.groupByThrottlePolicy, forKey: .groupByThrottlePolicy)}
    if self.groupByOperationName != nil {try container.encode(self.groupByOperationName, forKey: .groupByOperationName)}
    if self.groupByResourceName != nil {try container.encode(self.groupByResourceName, forKey: .groupByResourceName)}
  }
}

extension DataFactory {
  public static func createThrottledRequestsInputProtocol(blobContainerSasUri: String, fromTime: Date, toTime: Date) -> ThrottledRequestsInputProtocol {
    return ThrottledRequestsInputData(blobContainerSasUri: blobContainerSasUri, fromTime: fromTime, toTime: toTime)
  }
}


// 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 UpdateResourceData : UpdateResourceProtocol {
    public var tags: [String:String]?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createUpdateResourceProtocol() -> UpdateResourceProtocol {
    return UpdateResourceData()
  }
}


// UpgradeMode enumerates the values for upgrade mode.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum UpgradeModeEnum: String, Codable
{
// Automatic specifies the automatic state for upgrade mode.
    case Automatic = "Automatic"
// Manual specifies the manual state for upgrade mode.
    case Manual = "Manual"
// Rolling specifies the rolling state for upgrade mode.
    case Rolling = "Rolling"
}


// 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 UpgradePolicyData : UpgradePolicyProtocol {
    public var mode: UpgradeModeEnum?
    public var rollingUpgradePolicy: RollingUpgradePolicyProtocol?
    public var automaticOSUpgrade: Bool?

        enum CodingKeys: String, CodingKey {case mode = "mode"
        case rollingUpgradePolicy = "rollingUpgradePolicy"
        case automaticOSUpgrade = "automaticOSUpgrade"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createUpgradePolicyProtocol() -> UpgradePolicyProtocol {
    return UpgradePolicyData()
  }
}


// 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 UsageData : UsageProtocol {
    public var unit: String
    public var currentValue: Int32
    public var limit: Int64
    public var name: UsageNameProtocol

        enum CodingKeys: String, CodingKey {case unit = "unit"
        case currentValue = "currentValue"
        case limit = "limit"
        case name = "name"
        }

  public init(unit: String, currentValue: Int32, limit: Int64, name: UsageNameProtocol)  {
    self.unit = unit
    self.currentValue = currentValue
    self.limit = limit
    self.name = name
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.unit, forKey: .unit)
    try container.encode(self.currentValue, forKey: .currentValue)
    try container.encode(self.limit, forKey: .limit)
    try container.encode(self.name as! UsageNameData, forKey: .name)
  }
}

extension DataFactory {
  public static func createUsageProtocol(unit: String, currentValue: Int32, limit: Int64, name: UsageNameProtocol) -> UsageProtocol {
    return UsageData(unit: unit, currentValue: currentValue, limit: limit, name: name)
  }
}


// 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 UsageNameData : UsageNameProtocol {
    public var value: String?
    public var localizedValue: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createUsageNameProtocol() -> UsageNameProtocol {
    return UsageNameData()
  }
}


// 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 VaultCertificateData : VaultCertificateProtocol {
    public var certificateUrl: String?
    public var certificateStore: String?

        enum CodingKeys: String, CodingKey {case certificateUrl = "certificateUrl"
        case certificateStore = "certificateStore"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createVaultCertificateProtocol() -> VaultCertificateProtocol {
    return VaultCertificateData()
  }
}


// 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 VaultSecretGroupData : VaultSecretGroupProtocol {
    public var sourceVault: SubResourceProtocol?
    public var vaultCertificates: [VaultCertificateProtocol?]?

        enum CodingKeys: String, CodingKey {case sourceVault = "sourceVault"
        case vaultCertificates = "vaultCertificates"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createVaultSecretGroupProtocol() -> VaultSecretGroupProtocol {
    return VaultSecretGroupData()
  }
}


// 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 VirtualHardDiskData : VirtualHardDiskProtocol {
    public var uri: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createVirtualHardDiskProtocol() -> VirtualHardDiskProtocol {
    return VirtualHardDiskData()
  }
}


// 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 VirtualMachineAgentInstanceViewData : VirtualMachineAgentInstanceViewProtocol {
    public var vmAgentVersion: String?
    public var extensionHandlers: [VirtualMachineExtensionHandlerInstanceViewProtocol?]?
    public var statuses: [InstanceViewStatusProtocol?]?

        enum CodingKeys: String, CodingKey {case vmAgentVersion = "vmAgentVersion"
        case extensionHandlers = "extensionHandlers"
        case statuses = "statuses"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createVirtualMachineAgentInstanceViewProtocol() -> VirtualMachineAgentInstanceViewProtocol {
    return VirtualMachineAgentInstanceViewData()
  }
}


// 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 VirtualMachineCaptureParametersData : VirtualMachineCaptureParametersProtocol {
    public var vhdPrefix: String
    public var destinationContainerName: String
    public var overwriteVhds: Bool

        enum CodingKeys: String, CodingKey {case vhdPrefix = "vhdPrefix"
        case destinationContainerName = "destinationContainerName"
        case overwriteVhds = "overwriteVhds"
        }

  public init(vhdPrefix: String, destinationContainerName: String, overwriteVhds: Bool)  {
    self.vhdPrefix = vhdPrefix
    self.destinationContainerName = destinationContainerName
    self.overwriteVhds = overwriteVhds
  }

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

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

extension DataFactory {
  public static func createVirtualMachineCaptureParametersProtocol(vhdPrefix: String, destinationContainerName: String, overwriteVhds: Bool) -> VirtualMachineCaptureParametersProtocol {
    return VirtualMachineCaptureParametersData(vhdPrefix: vhdPrefix, destinationContainerName: destinationContainerName, overwriteVhds: overwriteVhds)
  }
}


// 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 VirtualMachineCaptureResultData : VirtualMachineCaptureResultProtocol, SubResourceProtocol {
    public var id: String?
    public var properties: VirtualMachineCaptureResultPropertiesProtocol?

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

extension DataFactory {
  public static func createVirtualMachineCaptureResultProtocol() -> VirtualMachineCaptureResultProtocol {
    return VirtualMachineCaptureResultData()
  }
}


// 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 VirtualMachineCaptureResultPropertiesData : VirtualMachineCaptureResultPropertiesProtocol {
    public var output: [String: String?]?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createVirtualMachineCaptureResultPropertiesProtocol() -> VirtualMachineCaptureResultPropertiesProtocol {
    return VirtualMachineCaptureResultPropertiesData()
  }
}


// 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 VirtualMachineData : VirtualMachineProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String
    public var tags: [String:String]?
    public var plan: PlanProtocol?
    public var properties: VirtualMachinePropertiesProtocol?
    public var resources: [VirtualMachineExtensionProtocol?]?
    public var identity: VirtualMachineIdentityProtocol?
    public var zones: [String]?

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

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

  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)
    }
    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(.plan) {
        self.plan = try container.decode(PlanData?.self, forKey: .plan)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(VirtualMachinePropertiesData?.self, forKey: .properties)
    }
    if container.contains(.resources) {
        self.resources = try container.decode([VirtualMachineExtensionData?]?.self, forKey: .resources)
    }
    if container.contains(.identity) {
        self.identity = try container.decode(VirtualMachineIdentityData?.self, forKey: .identity)
    }
    if container.contains(.zones) {
        self.zones = try container.decode([String]?.self, forKey: .zones)
    }
    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)}
    try container.encode(self.location, forKey: .location)
    if self.tags != nil {try container.encode(self.tags, forKey: .tags)}
    if self.plan != nil {try container.encode(self.plan as! PlanData?, forKey: .plan)}
    if self.properties != nil {try container.encode(self.properties as! VirtualMachinePropertiesData?, forKey: .properties)}
    if self.resources != nil {try container.encode(self.resources as! [VirtualMachineExtensionData?]?, forKey: .resources)}
    if self.identity != nil {try container.encode(self.identity as! VirtualMachineIdentityData?, forKey: .identity)}
    if self.zones != nil {try container.encode(self.zones as! [String]?, forKey: .zones)}
  }
}

extension DataFactory {
  public static func createVirtualMachineProtocol(location: String) -> VirtualMachineProtocol {
    return VirtualMachineData(location: location)
  }
}


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

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

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

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

extension DataFactory {
  public static func createVirtualMachineExtensionProtocol(location: String) -> VirtualMachineExtensionProtocol {
    return VirtualMachineExtensionData(location: location)
  }
}


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

        enum CodingKeys: String, CodingKey {case type = "type"
        case typeHandlerVersion = "typeHandlerVersion"
        case status = "status"
        }

  public init()  {
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.type != nil {try container.encode(self.type, forKey: .type)}
    if self.typeHandlerVersion != nil {try container.encode(self.typeHandlerVersion, forKey: .typeHandlerVersion)}
    if self.status != nil {try container.encode(self.status as! InstanceViewStatusData?, forKey: .status)}
  }
}

extension DataFactory {
  public static func createVirtualMachineExtensionHandlerInstanceViewProtocol() -> VirtualMachineExtensionHandlerInstanceViewProtocol {
    return VirtualMachineExtensionHandlerInstanceViewData()
  }
}


// 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 VirtualMachineExtensionImageData : VirtualMachineExtensionImageProtocol, 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: VirtualMachineExtensionImagePropertiesProtocol?

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

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

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

extension DataFactory {
  public static func createVirtualMachineExtensionImageProtocol(location: String) -> VirtualMachineExtensionImageProtocol {
    return VirtualMachineExtensionImageData(location: location)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct VirtualMachineExtensionImagePropertiesData : VirtualMachineExtensionImagePropertiesProtocol {
    public var operatingSystem: String
    public var computeRole: String
    public var handlerSchema: String
    public var vmScaleSetEnabled: Bool?
    public var supportsMultipleExtensions: Bool?

        enum CodingKeys: String, CodingKey {case operatingSystem = "operatingSystem"
        case computeRole = "computeRole"
        case handlerSchema = "handlerSchema"
        case vmScaleSetEnabled = "vmScaleSetEnabled"
        case supportsMultipleExtensions = "supportsMultipleExtensions"
        }

  public init(operatingSystem: String, computeRole: String, handlerSchema: String)  {
    self.operatingSystem = operatingSystem
    self.computeRole = computeRole
    self.handlerSchema = handlerSchema
  }

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

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

extension DataFactory {
  public static func createVirtualMachineExtensionImagePropertiesProtocol(operatingSystem: String, computeRole: String, handlerSchema: String) -> VirtualMachineExtensionImagePropertiesProtocol {
    return VirtualMachineExtensionImagePropertiesData(operatingSystem: operatingSystem, computeRole: computeRole, handlerSchema: handlerSchema)
  }
}


// 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 VirtualMachineExtensionInstanceViewData : VirtualMachineExtensionInstanceViewProtocol {
    public var name: String?
    public var type: String?
    public var typeHandlerVersion: String?
    public var substatuses: [InstanceViewStatusProtocol?]?
    public var statuses: [InstanceViewStatusProtocol?]?

        enum CodingKeys: String, CodingKey {case name = "name"
        case type = "type"
        case typeHandlerVersion = "typeHandlerVersion"
        case substatuses = "substatuses"
        case statuses = "statuses"
        }

  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(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    if container.contains(.typeHandlerVersion) {
        self.typeHandlerVersion = try container.decode(String?.self, forKey: .typeHandlerVersion)
    }
    if container.contains(.substatuses) {
        self.substatuses = try container.decode([InstanceViewStatusData?]?.self, forKey: .substatuses)
    }
    if container.contains(.statuses) {
        self.statuses = try container.decode([InstanceViewStatusData?]?.self, forKey: .statuses)
    }
    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.type != nil {try container.encode(self.type, forKey: .type)}
    if self.typeHandlerVersion != nil {try container.encode(self.typeHandlerVersion, forKey: .typeHandlerVersion)}
    if self.substatuses != nil {try container.encode(self.substatuses as! [InstanceViewStatusData?]?, forKey: .substatuses)}
    if self.statuses != nil {try container.encode(self.statuses as! [InstanceViewStatusData?]?, forKey: .statuses)}
  }
}

extension DataFactory {
  public static func createVirtualMachineExtensionInstanceViewProtocol() -> VirtualMachineExtensionInstanceViewProtocol {
    return VirtualMachineExtensionInstanceViewData()
  }
}


// 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 VirtualMachineExtensionPropertiesData : VirtualMachineExtensionPropertiesProtocol {
    public var forceUpdateTag: String?
    public var publisher: String?
    public var type: String?
    public var typeHandlerVersion: String?
    public var autoUpgradeMinorVersion: Bool?
    public var settings: [String: String?]?
    public var protectedSettings: [String: String?]?
    public var provisioningState: String?
    public var instanceView: VirtualMachineExtensionInstanceViewProtocol?

        enum CodingKeys: String, CodingKey {case forceUpdateTag = "forceUpdateTag"
        case publisher = "publisher"
        case type = "type"
        case typeHandlerVersion = "typeHandlerVersion"
        case autoUpgradeMinorVersion = "autoUpgradeMinorVersion"
        case settings = "settings"
        case protectedSettings = "protectedSettings"
        case provisioningState = "provisioningState"
        case instanceView = "instanceView"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.forceUpdateTag) {
        self.forceUpdateTag = try container.decode(String?.self, forKey: .forceUpdateTag)
    }
    if container.contains(.publisher) {
        self.publisher = try container.decode(String?.self, forKey: .publisher)
    }
    if container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    if container.contains(.typeHandlerVersion) {
        self.typeHandlerVersion = try container.decode(String?.self, forKey: .typeHandlerVersion)
    }
    if container.contains(.autoUpgradeMinorVersion) {
        self.autoUpgradeMinorVersion = try container.decode(Bool?.self, forKey: .autoUpgradeMinorVersion)
    }
    if container.contains(.settings) {
        self.settings = try container.decode([String: String?]?.self, forKey: .settings)
    }
    if container.contains(.protectedSettings) {
        self.protectedSettings = try container.decode([String: String?]?.self, forKey: .protectedSettings)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(String?.self, forKey: .provisioningState)
    }
    if container.contains(.instanceView) {
        self.instanceView = try container.decode(VirtualMachineExtensionInstanceViewData?.self, forKey: .instanceView)
    }
    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.forceUpdateTag != nil {try container.encode(self.forceUpdateTag, forKey: .forceUpdateTag)}
    if self.publisher != nil {try container.encode(self.publisher, forKey: .publisher)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
    if self.typeHandlerVersion != nil {try container.encode(self.typeHandlerVersion, forKey: .typeHandlerVersion)}
    if self.autoUpgradeMinorVersion != nil {try container.encode(self.autoUpgradeMinorVersion, forKey: .autoUpgradeMinorVersion)}
    if self.settings != nil {try container.encode(self.settings, forKey: .settings)}
    if self.protectedSettings != nil {try container.encode(self.protectedSettings, forKey: .protectedSettings)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.instanceView != nil {try container.encode(self.instanceView as! VirtualMachineExtensionInstanceViewData?, forKey: .instanceView)}
  }
}

extension DataFactory {
  public static func createVirtualMachineExtensionPropertiesProtocol() -> VirtualMachineExtensionPropertiesProtocol {
    return VirtualMachineExtensionPropertiesData()
  }
}


// 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 VirtualMachineHealthStatusData : VirtualMachineHealthStatusProtocol {
    public var status: InstanceViewStatusProtocol?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createVirtualMachineHealthStatusProtocol() -> VirtualMachineHealthStatusProtocol {
    return VirtualMachineHealthStatusData()
  }
}