// 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 InnerHealthErrorData : InnerHealthErrorProtocol {
    public var errorSource: String?
    public var errorType: String?
    public var errorLevel: String?
    public var errorCategory: String?
    public var errorCode: String?
    public var summaryMessage: String?
    public var errorMessage: String?
    public var possibleCauses: String?
    public var recommendedAction: String?
    public var creationTimeUtc: Date?
    public var recoveryProviderErrorMessage: String?
    public var entityId: String?

        enum CodingKeys: String, CodingKey {case errorSource = "errorSource"
        case errorType = "errorType"
        case errorLevel = "errorLevel"
        case errorCategory = "errorCategory"
        case errorCode = "errorCode"
        case summaryMessage = "summaryMessage"
        case errorMessage = "errorMessage"
        case possibleCauses = "possibleCauses"
        case recommendedAction = "recommendedAction"
        case creationTimeUtc = "creationTimeUtc"
        case recoveryProviderErrorMessage = "recoveryProviderErrorMessage"
        case entityId = "entityId"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.errorSource) {
        self.errorSource = try container.decode(String?.self, forKey: .errorSource)
    }
    if container.contains(.errorType) {
        self.errorType = try container.decode(String?.self, forKey: .errorType)
    }
    if container.contains(.errorLevel) {
        self.errorLevel = try container.decode(String?.self, forKey: .errorLevel)
    }
    if container.contains(.errorCategory) {
        self.errorCategory = try container.decode(String?.self, forKey: .errorCategory)
    }
    if container.contains(.errorCode) {
        self.errorCode = try container.decode(String?.self, forKey: .errorCode)
    }
    if container.contains(.summaryMessage) {
        self.summaryMessage = try container.decode(String?.self, forKey: .summaryMessage)
    }
    if container.contains(.errorMessage) {
        self.errorMessage = try container.decode(String?.self, forKey: .errorMessage)
    }
    if container.contains(.possibleCauses) {
        self.possibleCauses = try container.decode(String?.self, forKey: .possibleCauses)
    }
    if container.contains(.recommendedAction) {
        self.recommendedAction = try container.decode(String?.self, forKey: .recommendedAction)
    }
    if container.contains(.creationTimeUtc) {
        self.creationTimeUtc = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .creationTimeUtc)), format: .dateTime)
    }
    if container.contains(.recoveryProviderErrorMessage) {
        self.recoveryProviderErrorMessage = try container.decode(String?.self, forKey: .recoveryProviderErrorMessage)
    }
    if container.contains(.entityId) {
        self.entityId = try container.decode(String?.self, forKey: .entityId)
    }
    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.errorSource != nil {try container.encode(self.errorSource, forKey: .errorSource)}
    if self.errorType != nil {try container.encode(self.errorType, forKey: .errorType)}
    if self.errorLevel != nil {try container.encode(self.errorLevel, forKey: .errorLevel)}
    if self.errorCategory != nil {try container.encode(self.errorCategory, forKey: .errorCategory)}
    if self.errorCode != nil {try container.encode(self.errorCode, forKey: .errorCode)}
    if self.summaryMessage != nil {try container.encode(self.summaryMessage, forKey: .summaryMessage)}
    if self.errorMessage != nil {try container.encode(self.errorMessage, forKey: .errorMessage)}
    if self.possibleCauses != nil {try container.encode(self.possibleCauses, forKey: .possibleCauses)}
    if self.recommendedAction != nil {try container.encode(self.recommendedAction, forKey: .recommendedAction)}
    if self.creationTimeUtc != nil {
        try container.encode(DateConverter.toString(date: self.creationTimeUtc!, format: .dateTime), forKey: .creationTimeUtc)
    }
    if self.recoveryProviderErrorMessage != nil {try container.encode(self.recoveryProviderErrorMessage, forKey: .recoveryProviderErrorMessage)}
    if self.entityId != nil {try container.encode(self.entityId, forKey: .entityId)}
  }
}

extension DataFactory {
  public static func createInnerHealthErrorProtocol() -> InnerHealthErrorProtocol {
    return InnerHealthErrorData()
  }
}


// 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 InputEndpointData : InputEndpointProtocol {
    public var endpointName: String?
    public var privatePort: Int32?
    public var publicPort: Int32?
    public var _protocol: String?

        enum CodingKeys: String, CodingKey {case endpointName = "endpointName"
        case privatePort = "privatePort"
        case publicPort = "publicPort"
        case _protocol = "protocol"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createInputEndpointProtocol() -> InputEndpointProtocol {
    return InputEndpointData()
  }
}


// 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 JobCollectionData : JobCollectionProtocol {
    public var value: [JobProtocol?]?
    public var _nextLink: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createJobCollectionProtocol() -> JobCollectionProtocol {
    return JobCollectionData()
  }
}


// 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 JobData : JobProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var properties: JobPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createJobProtocol() -> JobProtocol {
    return JobData()
  }
}


// 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 JobDetailsData : JobDetailsProtocol {
    public var affectedObjectDetails: [String:String]?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createJobDetailsProtocol() -> JobDetailsProtocol {
    return JobDetailsData()
  }
}


