// 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 SourceControlPropertiesData : SourceControlPropertiesProtocol {
    public var repoUrl: String?
    public var branch: String?
    public var folderPath: String?
    public var autoSync: Bool?
    public var publishRunbook: Bool?
    public var sourceType: SourceTypeEnum?
    public var description: String?
    public var creationTime: Date?
    public var lastModifiedTime: Date?

        enum CodingKeys: String, CodingKey {case repoUrl = "repoUrl"
        case branch = "branch"
        case folderPath = "folderPath"
        case autoSync = "autoSync"
        case publishRunbook = "publishRunbook"
        case sourceType = "sourceType"
        case description = "description"
        case creationTime = "creationTime"
        case lastModifiedTime = "lastModifiedTime"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.repoUrl) {
        self.repoUrl = try container.decode(String?.self, forKey: .repoUrl)
    }
    if container.contains(.branch) {
        self.branch = try container.decode(String?.self, forKey: .branch)
    }
    if container.contains(.folderPath) {
        self.folderPath = try container.decode(String?.self, forKey: .folderPath)
    }
    if container.contains(.autoSync) {
        self.autoSync = try container.decode(Bool?.self, forKey: .autoSync)
    }
    if container.contains(.publishRunbook) {
        self.publishRunbook = try container.decode(Bool?.self, forKey: .publishRunbook)
    }
    if container.contains(.sourceType) {
        self.sourceType = try container.decode(SourceTypeEnum?.self, forKey: .sourceType)
    }
    if container.contains(.description) {
        self.description = try container.decode(String?.self, forKey: .description)
    }
    if container.contains(.creationTime) {
        self.creationTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .creationTime)), format: .dateTime)
    }
    if container.contains(.lastModifiedTime) {
        self.lastModifiedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastModifiedTime)), format: .dateTime)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.repoUrl != nil {try container.encode(self.repoUrl, forKey: .repoUrl)}
    if self.branch != nil {try container.encode(self.branch, forKey: .branch)}
    if self.folderPath != nil {try container.encode(self.folderPath, forKey: .folderPath)}
    if self.autoSync != nil {try container.encode(self.autoSync, forKey: .autoSync)}
    if self.publishRunbook != nil {try container.encode(self.publishRunbook, forKey: .publishRunbook)}
    if self.sourceType != nil {try container.encode(self.sourceType, forKey: .sourceType)}
    if self.description != nil {try container.encode(self.description, forKey: .description)}
    if self.creationTime != nil {
        try container.encode(DateConverter.toString(date: self.creationTime!, format: .dateTime), forKey: .creationTime)
    }
    if self.lastModifiedTime != nil {
        try container.encode(DateConverter.toString(date: self.lastModifiedTime!, format: .dateTime), forKey: .lastModifiedTime)
    }
  }
}

extension DataFactory {
  public static func createSourceControlPropertiesProtocol() -> SourceControlPropertiesProtocol {
    return SourceControlPropertiesData()
  }
}


// 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 SourceControlSyncJobByIdData : SourceControlSyncJobByIdProtocol {
    public var id: String?
    public var properties: SourceControlSyncJobByIdPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createSourceControlSyncJobByIdProtocol() -> SourceControlSyncJobByIdProtocol {
    return SourceControlSyncJobByIdData()
  }
}


// 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 SourceControlSyncJobByIdErrorsData : SourceControlSyncJobByIdErrorsProtocol {
    public var code: String?
    public var message: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createSourceControlSyncJobByIdErrorsProtocol() -> SourceControlSyncJobByIdErrorsProtocol {
    return SourceControlSyncJobByIdErrorsData()
  }
}


// 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 SourceControlSyncJobByIdPropertiesData : SourceControlSyncJobByIdPropertiesProtocol {
    public var sourceControlSyncJobId: String?
    public var creationTime: Date?
    public var provisioningState: ProvisioningStateEnum?
    public var startTime: Date?
    public var endTime: Date?
    public var startedBy: String?
    public var errors: SourceControlSyncJobByIdErrorsProtocol?

        enum CodingKeys: String, CodingKey {case sourceControlSyncJobId = "sourceControlSyncJobId"
        case creationTime = "creationTime"
        case provisioningState = "provisioningState"
        case startTime = "startTime"
        case endTime = "endTime"
        case startedBy = "startedBy"
        case errors = "errors"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createSourceControlSyncJobByIdPropertiesProtocol() -> SourceControlSyncJobByIdPropertiesProtocol {
    return SourceControlSyncJobByIdPropertiesData()
  }
}


// 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 SourceControlSyncJobData : SourceControlSyncJobProtocol {
    public var name: String?
    public var type: String?
    public var id: String?
    public var properties: SourceControlSyncJobPropertiesProtocol?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createSourceControlSyncJobProtocol() -> SourceControlSyncJobProtocol {
    return SourceControlSyncJobData()
  }
}


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

extension DataFactory {
  public static func createSourceControlSyncJobListResultProtocol() -> SourceControlSyncJobListResultProtocol {
    return SourceControlSyncJobListResultData()
  }
}


// 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 SourceControlSyncJobPropertiesData : SourceControlSyncJobPropertiesProtocol {
    public var sourceControlSyncJobId: String?
    public var creationTime: Date?
    public var provisioningState: ProvisioningStateEnum?
    public var startTime: Date?
    public var endTime: Date?
    public var startedBy: String?

        enum CodingKeys: String, CodingKey {case sourceControlSyncJobId = "sourceControlSyncJobId"
        case creationTime = "creationTime"
        case provisioningState = "provisioningState"
        case startTime = "startTime"
        case endTime = "endTime"
        case startedBy = "startedBy"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createSourceControlSyncJobPropertiesProtocol() -> SourceControlSyncJobPropertiesProtocol {
    return SourceControlSyncJobPropertiesData()
  }
}


// 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 SourceControlUpdateParametersData : SourceControlUpdateParametersProtocol {
    public var properties: SourceControlUpdatePropertiesProtocol?

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

extension DataFactory {
  public static func createSourceControlUpdateParametersProtocol() -> SourceControlUpdateParametersProtocol {
    return SourceControlUpdateParametersData()
  }
}


// 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 SourceControlUpdatePropertiesData : SourceControlUpdatePropertiesProtocol {
    public var branch: String?
    public var folderPath: String?
    public var autoSync: Bool?
    public var publishRunbook: Bool?
    public var securityToken: String?
    public var description: String?

        enum CodingKeys: String, CodingKey {case branch = "branch"
        case folderPath = "folderPath"
        case autoSync = "autoSync"
        case publishRunbook = "publishRunbook"
        case securityToken = "securityToken"
        case description = "description"
        }

  public init()  {
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.branch != nil {try container.encode(self.branch, forKey: .branch)}
    if self.folderPath != nil {try container.encode(self.folderPath, forKey: .folderPath)}
    if self.autoSync != nil {try container.encode(self.autoSync, forKey: .autoSync)}
    if self.publishRunbook != nil {try container.encode(self.publishRunbook, forKey: .publishRunbook)}
    if self.securityToken != nil {try container.encode(self.securityToken, forKey: .securityToken)}
    if self.description != nil {try container.encode(self.description, forKey: .description)}
  }
}

extension DataFactory {
  public static func createSourceControlUpdatePropertiesProtocol() -> SourceControlUpdatePropertiesProtocol {
    return SourceControlUpdatePropertiesData()
  }
}


// SourceType enumerates the values for source 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 SourceTypeEnum: String, Codable
{
// GitHub specifies the git hub state for source type.
    case GitHub = "GitHub"
// VsoGit specifies the vso git state for source type.
    case VsoGit = "VsoGit"
// VsoTfvc specifies the vso tfvc state for source type.
    case VsoTfvc = "VsoTfvc"
}


// 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 StatisticsData : StatisticsProtocol {
    public var counterProperty: String?
    public var counterValue: Int64?
    public var startTime: Date?
    public var endTime: Date?
    public var id: String?

        enum CodingKeys: String, CodingKey {case counterProperty = "counterProperty"
        case counterValue = "counterValue"
        case startTime = "startTime"
        case endTime = "endTime"
        case id = "id"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.counterProperty) {
        self.counterProperty = try container.decode(String?.self, forKey: .counterProperty)
    }
    if container.contains(.counterValue) {
        self.counterValue = try container.decode(Int64?.self, forKey: .counterValue)
    }
    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(.id) {
        self.id = try container.decode(String?.self, forKey: .id)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.counterProperty != nil {try container.encode(self.counterProperty, forKey: .counterProperty)}
    if self.counterValue != nil {try container.encode(self.counterValue, forKey: .counterValue)}
    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.id != nil {try container.encode(self.id, forKey: .id)}
  }
}

extension DataFactory {
  public static func createStatisticsProtocol() -> StatisticsProtocol {
    return StatisticsData()
  }
}


// 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 StatisticsListResultData : StatisticsListResultProtocol {
    public var value: [StatisticsProtocol?]?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createStatisticsListResultProtocol() -> StatisticsListResultProtocol {
    return StatisticsListResultData()
  }
}


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

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

  public init()  {
  }

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

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

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


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

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

  public init()  {
  }

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

extension DataFactory {
  public static func createTestJobCreateParametersProtocol() -> TestJobCreateParametersProtocol {
    return TestJobCreateParametersData()
  }
}