// 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 JobEntityData : JobEntityProtocol {
    public var jobId: String?
    public var jobFriendlyName: String?
    public var targetObjectId: String?
    public var targetObjectName: String?
    public var targetInstanceType: String?
    public var jobScenarioName: String?

        enum CodingKeys: String, CodingKey {case jobId = "jobId"
        case jobFriendlyName = "jobFriendlyName"
        case targetObjectId = "targetObjectId"
        case targetObjectName = "targetObjectName"
        case targetInstanceType = "targetInstanceType"
        case jobScenarioName = "jobScenarioName"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createJobEntityProtocol() -> JobEntityProtocol {
    return JobEntityData()
  }
}


// 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 JobErrorDetailsData : JobErrorDetailsProtocol {
    public var serviceErrorDetails: ServiceErrorProtocol?
    public var providerErrorDetails: ProviderErrorProtocol?
    public var errorLevel: String?
    public var creationTime: Date?
    public var taskId: String?

        enum CodingKeys: String, CodingKey {case serviceErrorDetails = "serviceErrorDetails"
        case providerErrorDetails = "providerErrorDetails"
        case errorLevel = "errorLevel"
        case creationTime = "creationTime"
        case taskId = "taskId"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createJobErrorDetailsProtocol() -> JobErrorDetailsProtocol {
    return JobErrorDetailsData()
  }
}


// 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 JobPropertiesData : JobPropertiesProtocol {
    public var activityId: String?
    public var scenarioName: String?
    public var friendlyName: String?
    public var state: String?
    public var stateDescription: String?
    public var tasks: [ASRTaskProtocol?]?
    public var errors: [JobErrorDetailsProtocol?]?
    public var startTime: Date?
    public var endTime: Date?
    public var allowedActions: [String]?
    public var targetObjectId: String?
    public var targetObjectName: String?
    public var targetInstanceType: String?
    public var customDetails: JobDetailsProtocol?

        enum CodingKeys: String, CodingKey {case activityId = "activityId"
        case scenarioName = "scenarioName"
        case friendlyName = "friendlyName"
        case state = "state"
        case stateDescription = "stateDescription"
        case tasks = "tasks"
        case errors = "errors"
        case startTime = "startTime"
        case endTime = "endTime"
        case allowedActions = "allowedActions"
        case targetObjectId = "targetObjectId"
        case targetObjectName = "targetObjectName"
        case targetInstanceType = "targetInstanceType"
        case customDetails = "customDetails"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.activityId) {
        self.activityId = try container.decode(String?.self, forKey: .activityId)
    }
    if container.contains(.scenarioName) {
        self.scenarioName = try container.decode(String?.self, forKey: .scenarioName)
    }
    if container.contains(.friendlyName) {
        self.friendlyName = try container.decode(String?.self, forKey: .friendlyName)
    }
    if container.contains(.state) {
        self.state = try container.decode(String?.self, forKey: .state)
    }
    if container.contains(.stateDescription) {
        self.stateDescription = try container.decode(String?.self, forKey: .stateDescription)
    }
    if container.contains(.tasks) {
        self.tasks = try container.decode([ASRTaskData?]?.self, forKey: .tasks)
    }
    if container.contains(.errors) {
        self.errors = try container.decode([JobErrorDetailsData?]?.self, forKey: .errors)
    }
    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(.allowedActions) {
        self.allowedActions = try container.decode([String]?.self, forKey: .allowedActions)
    }
    if container.contains(.targetObjectId) {
        self.targetObjectId = try container.decode(String?.self, forKey: .targetObjectId)
    }
    if container.contains(.targetObjectName) {
        self.targetObjectName = try container.decode(String?.self, forKey: .targetObjectName)
    }
    if container.contains(.targetInstanceType) {
        self.targetInstanceType = try container.decode(String?.self, forKey: .targetInstanceType)
    }
    if container.contains(.customDetails) {
        self.customDetails = try container.decode(JobDetailsData?.self, forKey: .customDetails)
    }
    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.activityId != nil {try container.encode(self.activityId, forKey: .activityId)}
    if self.scenarioName != nil {try container.encode(self.scenarioName, forKey: .scenarioName)}
    if self.friendlyName != nil {try container.encode(self.friendlyName, forKey: .friendlyName)}
    if self.state != nil {try container.encode(self.state, forKey: .state)}
    if self.stateDescription != nil {try container.encode(self.stateDescription, forKey: .stateDescription)}
    if self.tasks != nil {try container.encode(self.tasks as! [ASRTaskData?]?, forKey: .tasks)}
    if self.errors != nil {try container.encode(self.errors as! [JobErrorDetailsData?]?, forKey: .errors)}
    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.allowedActions != nil {try container.encode(self.allowedActions as! [String]?, forKey: .allowedActions)}
    if self.targetObjectId != nil {try container.encode(self.targetObjectId, forKey: .targetObjectId)}
    if self.targetObjectName != nil {try container.encode(self.targetObjectName, forKey: .targetObjectName)}
    if self.targetInstanceType != nil {try container.encode(self.targetInstanceType, forKey: .targetInstanceType)}
    if self.customDetails != nil {try container.encode(self.customDetails as! JobDetailsData?, forKey: .customDetails)}
  }
}

extension DataFactory {
  public static func createJobPropertiesProtocol() -> JobPropertiesProtocol {
    return JobPropertiesData()
  }
}


// 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 JobQueryParameterData : JobQueryParameterProtocol {
    public var startTime: String?
    public var endTime: String?
    public var fabricId: String?
    public var affectedObjectTypes: [String]?
    public var jobStatus: [String]?

        enum CodingKeys: String, CodingKey {case startTime = "startTime"
        case endTime = "endTime"
        case fabricId = "fabricId"
        case affectedObjectTypes = "affectedObjectTypes"
        case jobStatus = "jobStatus"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createJobQueryParameterProtocol() -> JobQueryParameterProtocol {
    return JobQueryParameterData()
  }
}