// 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 TestJobData : TestJobProtocol {
    public var creationTime: Date?
    public var status: String?
    public var statusDetails: String?
    public var runOn: String?
    public var startTime: Date?
    public var endTime: Date?
    public var exception: String?
    public var lastModifiedTime: Date?
    public var lastStatusModifiedTime: Date?
    public var parameters: [String:String]?
    public var logActivityTrace: Int32?

        enum CodingKeys: String, CodingKey {case creationTime = "creationTime"
        case status = "status"
        case statusDetails = "statusDetails"
        case runOn = "runOn"
        case startTime = "startTime"
        case endTime = "endTime"
        case exception = "exception"
        case lastModifiedTime = "lastModifiedTime"
        case lastStatusModifiedTime = "lastStatusModifiedTime"
        case parameters = "parameters"
        case logActivityTrace = "logActivityTrace"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.creationTime) {
        self.creationTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .creationTime)), format: .dateTime)
    }
    if container.contains(.status) {
        self.status = try container.decode(String?.self, forKey: .status)
    }
    if container.contains(.statusDetails) {
        self.statusDetails = try container.decode(String?.self, forKey: .statusDetails)
    }
    if container.contains(.runOn) {
        self.runOn = try container.decode(String?.self, forKey: .runOn)
    }
    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(.exception) {
        self.exception = try container.decode(String?.self, forKey: .exception)
    }
    if container.contains(.lastModifiedTime) {
        self.lastModifiedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastModifiedTime)), format: .dateTime)
    }
    if container.contains(.lastStatusModifiedTime) {
        self.lastStatusModifiedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastStatusModifiedTime)), format: .dateTime)
    }
    if container.contains(.parameters) {
        self.parameters = try container.decode([String:String]?.self, forKey: .parameters)
    }
    if container.contains(.logActivityTrace) {
        self.logActivityTrace = try container.decode(Int32?.self, forKey: .logActivityTrace)
    }
    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.creationTime != nil {
        try container.encode(DateConverter.toString(date: self.creationTime!, format: .dateTime), forKey: .creationTime)
    }
    if self.status != nil {try container.encode(self.status, forKey: .status)}
    if self.statusDetails != nil {try container.encode(self.statusDetails, forKey: .statusDetails)}
    if self.runOn != nil {try container.encode(self.runOn, forKey: .runOn)}
    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.exception != nil {try container.encode(self.exception, forKey: .exception)}
    if self.lastModifiedTime != nil {
        try container.encode(DateConverter.toString(date: self.lastModifiedTime!, format: .dateTime), forKey: .lastModifiedTime)
    }
    if self.lastStatusModifiedTime != nil {
        try container.encode(DateConverter.toString(date: self.lastStatusModifiedTime!, format: .dateTime), forKey: .lastStatusModifiedTime)
    }
    if self.parameters != nil {try container.encode(self.parameters, forKey: .parameters)}
    if self.logActivityTrace != nil {try container.encode(self.logActivityTrace, forKey: .logActivityTrace)}
  }
}

extension DataFactory {
  public static func createTestJobProtocol() -> TestJobProtocol {
    return TestJobData()
  }
}


// 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 TypeFieldData : TypeFieldProtocol {
    public var name: String?
    public var type: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createTypeFieldProtocol() -> TypeFieldProtocol {
    return TypeFieldData()
  }
}


// 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 TypeFieldListResultData : TypeFieldListResultProtocol {
    public var value: [TypeFieldProtocol?]?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createTypeFieldListResultProtocol() -> TypeFieldListResultProtocol {
    return TypeFieldListResultData()
  }
}


// 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 UpdateConfigurationData : UpdateConfigurationProtocol {
    public var operatingSystem: OperatingSystemTypeEnum
    public var windows: WindowsPropertiesProtocol?
    public var linux: LinuxPropertiesProtocol?
    public var duration: String?
    public var azureVirtualMachines: [String]?
    public var nonAzureComputerNames: [String]?

        enum CodingKeys: String, CodingKey {case operatingSystem = "operatingSystem"
        case windows = "windows"
        case linux = "linux"
        case duration = "duration"
        case azureVirtualMachines = "azureVirtualMachines"
        case nonAzureComputerNames = "nonAzureComputerNames"
        }

  public init(operatingSystem: OperatingSystemTypeEnum)  {
    self.operatingSystem = operatingSystem
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.operatingSystem = try container.decode(OperatingSystemTypeEnum.self, forKey: .operatingSystem)
    if container.contains(.windows) {
        self.windows = try container.decode(WindowsPropertiesData?.self, forKey: .windows)
    }
    if container.contains(.linux) {
        self.linux = try container.decode(LinuxPropertiesData?.self, forKey: .linux)
    }
    if container.contains(.duration) {
        self.duration = try container.decode(String?.self, forKey: .duration)
    }
    if container.contains(.azureVirtualMachines) {
        self.azureVirtualMachines = try container.decode([String]?.self, forKey: .azureVirtualMachines)
    }
    if container.contains(.nonAzureComputerNames) {
        self.nonAzureComputerNames = try container.decode([String]?.self, forKey: .nonAzureComputerNames)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.operatingSystem, forKey: .operatingSystem)
    if self.windows != nil {try container.encode(self.windows as! WindowsPropertiesData?, forKey: .windows)}
    if self.linux != nil {try container.encode(self.linux as! LinuxPropertiesData?, forKey: .linux)}
    if self.duration != nil {try container.encode(self.duration, forKey: .duration)}
    if self.azureVirtualMachines != nil {try container.encode(self.azureVirtualMachines as! [String]?, forKey: .azureVirtualMachines)}
    if self.nonAzureComputerNames != nil {try container.encode(self.nonAzureComputerNames as! [String]?, forKey: .nonAzureComputerNames)}
  }
}

extension DataFactory {
  public static func createUpdateConfigurationProtocol(operatingSystem: OperatingSystemTypeEnum) -> UpdateConfigurationProtocol {
    return UpdateConfigurationData(operatingSystem: operatingSystem)
  }
}


// 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 UpdateConfigurationMachineRunPropertiesData : UpdateConfigurationMachineRunPropertiesProtocol {
    public var targetComputer: String?
    public var targetComputerType: String?
    public var softwareUpdateConfiguration: UpdateConfigurationNavigationProtocol?
    public var status: String?
    public var osType: String?
    public var correlationId: String?
    public var sourceComputerId: String?
    public var startTime: Date?
    public var endTime: Date?
    public var configuredDuration: String?
    public var job: JobNavigationProtocol?
    public var creationTime: Date?
    public var createdBy: String?
    public var lastModifiedTime: Date?
    public var lastModifiedBy: String?

        enum CodingKeys: String, CodingKey {case targetComputer = "targetComputer"
        case targetComputerType = "targetComputerType"
        case softwareUpdateConfiguration = "softwareUpdateConfiguration"
        case status = "status"
        case osType = "osType"
        case correlationId = "correlationId"
        case sourceComputerId = "sourceComputerId"
        case startTime = "startTime"
        case endTime = "endTime"
        case configuredDuration = "configuredDuration"
        case job = "job"
        case creationTime = "creationTime"
        case createdBy = "createdBy"
        case lastModifiedTime = "lastModifiedTime"
        case lastModifiedBy = "lastModifiedBy"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.targetComputer) {
        self.targetComputer = try container.decode(String?.self, forKey: .targetComputer)
    }
    if container.contains(.targetComputerType) {
        self.targetComputerType = try container.decode(String?.self, forKey: .targetComputerType)
    }
    if container.contains(.softwareUpdateConfiguration) {
        self.softwareUpdateConfiguration = try container.decode(UpdateConfigurationNavigationData?.self, forKey: .softwareUpdateConfiguration)
    }
    if container.contains(.status) {
        self.status = try container.decode(String?.self, forKey: .status)
    }
    if container.contains(.osType) {
        self.osType = try container.decode(String?.self, forKey: .osType)
    }
    if container.contains(.correlationId) {
        self.correlationId = try container.decode(String?.self, forKey: .correlationId)
    }
    if container.contains(.sourceComputerId) {
        self.sourceComputerId = try container.decode(String?.self, forKey: .sourceComputerId)
    }
    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(.configuredDuration) {
        self.configuredDuration = try container.decode(String?.self, forKey: .configuredDuration)
    }
    if container.contains(.job) {
        self.job = try container.decode(JobNavigationData?.self, forKey: .job)
    }
    if container.contains(.creationTime) {
        self.creationTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .creationTime)), format: .dateTime)
    }
    if container.contains(.createdBy) {
        self.createdBy = try container.decode(String?.self, forKey: .createdBy)
    }
    if container.contains(.lastModifiedTime) {
        self.lastModifiedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastModifiedTime)), format: .dateTime)
    }
    if container.contains(.lastModifiedBy) {
        self.lastModifiedBy = try container.decode(String?.self, forKey: .lastModifiedBy)
    }
    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.targetComputer != nil {try container.encode(self.targetComputer, forKey: .targetComputer)}
    if self.targetComputerType != nil {try container.encode(self.targetComputerType, forKey: .targetComputerType)}
    if self.softwareUpdateConfiguration != nil {try container.encode(self.softwareUpdateConfiguration as! UpdateConfigurationNavigationData?, forKey: .softwareUpdateConfiguration)}
    if self.status != nil {try container.encode(self.status, forKey: .status)}
    if self.osType != nil {try container.encode(self.osType, forKey: .osType)}
    if self.correlationId != nil {try container.encode(self.correlationId, forKey: .correlationId)}
    if self.sourceComputerId != nil {try container.encode(self.sourceComputerId, forKey: .sourceComputerId)}
    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.configuredDuration != nil {try container.encode(self.configuredDuration, forKey: .configuredDuration)}
    if self.job != nil {try container.encode(self.job as! JobNavigationData?, forKey: .job)}
    if self.creationTime != nil {
        try container.encode(DateConverter.toString(date: self.creationTime!, format: .dateTime), forKey: .creationTime)
    }
    if self.createdBy != nil {try container.encode(self.createdBy, forKey: .createdBy)}
    if self.lastModifiedTime != nil {
        try container.encode(DateConverter.toString(date: self.lastModifiedTime!, format: .dateTime), forKey: .lastModifiedTime)
    }
    if self.lastModifiedBy != nil {try container.encode(self.lastModifiedBy, forKey: .lastModifiedBy)}
  }
}