// 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 JobStatusEventDetailsData : JobStatusEventDetailsProtocol, EventSpecificDetailsProtocol {
    public var jobId: String?
    public var jobFriendlyName: String?
    public var jobStatus: String?
    public var affectedObjectType: String?

        enum CodingKeys: String, CodingKey {case jobId = "jobId"
        case jobFriendlyName = "jobFriendlyName"
        case jobStatus = "jobStatus"
        case affectedObjectType = "affectedObjectType"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createJobStatusEventDetailsProtocol() -> JobStatusEventDetailsProtocol {
    return JobStatusEventDetailsData()
  }
}


// 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 JobTaskDetailsData : JobTaskDetailsProtocol, TaskTypeDetailsProtocol {
    public var jobTask: JobEntityProtocol?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createJobTaskDetailsProtocol() -> JobTaskDetailsProtocol {
    return JobTaskDetailsData()
  }
}


// LicenseType enumerates the values for license type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum LicenseTypeEnum: String, Codable
{
// LicenseTypeNoLicenseType specifies the license type no license type state for license type.
    case LicenseTypeNoLicenseType = "NoLicenseType"
// LicenseTypeNotSpecified specifies the license type not specified state for license type.
    case LicenseTypeNotSpecified = "NotSpecified"
// LicenseTypeWindowsServer specifies the license type windows server state for license type.
    case LicenseTypeWindowsServer = "WindowsServer"
}


// 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 LogicalNetworkCollectionData : LogicalNetworkCollectionProtocol {
    public var value: [LogicalNetworkProtocol?]?
    public var _nextLink: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createLogicalNetworkCollectionProtocol() -> LogicalNetworkCollectionProtocol {
    return LogicalNetworkCollectionData()
  }
}


// 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 LogicalNetworkData : LogicalNetworkProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var properties: LogicalNetworkPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createLogicalNetworkProtocol() -> LogicalNetworkProtocol {
    return LogicalNetworkData()
  }
}


// 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 LogicalNetworkPropertiesData : LogicalNetworkPropertiesProtocol {
    public var friendlyName: String?
    public var networkVirtualizationStatus: String?
    public var logicalNetworkUsage: String?
    public var logicalNetworkDefinitionsStatus: String?

        enum CodingKeys: String, CodingKey {case friendlyName = "friendlyName"
        case networkVirtualizationStatus = "networkVirtualizationStatus"
        case logicalNetworkUsage = "logicalNetworkUsage"
        case logicalNetworkDefinitionsStatus = "logicalNetworkDefinitionsStatus"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createLogicalNetworkPropertiesProtocol() -> LogicalNetworkPropertiesProtocol {
    return LogicalNetworkPropertiesData()
  }
}


// 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 ManualActionTaskDetailsData : ManualActionTaskDetailsProtocol, TaskTypeDetailsProtocol {
    public var name: String?
    public var instructions: String?
    public var observation: String?

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

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

extension DataFactory {
  public static func createManualActionTaskDetailsProtocol() -> ManualActionTaskDetailsProtocol {
    return ManualActionTaskDetailsData()
  }
}