extension DataFactory {
  public static func createUpdateConfigurationMachineRunPropertiesProtocol() -> UpdateConfigurationMachineRunPropertiesProtocol {
    return UpdateConfigurationMachineRunPropertiesData()
  }
}


// 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 UpdateConfigurationNavigationData : UpdateConfigurationNavigationProtocol {
    public var name: String?

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

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

extension DataFactory {
  public static func createUpdateConfigurationNavigationProtocol() -> UpdateConfigurationNavigationProtocol {
    return UpdateConfigurationNavigationData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createUsageCounterNameProtocol() -> UsageCounterNameProtocol {
    return UsageCounterNameData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct UsageData : UsageProtocol {
    public var id: String?
    public var name: UsageCounterNameProtocol?
    public var unit: String?
    public var currentValue: Double?
    public var limit: Int64?
    public var throttleStatus: String?

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

  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(UsageCounterNameData?.self, forKey: .name)
    }
    if container.contains(.unit) {
        self.unit = try container.decode(String?.self, forKey: .unit)
    }
    if container.contains(.currentValue) {
        self.currentValue = try container.decode(Double?.self, forKey: .currentValue)
    }
    if container.contains(.limit) {
        self.limit = try container.decode(Int64?.self, forKey: .limit)
    }
    if container.contains(.throttleStatus) {
        self.throttleStatus = try container.decode(String?.self, forKey: .throttleStatus)
    }
    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 as! UsageCounterNameData?, forKey: .name)}
    if self.unit != nil {try container.encode(self.unit, forKey: .unit)}
    if self.currentValue != nil {try container.encode(self.currentValue, forKey: .currentValue)}
    if self.limit != nil {try container.encode(self.limit, forKey: .limit)}
    if self.throttleStatus != nil {try container.encode(self.throttleStatus, forKey: .throttleStatus)}
  }
}

extension DataFactory {
  public static func createUsageProtocol() -> UsageProtocol {
    return UsageData()
  }
}


// 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 UsageListResultData : UsageListResultProtocol {
    public var value: [UsageProtocol?]?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createUsageListResultProtocol() -> UsageListResultProtocol {
    return UsageListResultData()
  }
}


// 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 VariableCreateOrUpdateParametersData : VariableCreateOrUpdateParametersProtocol {
    public var name: String
    public var properties: VariableCreateOrUpdatePropertiesProtocol

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

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

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

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

extension DataFactory {
  public static func createVariableCreateOrUpdateParametersProtocol(name: String, properties: VariableCreateOrUpdatePropertiesProtocol) -> VariableCreateOrUpdateParametersProtocol {
    return VariableCreateOrUpdateParametersData(name: name, properties: properties)
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createVariableCreateOrUpdatePropertiesProtocol() -> VariableCreateOrUpdatePropertiesProtocol {
    return VariableCreateOrUpdatePropertiesData()
  }
}


// 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 VariableData : VariableProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: VariablePropertiesProtocol?

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

extension DataFactory {
  public static func createVariableProtocol() -> VariableProtocol {
    return VariableData()
  }
}


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

extension DataFactory {
  public static func createVariableListResultProtocol() -> VariableListResultProtocol {
    return VariableListResultData()
  }
}


// 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 VariablePropertiesData : VariablePropertiesProtocol {
    public var value: String?
    public var isEncrypted: Bool?
    public var creationTime: Date?
    public var lastModifiedTime: Date?
    public var description: String?

        enum CodingKeys: String, CodingKey {case value = "value"
        case isEncrypted = "isEncrypted"
        case creationTime = "creationTime"
        case lastModifiedTime = "lastModifiedTime"
        case description = "description"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.value) {
        self.value = try container.decode(String?.self, forKey: .value)
    }
    if container.contains(.isEncrypted) {
        self.isEncrypted = try container.decode(Bool?.self, forKey: .isEncrypted)
    }
    if container.contains(.creationTime) {
        self.creationTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .creationTime)), format: .dateTime)
    }
    if container.contains(.lastModifiedTime) {
        self.lastModifiedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastModifiedTime)), format: .dateTime)
    }
    if container.contains(.description) {
        self.description = try container.decode(String?.self, forKey: .description)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.value != nil {try container.encode(self.value, forKey: .value)}
    if self.isEncrypted != nil {try container.encode(self.isEncrypted, forKey: .isEncrypted)}
    if self.creationTime != nil {
        try container.encode(DateConverter.toString(date: self.creationTime!, format: .dateTime), forKey: .creationTime)
    }
    if self.lastModifiedTime != nil {
        try container.encode(DateConverter.toString(date: self.lastModifiedTime!, format: .dateTime), forKey: .lastModifiedTime)
    }
    if self.description != nil {try container.encode(self.description, forKey: .description)}
  }
}

extension DataFactory {
  public static func createVariablePropertiesProtocol() -> VariablePropertiesProtocol {
    return VariablePropertiesData()
  }
}


// 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 VariableUpdateParametersData : VariableUpdateParametersProtocol {
    public var name: String?
    public var properties: VariableUpdatePropertiesProtocol?

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

extension DataFactory {
  public static func createVariableUpdateParametersProtocol() -> VariableUpdateParametersProtocol {
    return VariableUpdateParametersData()
  }
}


// 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 VariableUpdatePropertiesData : VariableUpdatePropertiesProtocol {
    public var value: String?
    public var description: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createVariableUpdatePropertiesProtocol() -> VariableUpdatePropertiesProtocol {
    return VariableUpdatePropertiesData()
  }
}


// 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 WebhookCreateOrUpdateParametersData : WebhookCreateOrUpdateParametersProtocol {
    public var name: String
    public var properties: WebhookCreateOrUpdatePropertiesProtocol

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

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

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

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

extension DataFactory {
  public static func createWebhookCreateOrUpdateParametersProtocol(name: String, properties: WebhookCreateOrUpdatePropertiesProtocol) -> WebhookCreateOrUpdateParametersProtocol {
    return WebhookCreateOrUpdateParametersData(name: name, properties: properties)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct WebhookCreateOrUpdatePropertiesData : WebhookCreateOrUpdatePropertiesProtocol {
    public var isEnabled: Bool?
    public var uri: String?
    public var expiryTime: Date?
    public var parameters: [String:String]?
    public var runbook: RunbookAssociationPropertyProtocol?
    public var runOn: String?

        enum CodingKeys: String, CodingKey {case isEnabled = "isEnabled"
        case uri = "uri"
        case expiryTime = "expiryTime"
        case parameters = "parameters"
        case runbook = "runbook"
        case runOn = "runOn"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.isEnabled) {
        self.isEnabled = try container.decode(Bool?.self, forKey: .isEnabled)
    }
    if container.contains(.uri) {
        self.uri = try container.decode(String?.self, forKey: .uri)
    }
    if container.contains(.expiryTime) {
        self.expiryTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .expiryTime)), format: .dateTime)
    }
    if container.contains(.parameters) {
        self.parameters = try container.decode([String:String]?.self, forKey: .parameters)
    }
    if container.contains(.runbook) {
        self.runbook = try container.decode(RunbookAssociationPropertyData?.self, forKey: .runbook)
    }
    if container.contains(.runOn) {
        self.runOn = try container.decode(String?.self, forKey: .runOn)
    }
    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.isEnabled != nil {try container.encode(self.isEnabled, forKey: .isEnabled)}
    if self.uri != nil {try container.encode(self.uri, forKey: .uri)}
    if self.expiryTime != nil {
        try container.encode(DateConverter.toString(date: self.expiryTime!, format: .dateTime), forKey: .expiryTime)
    }
    if self.parameters != nil {try container.encode(self.parameters, forKey: .parameters)}
    if self.runbook != nil {try container.encode(self.runbook as! RunbookAssociationPropertyData?, forKey: .runbook)}
    if self.runOn != nil {try container.encode(self.runOn, forKey: .runOn)}
  }
}

extension DataFactory {
  public static func createWebhookCreateOrUpdatePropertiesProtocol() -> WebhookCreateOrUpdatePropertiesProtocol {
    return WebhookCreateOrUpdatePropertiesData()
  }
}


// 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 WebhookData : WebhookProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: WebhookPropertiesProtocol?

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

extension DataFactory {
  public static func createWebhookProtocol() -> WebhookProtocol {
    return WebhookData()
  }
}


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

extension DataFactory {
  public static func createWebhookListResultProtocol() -> WebhookListResultProtocol {
    return WebhookListResultData()
  }
}