// 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 MasterTargetServerData : MasterTargetServerProtocol {
    public var id: String?
    public var ipAddress: String?
    public var name: String?
    public var osType: String?
    public var agentVersion: String?
    public var lastHeartbeat: Date?
    public var versionStatus: String?
    public var retentionVolumes: [RetentionVolumeProtocol?]?
    public var dataStores: [DataStoreProtocol?]?
    public var validationErrors: [HealthErrorProtocol?]?
    public var healthErrors: [HealthErrorProtocol?]?
    public var diskCount: Int32?
    public var osVersion: String?
    public var agentExpiryDate: Date?
    public var marsAgentVersion: String?
    public var marsAgentExpiryDate: Date?
    public var agentVersionDetails: VersionDetailsProtocol?
    public var marsAgentVersionDetails: VersionDetailsProtocol?

        enum CodingKeys: String, CodingKey {case id = "id"
        case ipAddress = "ipAddress"
        case name = "name"
        case osType = "osType"
        case agentVersion = "agentVersion"
        case lastHeartbeat = "lastHeartbeat"
        case versionStatus = "versionStatus"
        case retentionVolumes = "retentionVolumes"
        case dataStores = "dataStores"
        case validationErrors = "validationErrors"
        case healthErrors = "healthErrors"
        case diskCount = "diskCount"
        case osVersion = "osVersion"
        case agentExpiryDate = "agentExpiryDate"
        case marsAgentVersion = "marsAgentVersion"
        case marsAgentExpiryDate = "marsAgentExpiryDate"
        case agentVersionDetails = "agentVersionDetails"
        case marsAgentVersionDetails = "marsAgentVersionDetails"
        }

  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(.ipAddress) {
        self.ipAddress = try container.decode(String?.self, forKey: .ipAddress)
    }
    if container.contains(.name) {
        self.name = try container.decode(String?.self, forKey: .name)
    }
    if container.contains(.osType) {
        self.osType = try container.decode(String?.self, forKey: .osType)
    }
    if container.contains(.agentVersion) {
        self.agentVersion = try container.decode(String?.self, forKey: .agentVersion)
    }
    if container.contains(.lastHeartbeat) {
        self.lastHeartbeat = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastHeartbeat)), format: .dateTime)
    }
    if container.contains(.versionStatus) {
        self.versionStatus = try container.decode(String?.self, forKey: .versionStatus)
    }
    if container.contains(.retentionVolumes) {
        self.retentionVolumes = try container.decode([RetentionVolumeData?]?.self, forKey: .retentionVolumes)
    }
    if container.contains(.dataStores) {
        self.dataStores = try container.decode([DataStoreData?]?.self, forKey: .dataStores)
    }
    if container.contains(.validationErrors) {
        self.validationErrors = try container.decode([HealthErrorData?]?.self, forKey: .validationErrors)
    }
    if container.contains(.healthErrors) {
        self.healthErrors = try container.decode([HealthErrorData?]?.self, forKey: .healthErrors)
    }
    if container.contains(.diskCount) {
        self.diskCount = try container.decode(Int32?.self, forKey: .diskCount)
    }
    if container.contains(.osVersion) {
        self.osVersion = try container.decode(String?.self, forKey: .osVersion)
    }
    if container.contains(.agentExpiryDate) {
        self.agentExpiryDate = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .agentExpiryDate)), format: .dateTime)
    }
    if container.contains(.marsAgentVersion) {
        self.marsAgentVersion = try container.decode(String?.self, forKey: .marsAgentVersion)
    }
    if container.contains(.marsAgentExpiryDate) {
        self.marsAgentExpiryDate = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .marsAgentExpiryDate)), format: .dateTime)
    }
    if container.contains(.agentVersionDetails) {
        self.agentVersionDetails = try container.decode(VersionDetailsData?.self, forKey: .agentVersionDetails)
    }
    if container.contains(.marsAgentVersionDetails) {
        self.marsAgentVersionDetails = try container.decode(VersionDetailsData?.self, forKey: .marsAgentVersionDetails)
    }
    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.ipAddress != nil {try container.encode(self.ipAddress, forKey: .ipAddress)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.osType != nil {try container.encode(self.osType, forKey: .osType)}
    if self.agentVersion != nil {try container.encode(self.agentVersion, forKey: .agentVersion)}
    if self.lastHeartbeat != nil {
        try container.encode(DateConverter.toString(date: self.lastHeartbeat!, format: .dateTime), forKey: .lastHeartbeat)
    }
    if self.versionStatus != nil {try container.encode(self.versionStatus, forKey: .versionStatus)}
    if self.retentionVolumes != nil {try container.encode(self.retentionVolumes as! [RetentionVolumeData?]?, forKey: .retentionVolumes)}
    if self.dataStores != nil {try container.encode(self.dataStores as! [DataStoreData?]?, forKey: .dataStores)}
    if self.validationErrors != nil {try container.encode(self.validationErrors as! [HealthErrorData?]?, forKey: .validationErrors)}
    if self.healthErrors != nil {try container.encode(self.healthErrors as! [HealthErrorData?]?, forKey: .healthErrors)}
    if self.diskCount != nil {try container.encode(self.diskCount, forKey: .diskCount)}
    if self.osVersion != nil {try container.encode(self.osVersion, forKey: .osVersion)}
    if self.agentExpiryDate != nil {
        try container.encode(DateConverter.toString(date: self.agentExpiryDate!, format: .dateTime), forKey: .agentExpiryDate)
    }
    if self.marsAgentVersion != nil {try container.encode(self.marsAgentVersion, forKey: .marsAgentVersion)}
    if self.marsAgentExpiryDate != nil {
        try container.encode(DateConverter.toString(date: self.marsAgentExpiryDate!, format: .dateTime), forKey: .marsAgentExpiryDate)
    }
    if self.agentVersionDetails != nil {try container.encode(self.agentVersionDetails as! VersionDetailsData?, forKey: .agentVersionDetails)}
    if self.marsAgentVersionDetails != nil {try container.encode(self.marsAgentVersionDetails as! VersionDetailsData?, forKey: .marsAgentVersionDetails)}
  }
}

extension DataFactory {
  public static func createMasterTargetServerProtocol() -> MasterTargetServerProtocol {
    return MasterTargetServerData()
  }
}


// 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 MobilityServiceUpdateData : MobilityServiceUpdateProtocol {
    public var version: String?
    public var rebootStatus: String?
    public var osType: String?

        enum CodingKeys: String, CodingKey {case version = "version"
        case rebootStatus = "rebootStatus"
        case osType = "osType"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createMobilityServiceUpdateProtocol() -> MobilityServiceUpdateProtocol {
    return MobilityServiceUpdateData()
  }
}


// MultiVmGroupCreateOption enumerates the values for multi vm group create option.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum MultiVmGroupCreateOptionEnum: String, Codable
{
// AutoCreated specifies the auto created state for multi vm group create option.
    case AutoCreated = "AutoCreated"
// UserSpecified specifies the user specified state for multi vm group create option.
    case UserSpecified = "UserSpecified"
}


// MultiVmSyncPointOption enumerates the values for multi vm sync point option.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum MultiVmSyncPointOptionEnum: String, Codable
{
// UseMultiVmSyncRecoveryPoint specifies the use multi vm sync recovery point state for multi vm sync point option.
    case UseMultiVmSyncRecoveryPoint = "UseMultiVmSyncRecoveryPoint"
// UsePerVmRecoveryPoint specifies the use per vm recovery point state for multi vm sync point option.
    case UsePerVmRecoveryPoint = "UsePerVmRecoveryPoint"
}