// 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 WebhookPropertiesData : WebhookPropertiesProtocol {
    public var isEnabled: Bool?
    public var uri: String?
    public var expiryTime: Date?
    public var lastInvokedTime: Date?
    public var parameters: [String:String]?
    public var runbook: RunbookAssociationPropertyProtocol?
    public var runOn: String?
    public var creationTime: Date?
    public var lastModifiedTime: Date?
    public var description: String?

        enum CodingKeys: String, CodingKey {case isEnabled = "isEnabled"
        case uri = "uri"
        case expiryTime = "expiryTime"
        case lastInvokedTime = "lastInvokedTime"
        case parameters = "parameters"
        case runbook = "runbook"
        case runOn = "runOn"
        case creationTime = "creationTime"
        case lastModifiedTime = "lastModifiedTime"
        case description = "description"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.isEnabled) {
        self.isEnabled = try container.decode(Bool?.self, forKey: .isEnabled)
    }
    if container.contains(.uri) {
        self.uri = try container.decode(String?.self, forKey: .uri)
    }
    if container.contains(.expiryTime) {
        self.expiryTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .expiryTime)), format: .dateTime)
    }
    if container.contains(.lastInvokedTime) {
        self.lastInvokedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastInvokedTime)), format: .dateTime)
    }
    if container.contains(.parameters) {
        self.parameters = try container.decode([String:String]?.self, forKey: .parameters)
    }
    if container.contains(.runbook) {
        self.runbook = try container.decode(RunbookAssociationPropertyData?.self, forKey: .runbook)
    }
    if container.contains(.runOn) {
        self.runOn = try container.decode(String?.self, forKey: .runOn)
    }
    if container.contains(.creationTime) {
        self.creationTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .creationTime)), format: .dateTime)
    }
    if container.contains(.lastModifiedTime) {
        self.lastModifiedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastModifiedTime)), format: .dateTime)
    }
    if container.contains(.description) {
        self.description = try container.decode(String?.self, forKey: .description)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.isEnabled != nil {try container.encode(self.isEnabled, forKey: .isEnabled)}
    if self.uri != nil {try container.encode(self.uri, forKey: .uri)}
    if self.expiryTime != nil {
        try container.encode(DateConverter.toString(date: self.expiryTime!, format: .dateTime), forKey: .expiryTime)
    }
    if self.lastInvokedTime != nil {
        try container.encode(DateConverter.toString(date: self.lastInvokedTime!, format: .dateTime), forKey: .lastInvokedTime)
    }
    if self.parameters != nil {try container.encode(self.parameters, forKey: .parameters)}
    if self.runbook != nil {try container.encode(self.runbook as! RunbookAssociationPropertyData?, forKey: .runbook)}
    if self.runOn != nil {try container.encode(self.runOn, forKey: .runOn)}
    if self.creationTime != nil {
        try container.encode(DateConverter.toString(date: self.creationTime!, format: .dateTime), forKey: .creationTime)
    }
    if self.lastModifiedTime != nil {
        try container.encode(DateConverter.toString(date: self.lastModifiedTime!, format: .dateTime), forKey: .lastModifiedTime)
    }
    if self.description != nil {try container.encode(self.description, forKey: .description)}
  }
}

extension DataFactory {
  public static func createWebhookPropertiesProtocol() -> WebhookPropertiesProtocol {
    return WebhookPropertiesData()
  }
}


// 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 WebhookUpdateParametersData : WebhookUpdateParametersProtocol {
    public var name: String?
    public var properties: WebhookUpdatePropertiesProtocol?

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

extension DataFactory {
  public static func createWebhookUpdateParametersProtocol() -> WebhookUpdateParametersProtocol {
    return WebhookUpdateParametersData()
  }
}


// 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 WebhookUpdatePropertiesData : WebhookUpdatePropertiesProtocol {
    public var isEnabled: Bool?
    public var runOn: String?
    public var parameters: [String:String]?
    public var description: String?

        enum CodingKeys: String, CodingKey {case isEnabled = "isEnabled"
        case runOn = "runOn"
        case parameters = "parameters"
        case description = "description"
        }

  public init()  {
  }

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

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

extension DataFactory {
  public static func createWebhookUpdatePropertiesProtocol() -> WebhookUpdatePropertiesProtocol {
    return WebhookUpdatePropertiesData()
  }
}


// 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 WindowsPropertiesData : WindowsPropertiesProtocol {
    public var includedUpdateClassifications: WindowsUpdateClassesEnum?
    public var excludedKbNumbers: [String]?

        enum CodingKeys: String, CodingKey {case includedUpdateClassifications = "includedUpdateClassifications"
        case excludedKbNumbers = "excludedKbNumbers"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createWindowsPropertiesProtocol() -> WindowsPropertiesProtocol {
    return WindowsPropertiesData()
  }
}


// WindowsUpdateClasses enumerates the values for windows update classes.

// 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 WindowsUpdateClassesEnum: String, Codable
{
// WindowsUpdateClassesCritical specifies the windows update classes critical state for windows update classes.
    case WindowsUpdateClassesCritical = "Critical"
// WindowsUpdateClassesDefinition specifies the windows update classes definition state for windows update classes.
    case WindowsUpdateClassesDefinition = "Definition"
// WindowsUpdateClassesFeaturePack specifies the windows update classes feature pack state for windows update classes.
    case WindowsUpdateClassesFeaturePack = "FeaturePack"
// WindowsUpdateClassesSecurity specifies the windows update classes security state for windows update classes.
    case WindowsUpdateClassesSecurity = "Security"
// WindowsUpdateClassesServicePack specifies the windows update classes service pack state for windows update classes.
    case WindowsUpdateClassesServicePack = "ServicePack"
// WindowsUpdateClassesTools specifies the windows update classes tools state for windows update classes.
    case WindowsUpdateClassesTools = "Tools"
// WindowsUpdateClassesUnclassified specifies the windows update classes unclassified state for windows update classes.
    case WindowsUpdateClassesUnclassified = "Unclassified"
// WindowsUpdateClassesUpdateRollup specifies the windows update classes update rollup state for windows update
// classes.
    case WindowsUpdateClassesUpdateRollup = "UpdateRollup"
// WindowsUpdateClassesUpdates specifies the windows update classes updates state for windows update classes.
    case WindowsUpdateClassesUpdates = "Updates"
}