// MultiVmSyncStatus enumerates the values for multi vm sync status.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum MultiVmSyncStatusEnum: String, Codable
{
// Disabled specifies the disabled state for multi vm sync status.
    case Disabled = "Disabled"
// Enabled specifies the enabled state for multi vm sync status.
    case Enabled = "Enabled"
}


// 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 NetworkCollectionData : NetworkCollectionProtocol {
    public var value: [NetworkProtocol?]?
    public var _nextLink: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createNetworkCollectionProtocol() -> NetworkCollectionProtocol {
    return NetworkCollectionData()
  }
}


// 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 NetworkData : NetworkProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var properties: NetworkPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createNetworkProtocol() -> NetworkProtocol {
    return NetworkData()
  }
}


// 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 NetworkMappingCollectionData : NetworkMappingCollectionProtocol {
    public var value: [NetworkMappingProtocol?]?
    public var _nextLink: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createNetworkMappingCollectionProtocol() -> NetworkMappingCollectionProtocol {
    return NetworkMappingCollectionData()
  }
}


// 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 NetworkMappingData : NetworkMappingProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var properties: NetworkMappingPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createNetworkMappingProtocol() -> NetworkMappingProtocol {
    return NetworkMappingData()
  }
}


// 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 NetworkMappingFabricSpecificSettingsData : NetworkMappingFabricSpecificSettingsProtocol {

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    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 {
  }
}

extension DataFactory {
  public static func createNetworkMappingFabricSpecificSettingsProtocol() -> NetworkMappingFabricSpecificSettingsProtocol {
    return NetworkMappingFabricSpecificSettingsData()
  }
}


// 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 NetworkMappingPropertiesData : NetworkMappingPropertiesProtocol {
    public var state: String?
    public var primaryNetworkFriendlyName: String?
    public var primaryNetworkId: String?
    public var primaryFabricFriendlyName: String?
    public var recoveryNetworkFriendlyName: String?
    public var recoveryNetworkId: String?
    public var recoveryFabricArmId: String?
    public var recoveryFabricFriendlyName: String?
    public var fabricSpecificSettings: NetworkMappingFabricSpecificSettingsProtocol?

        enum CodingKeys: String, CodingKey {case state = "state"
        case primaryNetworkFriendlyName = "primaryNetworkFriendlyName"
        case primaryNetworkId = "primaryNetworkId"
        case primaryFabricFriendlyName = "primaryFabricFriendlyName"
        case recoveryNetworkFriendlyName = "recoveryNetworkFriendlyName"
        case recoveryNetworkId = "recoveryNetworkId"
        case recoveryFabricArmId = "recoveryFabricArmId"
        case recoveryFabricFriendlyName = "recoveryFabricFriendlyName"
        case fabricSpecificSettings = "fabricSpecificSettings"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.state) {
        self.state = try container.decode(String?.self, forKey: .state)
    }
    if container.contains(.primaryNetworkFriendlyName) {
        self.primaryNetworkFriendlyName = try container.decode(String?.self, forKey: .primaryNetworkFriendlyName)
    }
    if container.contains(.primaryNetworkId) {
        self.primaryNetworkId = try container.decode(String?.self, forKey: .primaryNetworkId)
    }
    if container.contains(.primaryFabricFriendlyName) {
        self.primaryFabricFriendlyName = try container.decode(String?.self, forKey: .primaryFabricFriendlyName)
    }
    if container.contains(.recoveryNetworkFriendlyName) {
        self.recoveryNetworkFriendlyName = try container.decode(String?.self, forKey: .recoveryNetworkFriendlyName)
    }
    if container.contains(.recoveryNetworkId) {
        self.recoveryNetworkId = try container.decode(String?.self, forKey: .recoveryNetworkId)
    }
    if container.contains(.recoveryFabricArmId) {
        self.recoveryFabricArmId = try container.decode(String?.self, forKey: .recoveryFabricArmId)
    }
    if container.contains(.recoveryFabricFriendlyName) {
        self.recoveryFabricFriendlyName = try container.decode(String?.self, forKey: .recoveryFabricFriendlyName)
    }
    if container.contains(.fabricSpecificSettings) {
        self.fabricSpecificSettings = try container.decode(NetworkMappingFabricSpecificSettingsData?.self, forKey: .fabricSpecificSettings)
    }
    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.state != nil {try container.encode(self.state, forKey: .state)}
    if self.primaryNetworkFriendlyName != nil {try container.encode(self.primaryNetworkFriendlyName, forKey: .primaryNetworkFriendlyName)}
    if self.primaryNetworkId != nil {try container.encode(self.primaryNetworkId, forKey: .primaryNetworkId)}
    if self.primaryFabricFriendlyName != nil {try container.encode(self.primaryFabricFriendlyName, forKey: .primaryFabricFriendlyName)}
    if self.recoveryNetworkFriendlyName != nil {try container.encode(self.recoveryNetworkFriendlyName, forKey: .recoveryNetworkFriendlyName)}
    if self.recoveryNetworkId != nil {try container.encode(self.recoveryNetworkId, forKey: .recoveryNetworkId)}
    if self.recoveryFabricArmId != nil {try container.encode(self.recoveryFabricArmId, forKey: .recoveryFabricArmId)}
    if self.recoveryFabricFriendlyName != nil {try container.encode(self.recoveryFabricFriendlyName, forKey: .recoveryFabricFriendlyName)}
    if self.fabricSpecificSettings != nil {try container.encode(self.fabricSpecificSettings as! NetworkMappingFabricSpecificSettingsData?, forKey: .fabricSpecificSettings)}
  }
}