// 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
// ActivityListResultProtocol is the response model for the list activity operation.
public protocol ActivityListResultProtocol : Codable {
     var value: [ActivityProtocol?]? { get set }
     var _nextLink: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ActivityOutputTypeProtocol is definition of the activity output type.
public protocol ActivityOutputTypeProtocol : Codable {
     var name: String? { get set }
     var type: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ActivityParameterProtocol is definition of the activity parameter.
public protocol ActivityParameterProtocol : Codable {
     var name: String? { get set }
     var type: String? { get set }
     var isMandatory: Bool? { get set }
     var isDynamic: Bool? { get set }
     var position: Bool? { get set }
     var valueFromPipeline: Bool? { get set }
     var valueFromPipelineByPropertyName: Bool? { get set }
     var valueFromRemainingArguments: Bool? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ActivityParameterSetProtocol is definition of the activity parameter set.
public protocol ActivityParameterSetProtocol : Codable {
     var name: String? { get set }
     var parameters: [ActivityParameterProtocol?]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ActivityPropertiesProtocol is properties of the activity.
public protocol ActivityPropertiesProtocol : Codable {
     var definition: String? { get set }
     var parameterSets: [ActivityParameterSetProtocol?]? { get set }
     var outputTypes: [ActivityOutputTypeProtocol?]? { get set }
     var creationTime: Date? { get set }
     var lastModifiedTime: Date? { get set }
     var description: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ActivityProtocol is definition of the activity.
public protocol ActivityProtocol : Codable {
     var id: String? { get set }
     var name: String? { get set }
     var properties: ActivityPropertiesProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// AdvancedScheduleMonthlyOccurrenceProtocol is the properties of the create advanced schedule monthly occurrence.
public protocol AdvancedScheduleMonthlyOccurrenceProtocol : Codable {
     var occurrence: Int32? { get set }
     var day: ScheduleDayEnum? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// AdvancedScheduleProtocol is the properties of the create Advanced Schedule.
public protocol AdvancedScheduleProtocol : Codable {
     var weekDays: [String]? { get set }
     var monthDays: [Int32]? { get set }
     var monthlyOccurrences: [AdvancedScheduleMonthlyOccurrenceProtocol?]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// AgentRegistrationKeysProtocol is definition of the agent registration keys.
public protocol AgentRegistrationKeysProtocol : Codable {
     var primary: String? { get set }
     var secondary: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// AgentRegistrationProtocol is definition of the agent registration infomration type.
public protocol AgentRegistrationProtocol : Codable {
     var dscMetaConfiguration: String? { get set }
     var endpoint: String? { get set }
     var keys: AgentRegistrationKeysProtocol? { get set }
     var id: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// AgentRegistrationRegenerateKeyParameterProtocol is the parameters supplied to the regenerate keys operation.
public protocol AgentRegistrationRegenerateKeyParameterProtocol : Codable {
     var keyName: AgentRegistrationKeyNameEnum { get set }
     var name: String? { get set }
     var location: String? { get set }
     var tags: [String:String]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// AutomationAccountCreateOrUpdateParametersProtocol is the parameters supplied to the create or update automation
// account operation.
public protocol AutomationAccountCreateOrUpdateParametersProtocol : Codable {
     var properties: AutomationAccountCreateOrUpdatePropertiesProtocol? { get set }
     var name: String? { get set }
     var location: String? { get set }
     var tags: [String:String]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// AutomationAccountCreateOrUpdatePropertiesProtocol is the parameters supplied to the create or update account
// properties.
public protocol AutomationAccountCreateOrUpdatePropertiesProtocol : Codable {
     var sku: SkuProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// AutomationAccountListResultProtocol is the response model for the list account operation.
public protocol AutomationAccountListResultProtocol : Codable {
     var value: [AutomationAccountProtocol?]? { get set }
     var _nextLink: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// AutomationAccountPropertiesProtocol is definition of the account property.
public protocol AutomationAccountPropertiesProtocol : Codable {
     var sku: SkuProtocol? { get set }
     var lastModifiedBy: String? { get set }
     var state: AutomationAccountStateEnum? { get set }
     var creationTime: Date? { get set }
     var lastModifiedTime: Date? { get set }
     var description: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// AutomationAccountProtocol is definition of the automation account type.
public protocol AutomationAccountProtocol : ResourceProtocol {
     var properties: AutomationAccountPropertiesProtocol? { get set }
     var etag: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// AutomationAccountUpdateParametersProtocol is the parameters supplied to the update automation account operation.
public protocol AutomationAccountUpdateParametersProtocol : Codable {
     var properties: AutomationAccountUpdatePropertiesProtocol? { get set }
     var name: String? { get set }
     var location: String? { get set }
     var tags: [String:String]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// AutomationAccountUpdatePropertiesProtocol is the parameters supplied to the update account properties.
public protocol AutomationAccountUpdatePropertiesProtocol : Codable {
     var sku: SkuProtocol? { get set }
}