extension DataFactory {
  public static func createNetworkMappingPropertiesProtocol() -> NetworkMappingPropertiesProtocol {
    return NetworkMappingPropertiesData()
  }
}


// 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 NetworkPropertiesData : NetworkPropertiesProtocol {
    public var fabricType: String?
    public var subnets: [SubnetProtocol?]?
    public var friendlyName: String?
    public var networkType: String?

        enum CodingKeys: String, CodingKey {case fabricType = "fabricType"
        case subnets = "subnets"
        case friendlyName = "friendlyName"
        case networkType = "networkType"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createNetworkPropertiesProtocol() -> NetworkPropertiesProtocol {
    return NetworkPropertiesData()
  }
}


// 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 OperationsDiscoveryCollectionData : OperationsDiscoveryCollectionProtocol {
    public var value: [OperationsDiscoveryProtocol?]?
    public var _nextLink: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createOperationsDiscoveryCollectionProtocol() -> OperationsDiscoveryCollectionProtocol {
    return OperationsDiscoveryCollectionData()
  }
}


// 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 OperationsDiscoveryData : OperationsDiscoveryProtocol {
    public var name: String?
    public var display: DisplayProtocol?
    public var origin: String?
    public var properties: [String: String?]?

        enum CodingKeys: String, CodingKey {case name = "name"
        case display = "display"
        case origin = "origin"
        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(.display) {
        self.display = try container.decode(DisplayData?.self, forKey: .display)
    }
    if container.contains(.origin) {
        self.origin = try container.decode(String?.self, forKey: .origin)
    }
    if container.contains(.properties) {
        self.properties = try container.decode([String: String?]?.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.display != nil {try container.encode(self.display as! DisplayData?, forKey: .display)}
    if self.origin != nil {try container.encode(self.origin, forKey: .origin)}
    if self.properties != nil {try container.encode(self.properties, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createOperationsDiscoveryProtocol() -> OperationsDiscoveryProtocol {
    return OperationsDiscoveryData()
  }
}


// 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 OSDetailsData : OSDetailsProtocol {
    public var osType: String?
    public var productType: String?
    public var osEdition: String?
    public var oSVersion: String?
    public var oSMajorVersion: String?
    public var oSMinorVersion: String?

        enum CodingKeys: String, CodingKey {case osType = "osType"
        case productType = "productType"
        case osEdition = "osEdition"
        case oSVersion = "oSVersion"
        case oSMajorVersion = "oSMajorVersion"
        case oSMinorVersion = "oSMinorVersion"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createOSDetailsProtocol() -> OSDetailsProtocol {
    return OSDetailsData()
  }
}


// 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 OSDiskDetailsData : OSDiskDetailsProtocol {
    public var osVhdId: String?
    public var osType: String?
    public var vhdName: String?

        enum CodingKeys: String, CodingKey {case osVhdId = "osVhdId"
        case osType = "osType"
        case vhdName = "vhdName"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createOSDiskDetailsProtocol() -> OSDiskDetailsProtocol {
    return OSDiskDetailsData()
  }
}


// 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 PlannedFailoverInputData : PlannedFailoverInputProtocol {
    public var properties: PlannedFailoverInputPropertiesProtocol?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createPlannedFailoverInputProtocol() -> PlannedFailoverInputProtocol {
    return PlannedFailoverInputData()
  }
}


// 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 PlannedFailoverInputPropertiesData : PlannedFailoverInputPropertiesProtocol {
    public var failoverDirection: String?
    public var providerSpecificDetails: ProviderSpecificFailoverInputProtocol?

        enum CodingKeys: String, CodingKey {case failoverDirection = "failoverDirection"
        case providerSpecificDetails = "providerSpecificDetails"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createPlannedFailoverInputPropertiesProtocol() -> PlannedFailoverInputPropertiesProtocol {
    return PlannedFailoverInputPropertiesData()
  }
}


// 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 PolicyCollectionData : PolicyCollectionProtocol {
    public var value: [PolicyProtocol?]?
    public var _nextLink: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createPolicyCollectionProtocol() -> PolicyCollectionProtocol {
    return PolicyCollectionData()
  }
}


// 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 PolicyData : PolicyProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var properties: PolicyPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createPolicyProtocol() -> PolicyProtocol {
    return PolicyData()
  }
}


// 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 PolicyPropertiesData : PolicyPropertiesProtocol {
    public var friendlyName: String?
    public var providerSpecificDetails: PolicyProviderSpecificDetailsProtocol?

        enum CodingKeys: String, CodingKey {case friendlyName = "friendlyName"
        case providerSpecificDetails = "providerSpecificDetails"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createPolicyPropertiesProtocol() -> PolicyPropertiesProtocol {
    return PolicyPropertiesData()
  }
}


// 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 PolicyProviderSpecificDetailsData : PolicyProviderSpecificDetailsProtocol {

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    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 {
  }
}

extension DataFactory {
  public static func createPolicyProviderSpecificDetailsProtocol() -> PolicyProviderSpecificDetailsProtocol {
    return PolicyProviderSpecificDetailsData()
  }
}


// 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 PolicyProviderSpecificInputData : PolicyProviderSpecificInputProtocol {

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    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 {
  }
}

extension DataFactory {
  public static func createPolicyProviderSpecificInputProtocol() -> PolicyProviderSpecificInputProtocol {
    return PolicyProviderSpecificInputData()
  }
}


// PossibleOperationsDirections enumerates the values for possible operations directions.

// 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 PossibleOperationsDirectionsEnum: String, Codable
{
// PrimaryToRecovery specifies the primary to recovery state for possible operations directions.
    case PrimaryToRecovery = "PrimaryToRecovery"
// RecoveryToPrimary specifies the recovery to primary state for possible operations directions.
    case RecoveryToPrimary = "RecoveryToPrimary"
}


// 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 ProcessServerData : ProcessServerProtocol {
    public var friendlyName: String?
    public var id: String?
    public var ipAddress: String?
    public var osType: String?
    public var agentVersion: String?
    public var lastHeartbeat: Date?
    public var versionStatus: String?
    public var mobilityServiceUpdates: [MobilityServiceUpdateProtocol?]?
    public var hostId: String?
    public var machineCount: String?
    public var replicationPairCount: String?
    public var systemLoad: String?
    public var systemLoadStatus: String?
    public var cpuLoad: String?
    public var cpuLoadStatus: String?
    public var totalMemoryInBytes: Int64?
    public var availableMemoryInBytes: Int64?
    public var memoryUsageStatus: String?
    public var totalSpaceInBytes: Int64?
    public var availableSpaceInBytes: Int64?
    public var spaceUsageStatus: String?
    public var psServiceStatus: String?
    public var sslCertExpiryDate: Date?
    public var sslCertExpiryRemainingDays: Int32?
    public var osVersion: String?
    public var healthErrors: [HealthErrorProtocol?]?
    public var agentExpiryDate: Date?
    public var agentVersionDetails: VersionDetailsProtocol?

        enum CodingKeys: String, CodingKey {case friendlyName = "friendlyName"
        case id = "id"
        case ipAddress = "ipAddress"
        case osType = "osType"
        case agentVersion = "agentVersion"
        case lastHeartbeat = "lastHeartbeat"
        case versionStatus = "versionStatus"
        case mobilityServiceUpdates = "mobilityServiceUpdates"
        case hostId = "hostId"
        case machineCount = "machineCount"
        case replicationPairCount = "replicationPairCount"
        case systemLoad = "systemLoad"
        case systemLoadStatus = "systemLoadStatus"
        case cpuLoad = "cpuLoad"
        case cpuLoadStatus = "cpuLoadStatus"
        case totalMemoryInBytes = "totalMemoryInBytes"
        case availableMemoryInBytes = "availableMemoryInBytes"
        case memoryUsageStatus = "memoryUsageStatus"
        case totalSpaceInBytes = "totalSpaceInBytes"
        case availableSpaceInBytes = "availableSpaceInBytes"
        case spaceUsageStatus = "spaceUsageStatus"
        case psServiceStatus = "psServiceStatus"
        case sslCertExpiryDate = "sslCertExpiryDate"
        case sslCertExpiryRemainingDays = "sslCertExpiryRemainingDays"
        case osVersion = "osVersion"
        case healthErrors = "healthErrors"
        case agentExpiryDate = "agentExpiryDate"
        case agentVersionDetails = "agentVersionDetails"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.friendlyName) {
        self.friendlyName = try container.decode(String?.self, forKey: .friendlyName)
    }
    if container.contains(.id) {
        self.id = try container.decode(String?.self, forKey: .id)
    }
    if container.contains(.ipAddress) {
        self.ipAddress = try container.decode(String?.self, forKey: .ipAddress)
    }
    if container.contains(.osType) {
        self.osType = try container.decode(String?.self, forKey: .osType)
    }
    if container.contains(.agentVersion) {
        self.agentVersion = try container.decode(String?.self, forKey: .agentVersion)
    }
    if container.contains(.lastHeartbeat) {
        self.lastHeartbeat = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastHeartbeat)), format: .dateTime)
    }
    if container.contains(.versionStatus) {
        self.versionStatus = try container.decode(String?.self, forKey: .versionStatus)
    }
    if container.contains(.mobilityServiceUpdates) {
        self.mobilityServiceUpdates = try container.decode([MobilityServiceUpdateData?]?.self, forKey: .mobilityServiceUpdates)
    }
    if container.contains(.hostId) {
        self.hostId = try container.decode(String?.self, forKey: .hostId)
    }
    if container.contains(.machineCount) {
        self.machineCount = try container.decode(String?.self, forKey: .machineCount)
    }
    if container.contains(.replicationPairCount) {
        self.replicationPairCount = try container.decode(String?.self, forKey: .replicationPairCount)
    }
    if container.contains(.systemLoad) {
        self.systemLoad = try container.decode(String?.self, forKey: .systemLoad)
    }
    if container.contains(.systemLoadStatus) {
        self.systemLoadStatus = try container.decode(String?.self, forKey: .systemLoadStatus)
    }
    if container.contains(.cpuLoad) {
        self.cpuLoad = try container.decode(String?.self, forKey: .cpuLoad)
    }
    if container.contains(.cpuLoadStatus) {
        self.cpuLoadStatus = try container.decode(String?.self, forKey: .cpuLoadStatus)
    }
    if container.contains(.totalMemoryInBytes) {
        self.totalMemoryInBytes = try container.decode(Int64?.self, forKey: .totalMemoryInBytes)
    }
    if container.contains(.availableMemoryInBytes) {
        self.availableMemoryInBytes = try container.decode(Int64?.self, forKey: .availableMemoryInBytes)
    }
    if container.contains(.memoryUsageStatus) {
        self.memoryUsageStatus = try container.decode(String?.self, forKey: .memoryUsageStatus)
    }
    if container.contains(.totalSpaceInBytes) {
        self.totalSpaceInBytes = try container.decode(Int64?.self, forKey: .totalSpaceInBytes)
    }
    if container.contains(.availableSpaceInBytes) {
        self.availableSpaceInBytes = try container.decode(Int64?.self, forKey: .availableSpaceInBytes)
    }
    if container.contains(.spaceUsageStatus) {
        self.spaceUsageStatus = try container.decode(String?.self, forKey: .spaceUsageStatus)
    }
    if container.contains(.psServiceStatus) {
        self.psServiceStatus = try container.decode(String?.self, forKey: .psServiceStatus)
    }
    if container.contains(.sslCertExpiryDate) {
        self.sslCertExpiryDate = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .sslCertExpiryDate)), format: .dateTime)
    }
    if container.contains(.sslCertExpiryRemainingDays) {
        self.sslCertExpiryRemainingDays = try container.decode(Int32?.self, forKey: .sslCertExpiryRemainingDays)
    }
    if container.contains(.osVersion) {
        self.osVersion = try container.decode(String?.self, forKey: .osVersion)
    }
    if container.contains(.healthErrors) {
        self.healthErrors = try container.decode([HealthErrorData?]?.self, forKey: .healthErrors)
    }
    if container.contains(.agentExpiryDate) {
        self.agentExpiryDate = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .agentExpiryDate)), format: .dateTime)
    }
    if container.contains(.agentVersionDetails) {
        self.agentVersionDetails = try container.decode(VersionDetailsData?.self, forKey: .agentVersionDetails)
    }
    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.friendlyName != nil {try container.encode(self.friendlyName, forKey: .friendlyName)}
    if self.id != nil {try container.encode(self.id, forKey: .id)}
    if self.ipAddress != nil {try container.encode(self.ipAddress, forKey: .ipAddress)}
    if self.osType != nil {try container.encode(self.osType, forKey: .osType)}
    if self.agentVersion != nil {try container.encode(self.agentVersion, forKey: .agentVersion)}
    if self.lastHeartbeat != nil {
        try container.encode(DateConverter.toString(date: self.lastHeartbeat!, format: .dateTime), forKey: .lastHeartbeat)
    }
    if self.versionStatus != nil {try container.encode(self.versionStatus, forKey: .versionStatus)}
    if self.mobilityServiceUpdates != nil {try container.encode(self.mobilityServiceUpdates as! [MobilityServiceUpdateData?]?, forKey: .mobilityServiceUpdates)}
    if self.hostId != nil {try container.encode(self.hostId, forKey: .hostId)}
    if self.machineCount != nil {try container.encode(self.machineCount, forKey: .machineCount)}
    if self.replicationPairCount != nil {try container.encode(self.replicationPairCount, forKey: .replicationPairCount)}
    if self.systemLoad != nil {try container.encode(self.systemLoad, forKey: .systemLoad)}
    if self.systemLoadStatus != nil {try container.encode(self.systemLoadStatus, forKey: .systemLoadStatus)}
    if self.cpuLoad != nil {try container.encode(self.cpuLoad, forKey: .cpuLoad)}
    if self.cpuLoadStatus != nil {try container.encode(self.cpuLoadStatus, forKey: .cpuLoadStatus)}
    if self.totalMemoryInBytes != nil {try container.encode(self.totalMemoryInBytes, forKey: .totalMemoryInBytes)}
    if self.availableMemoryInBytes != nil {try container.encode(self.availableMemoryInBytes, forKey: .availableMemoryInBytes)}
    if self.memoryUsageStatus != nil {try container.encode(self.memoryUsageStatus, forKey: .memoryUsageStatus)}
    if self.totalSpaceInBytes != nil {try container.encode(self.totalSpaceInBytes, forKey: .totalSpaceInBytes)}
    if self.availableSpaceInBytes != nil {try container.encode(self.availableSpaceInBytes, forKey: .availableSpaceInBytes)}
    if self.spaceUsageStatus != nil {try container.encode(self.spaceUsageStatus, forKey: .spaceUsageStatus)}
    if self.psServiceStatus != nil {try container.encode(self.psServiceStatus, forKey: .psServiceStatus)}
    if self.sslCertExpiryDate != nil {
        try container.encode(DateConverter.toString(date: self.sslCertExpiryDate!, format: .dateTime), forKey: .sslCertExpiryDate)
    }
    if self.sslCertExpiryRemainingDays != nil {try container.encode(self.sslCertExpiryRemainingDays, forKey: .sslCertExpiryRemainingDays)}
    if self.osVersion != nil {try container.encode(self.osVersion, forKey: .osVersion)}
    if self.healthErrors != nil {try container.encode(self.healthErrors as! [HealthErrorData?]?, forKey: .healthErrors)}
    if self.agentExpiryDate != nil {
        try container.encode(DateConverter.toString(date: self.agentExpiryDate!, format: .dateTime), forKey: .agentExpiryDate)
    }
    if self.agentVersionDetails != nil {try container.encode(self.agentVersionDetails as! VersionDetailsData?, forKey: .agentVersionDetails)}
  }
}

extension DataFactory {
  public static func createProcessServerProtocol() -> ProcessServerProtocol {
    return ProcessServerData()
  }
}