// 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 ProcessInfoPropertiesData : ProcessInfoPropertiesProtocol {
    public var id: Int32?
    public var name: String?
    public var href: String?
    public var miniDump: String?
    public var isProfileRunning: Bool?
    public var isIisProfileRunning: Bool?
    public var iisProfileTimeoutInSeconds: Double?
    public var parent: String?
    public var children: [String]?
    public var threads: [ProcessThreadInfoProtocol?]?
    public var openFileHandles: [String]?
    public var modules: [ProcessModuleInfoProtocol?]?
    public var fileName: String?
    public var commandLine: String?
    public var userName: String?
    public var handleCount: Int32?
    public var moduleCount: Int32?
    public var threadCount: Int32?
    public var startTime: Date?
    public var totalProcessorTime: String?
    public var userProcessorTime: String?
    public var privilegedProcessorTime: String?
    public var workingSet64: Int64?
    public var peakWorkingSet64: Int64?
    public var privateMemorySize64: Int64?
    public var virtualMemorySize64: Int64?
    public var peakVirtualMemorySize64: Int64?
    public var pagedSystemMemorySize64: Int64?
    public var nonpagedSystemMemorySize64: Int64?
    public var pagedMemorySize64: Int64?
    public var peakPagedMemorySize64: Int64?
    public var timeStamp: Date?
    public var environmentVariables: [String:String]?
    public var isScmSite: Bool?
    public var isWebJob: Bool?
    public var description: String?

        enum CodingKeys: String, CodingKey {case id = "id"
        case name = "name"
        case href = "href"
        case miniDump = "miniDump"
        case isProfileRunning = "isProfileRunning"
        case isIisProfileRunning = "isIisProfileRunning"
        case iisProfileTimeoutInSeconds = "iisProfileTimeoutInSeconds"
        case parent = "parent"
        case children = "children"
        case threads = "threads"
        case openFileHandles = "openFileHandles"
        case modules = "modules"
        case fileName = "fileName"
        case commandLine = "commandLine"
        case userName = "userName"
        case handleCount = "handleCount"
        case moduleCount = "moduleCount"
        case threadCount = "threadCount"
        case startTime = "startTime"
        case totalProcessorTime = "totalProcessorTime"
        case userProcessorTime = "userProcessorTime"
        case privilegedProcessorTime = "privilegedProcessorTime"
        case workingSet64 = "workingSet64"
        case peakWorkingSet64 = "peakWorkingSet64"
        case privateMemorySize64 = "privateMemorySize64"
        case virtualMemorySize64 = "virtualMemorySize64"
        case peakVirtualMemorySize64 = "peakVirtualMemorySize64"
        case pagedSystemMemorySize64 = "pagedSystemMemorySize64"
        case nonpagedSystemMemorySize64 = "nonpagedSystemMemorySize64"
        case pagedMemorySize64 = "pagedMemorySize64"
        case peakPagedMemorySize64 = "peakPagedMemorySize64"
        case timeStamp = "timeStamp"
        case environmentVariables = "environmentVariables"
        case isScmSite = "isScmSite"
        case isWebJob = "isWebJob"
        case description = "description"
        }

  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(Int32?.self, forKey: .id)
    }
    if container.contains(.name) {
        self.name = try container.decode(String?.self, forKey: .name)
    }
    if container.contains(.href) {
        self.href = try container.decode(String?.self, forKey: .href)
    }
    if container.contains(.miniDump) {
        self.miniDump = try container.decode(String?.self, forKey: .miniDump)
    }
    if container.contains(.isProfileRunning) {
        self.isProfileRunning = try container.decode(Bool?.self, forKey: .isProfileRunning)
    }
    if container.contains(.isIisProfileRunning) {
        self.isIisProfileRunning = try container.decode(Bool?.self, forKey: .isIisProfileRunning)
    }
    if container.contains(.iisProfileTimeoutInSeconds) {
        self.iisProfileTimeoutInSeconds = try container.decode(Double?.self, forKey: .iisProfileTimeoutInSeconds)
    }
    if container.contains(.parent) {
        self.parent = try container.decode(String?.self, forKey: .parent)
    }
    if container.contains(.children) {
        self.children = try container.decode([String]?.self, forKey: .children)
    }
    if container.contains(.threads) {
        self.threads = try container.decode([ProcessThreadInfoData?]?.self, forKey: .threads)
    }
    if container.contains(.openFileHandles) {
        self.openFileHandles = try container.decode([String]?.self, forKey: .openFileHandles)
    }
    if container.contains(.modules) {
        self.modules = try container.decode([ProcessModuleInfoData?]?.self, forKey: .modules)
    }
    if container.contains(.fileName) {
        self.fileName = try container.decode(String?.self, forKey: .fileName)
    }
    if container.contains(.commandLine) {
        self.commandLine = try container.decode(String?.self, forKey: .commandLine)
    }
    if container.contains(.userName) {
        self.userName = try container.decode(String?.self, forKey: .userName)
    }
    if container.contains(.handleCount) {
        self.handleCount = try container.decode(Int32?.self, forKey: .handleCount)
    }
    if container.contains(.moduleCount) {
        self.moduleCount = try container.decode(Int32?.self, forKey: .moduleCount)
    }
    if container.contains(.threadCount) {
        self.threadCount = try container.decode(Int32?.self, forKey: .threadCount)
    }
    if container.contains(.startTime) {
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)
    }
    if container.contains(.totalProcessorTime) {
        self.totalProcessorTime = try container.decode(String?.self, forKey: .totalProcessorTime)
    }
    if container.contains(.userProcessorTime) {
        self.userProcessorTime = try container.decode(String?.self, forKey: .userProcessorTime)
    }
    if container.contains(.privilegedProcessorTime) {
        self.privilegedProcessorTime = try container.decode(String?.self, forKey: .privilegedProcessorTime)
    }
    if container.contains(.workingSet64) {
        self.workingSet64 = try container.decode(Int64?.self, forKey: .workingSet64)
    }
    if container.contains(.peakWorkingSet64) {
        self.peakWorkingSet64 = try container.decode(Int64?.self, forKey: .peakWorkingSet64)
    }
    if container.contains(.privateMemorySize64) {
        self.privateMemorySize64 = try container.decode(Int64?.self, forKey: .privateMemorySize64)
    }
    if container.contains(.virtualMemorySize64) {
        self.virtualMemorySize64 = try container.decode(Int64?.self, forKey: .virtualMemorySize64)
    }
    if container.contains(.peakVirtualMemorySize64) {
        self.peakVirtualMemorySize64 = try container.decode(Int64?.self, forKey: .peakVirtualMemorySize64)
    }
    if container.contains(.pagedSystemMemorySize64) {
        self.pagedSystemMemorySize64 = try container.decode(Int64?.self, forKey: .pagedSystemMemorySize64)
    }
    if container.contains(.nonpagedSystemMemorySize64) {
        self.nonpagedSystemMemorySize64 = try container.decode(Int64?.self, forKey: .nonpagedSystemMemorySize64)
    }
    if container.contains(.pagedMemorySize64) {
        self.pagedMemorySize64 = try container.decode(Int64?.self, forKey: .pagedMemorySize64)
    }
    if container.contains(.peakPagedMemorySize64) {
        self.peakPagedMemorySize64 = try container.decode(Int64?.self, forKey: .peakPagedMemorySize64)
    }
    if container.contains(.timeStamp) {
        self.timeStamp = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .timeStamp)), format: .dateTime)
    }
    if container.contains(.environmentVariables) {
        self.environmentVariables = try container.decode([String:String]?.self, forKey: .environmentVariables)
    }
    if container.contains(.isScmSite) {
        self.isScmSite = try container.decode(Bool?.self, forKey: .isScmSite)
    }
    if container.contains(.isWebJob) {
        self.isWebJob = try container.decode(Bool?.self, forKey: .isWebJob)
    }
    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.id != nil {try container.encode(self.id, forKey: .id)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.href != nil {try container.encode(self.href, forKey: .href)}
    if self.miniDump != nil {try container.encode(self.miniDump, forKey: .miniDump)}
    if self.isProfileRunning != nil {try container.encode(self.isProfileRunning, forKey: .isProfileRunning)}
    if self.isIisProfileRunning != nil {try container.encode(self.isIisProfileRunning, forKey: .isIisProfileRunning)}
    if self.iisProfileTimeoutInSeconds != nil {try container.encode(self.iisProfileTimeoutInSeconds, forKey: .iisProfileTimeoutInSeconds)}
    if self.parent != nil {try container.encode(self.parent, forKey: .parent)}
    if self.children != nil {try container.encode(self.children as! [String]?, forKey: .children)}
    if self.threads != nil {try container.encode(self.threads as! [ProcessThreadInfoData?]?, forKey: .threads)}
    if self.openFileHandles != nil {try container.encode(self.openFileHandles as! [String]?, forKey: .openFileHandles)}
    if self.modules != nil {try container.encode(self.modules as! [ProcessModuleInfoData?]?, forKey: .modules)}
    if self.fileName != nil {try container.encode(self.fileName, forKey: .fileName)}
    if self.commandLine != nil {try container.encode(self.commandLine, forKey: .commandLine)}
    if self.userName != nil {try container.encode(self.userName, forKey: .userName)}
    if self.handleCount != nil {try container.encode(self.handleCount, forKey: .handleCount)}
    if self.moduleCount != nil {try container.encode(self.moduleCount, forKey: .moduleCount)}
    if self.threadCount != nil {try container.encode(self.threadCount, forKey: .threadCount)}
    if self.startTime != nil {
        try container.encode(DateConverter.toString(date: self.startTime!, format: .dateTime), forKey: .startTime)
    }
    if self.totalProcessorTime != nil {try container.encode(self.totalProcessorTime, forKey: .totalProcessorTime)}
    if self.userProcessorTime != nil {try container.encode(self.userProcessorTime, forKey: .userProcessorTime)}
    if self.privilegedProcessorTime != nil {try container.encode(self.privilegedProcessorTime, forKey: .privilegedProcessorTime)}
    if self.workingSet64 != nil {try container.encode(self.workingSet64, forKey: .workingSet64)}
    if self.peakWorkingSet64 != nil {try container.encode(self.peakWorkingSet64, forKey: .peakWorkingSet64)}
    if self.privateMemorySize64 != nil {try container.encode(self.privateMemorySize64, forKey: .privateMemorySize64)}
    if self.virtualMemorySize64 != nil {try container.encode(self.virtualMemorySize64, forKey: .virtualMemorySize64)}
    if self.peakVirtualMemorySize64 != nil {try container.encode(self.peakVirtualMemorySize64, forKey: .peakVirtualMemorySize64)}
    if self.pagedSystemMemorySize64 != nil {try container.encode(self.pagedSystemMemorySize64, forKey: .pagedSystemMemorySize64)}
    if self.nonpagedSystemMemorySize64 != nil {try container.encode(self.nonpagedSystemMemorySize64, forKey: .nonpagedSystemMemorySize64)}
    if self.pagedMemorySize64 != nil {try container.encode(self.pagedMemorySize64, forKey: .pagedMemorySize64)}
    if self.peakPagedMemorySize64 != nil {try container.encode(self.peakPagedMemorySize64, forKey: .peakPagedMemorySize64)}
    if self.timeStamp != nil {
        try container.encode(DateConverter.toString(date: self.timeStamp!, format: .dateTime), forKey: .timeStamp)
    }
    if self.environmentVariables != nil {try container.encode(self.environmentVariables, forKey: .environmentVariables)}
    if self.isScmSite != nil {try container.encode(self.isScmSite, forKey: .isScmSite)}
    if self.isWebJob != nil {try container.encode(self.isWebJob, forKey: .isWebJob)}
    if self.description != nil {try container.encode(self.description, forKey: .description)}
  }
}

extension DataFactory {
  public static func createProcessInfoPropertiesProtocol() -> ProcessInfoPropertiesProtocol {
    return ProcessInfoPropertiesData()
  }
}


// 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 ProcessModuleInfoCollectionData : ProcessModuleInfoCollectionProtocol {
    public var value: [ProcessModuleInfoProtocol]
    public var _nextLink: String?

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

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

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

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

extension DataFactory {
  public static func createProcessModuleInfoCollectionProtocol(value: [ProcessModuleInfoProtocol]) -> ProcessModuleInfoCollectionProtocol {
    return ProcessModuleInfoCollectionData(value: value)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct ProcessModuleInfoData : ProcessModuleInfoProtocol, ProxyOnlyResourceProtocol {
    public var id: String?
    public var name: String?
    public var kind: String?
    public var type: String?
    public var properties: ProcessModuleInfoPropertiesProtocol?

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

extension DataFactory {
  public static func createProcessModuleInfoProtocol() -> ProcessModuleInfoProtocol {
    return ProcessModuleInfoData()
  }
}


// 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 ProcessModuleInfoPropertiesData : ProcessModuleInfoPropertiesProtocol {
    public var baseAddress: String?
    public var fileName: String?
    public var href: String?
    public var filePath: String?
    public var moduleMemorySize: Int32?
    public var fileVersion: String?
    public var fileDescription: String?
    public var product: String?
    public var productVersion: String?
    public var isDebug: Bool?
    public var language: String?

        enum CodingKeys: String, CodingKey {case baseAddress = "baseAddress"
        case fileName = "fileName"
        case href = "href"
        case filePath = "filePath"
        case moduleMemorySize = "moduleMemorySize"
        case fileVersion = "fileVersion"
        case fileDescription = "fileDescription"
        case product = "product"
        case productVersion = "productVersion"
        case isDebug = "isDebug"
        case language = "language"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.baseAddress) {
        self.baseAddress = try container.decode(String?.self, forKey: .baseAddress)
    }
    if container.contains(.fileName) {
        self.fileName = try container.decode(String?.self, forKey: .fileName)
    }
    if container.contains(.href) {
        self.href = try container.decode(String?.self, forKey: .href)
    }
    if container.contains(.filePath) {
        self.filePath = try container.decode(String?.self, forKey: .filePath)
    }
    if container.contains(.moduleMemorySize) {
        self.moduleMemorySize = try container.decode(Int32?.self, forKey: .moduleMemorySize)
    }
    if container.contains(.fileVersion) {
        self.fileVersion = try container.decode(String?.self, forKey: .fileVersion)
    }
    if container.contains(.fileDescription) {
        self.fileDescription = try container.decode(String?.self, forKey: .fileDescription)
    }
    if container.contains(.product) {
        self.product = try container.decode(String?.self, forKey: .product)
    }
    if container.contains(.productVersion) {
        self.productVersion = try container.decode(String?.self, forKey: .productVersion)
    }
    if container.contains(.isDebug) {
        self.isDebug = try container.decode(Bool?.self, forKey: .isDebug)
    }
    if container.contains(.language) {
        self.language = try container.decode(String?.self, forKey: .language)
    }
    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.baseAddress != nil {try container.encode(self.baseAddress, forKey: .baseAddress)}
    if self.fileName != nil {try container.encode(self.fileName, forKey: .fileName)}
    if self.href != nil {try container.encode(self.href, forKey: .href)}
    if self.filePath != nil {try container.encode(self.filePath, forKey: .filePath)}
    if self.moduleMemorySize != nil {try container.encode(self.moduleMemorySize, forKey: .moduleMemorySize)}
    if self.fileVersion != nil {try container.encode(self.fileVersion, forKey: .fileVersion)}
    if self.fileDescription != nil {try container.encode(self.fileDescription, forKey: .fileDescription)}
    if self.product != nil {try container.encode(self.product, forKey: .product)}
    if self.productVersion != nil {try container.encode(self.productVersion, forKey: .productVersion)}
    if self.isDebug != nil {try container.encode(self.isDebug, forKey: .isDebug)}
    if self.language != nil {try container.encode(self.language, forKey: .language)}
  }
}

extension DataFactory {
  public static func createProcessModuleInfoPropertiesProtocol() -> ProcessModuleInfoPropertiesProtocol {
    return ProcessModuleInfoPropertiesData()
  }
}


// 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 ProcessThreadInfoCollectionData : ProcessThreadInfoCollectionProtocol {
    public var value: [ProcessThreadInfoProtocol]
    public var _nextLink: String?

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

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

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

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

extension DataFactory {
  public static func createProcessThreadInfoCollectionProtocol(value: [ProcessThreadInfoProtocol]) -> ProcessThreadInfoCollectionProtocol {
    return ProcessThreadInfoCollectionData(value: value)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct ProcessThreadInfoData : ProcessThreadInfoProtocol, ProxyOnlyResourceProtocol {
    public var id: String?
    public var name: String?
    public var kind: String?
    public var type: String?
    public var properties: ProcessThreadInfoPropertiesProtocol?

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

extension DataFactory {
  public static func createProcessThreadInfoProtocol() -> ProcessThreadInfoProtocol {
    return ProcessThreadInfoData()
  }
}


// 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 ProcessThreadInfoPropertiesData : ProcessThreadInfoPropertiesProtocol {
    public var id: Int32?
    public var href: String?
    public var process: String?
    public var startAddress: String?
    public var currentPriority: Int32?
    public var priorityLevel: String?
    public var basePriority: Int32?
    public var startTime: Date?
    public var totalProcessorTime: String?
    public var userProcessorTime: String?
    public var priviledgedProcessorTime: String?
    public var state: String?
    public var waitReason: String?

        enum CodingKeys: String, CodingKey {case id = "id"
        case href = "href"
        case process = "process"
        case startAddress = "startAddress"
        case currentPriority = "currentPriority"
        case priorityLevel = "priorityLevel"
        case basePriority = "basePriority"
        case startTime = "startTime"
        case totalProcessorTime = "totalProcessorTime"
        case userProcessorTime = "userProcessorTime"
        case priviledgedProcessorTime = "priviledgedProcessorTime"
        case state = "state"
        case waitReason = "waitReason"
        }

  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(Int32?.self, forKey: .id)
    }
    if container.contains(.href) {
        self.href = try container.decode(String?.self, forKey: .href)
    }
    if container.contains(.process) {
        self.process = try container.decode(String?.self, forKey: .process)
    }
    if container.contains(.startAddress) {
        self.startAddress = try container.decode(String?.self, forKey: .startAddress)
    }
    if container.contains(.currentPriority) {
        self.currentPriority = try container.decode(Int32?.self, forKey: .currentPriority)
    }
    if container.contains(.priorityLevel) {
        self.priorityLevel = try container.decode(String?.self, forKey: .priorityLevel)
    }
    if container.contains(.basePriority) {
        self.basePriority = try container.decode(Int32?.self, forKey: .basePriority)
    }
    if container.contains(.startTime) {
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)
    }
    if container.contains(.totalProcessorTime) {
        self.totalProcessorTime = try container.decode(String?.self, forKey: .totalProcessorTime)
    }
    if container.contains(.userProcessorTime) {
        self.userProcessorTime = try container.decode(String?.self, forKey: .userProcessorTime)
    }
    if container.contains(.priviledgedProcessorTime) {
        self.priviledgedProcessorTime = try container.decode(String?.self, forKey: .priviledgedProcessorTime)
    }
    if container.contains(.state) {
        self.state = try container.decode(String?.self, forKey: .state)
    }
    if container.contains(.waitReason) {
        self.waitReason = try container.decode(String?.self, forKey: .waitReason)
    }
    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.href != nil {try container.encode(self.href, forKey: .href)}
    if self.process != nil {try container.encode(self.process, forKey: .process)}
    if self.startAddress != nil {try container.encode(self.startAddress, forKey: .startAddress)}
    if self.currentPriority != nil {try container.encode(self.currentPriority, forKey: .currentPriority)}
    if self.priorityLevel != nil {try container.encode(self.priorityLevel, forKey: .priorityLevel)}
    if self.basePriority != nil {try container.encode(self.basePriority, forKey: .basePriority)}
    if self.startTime != nil {
        try container.encode(DateConverter.toString(date: self.startTime!, format: .dateTime), forKey: .startTime)
    }
    if self.totalProcessorTime != nil {try container.encode(self.totalProcessorTime, forKey: .totalProcessorTime)}
    if self.userProcessorTime != nil {try container.encode(self.userProcessorTime, forKey: .userProcessorTime)}
    if self.priviledgedProcessorTime != nil {try container.encode(self.priviledgedProcessorTime, forKey: .priviledgedProcessorTime)}
    if self.state != nil {try container.encode(self.state, forKey: .state)}
    if self.waitReason != nil {try container.encode(self.waitReason, forKey: .waitReason)}
  }
}

extension DataFactory {
  public static func createProcessThreadInfoPropertiesProtocol() -> ProcessThreadInfoPropertiesProtocol {
    return ProcessThreadInfoPropertiesData()
  }
}


// ProvisioningState enumerates the values for provisioning state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum ProvisioningStateEnum: String, Codable
{
// ProvisioningStateCanceled specifies the provisioning state canceled state for provisioning state.
    case ProvisioningStateCanceled = "Canceled"
// ProvisioningStateDeleting specifies the provisioning state deleting state for provisioning state.
    case ProvisioningStateDeleting = "Deleting"
// ProvisioningStateFailed specifies the provisioning state failed state for provisioning state.
    case ProvisioningStateFailed = "Failed"
// ProvisioningStateInProgress specifies the provisioning state in progress state for provisioning state.
    case ProvisioningStateInProgress = "InProgress"
// ProvisioningStateSucceeded specifies the provisioning state succeeded state for provisioning state.
    case ProvisioningStateSucceeded = "Succeeded"
}


// 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 ProxyOnlyResourceData : ProxyOnlyResourceProtocol {
    public var id: String?
    public var name: String?
    public var kind: String?
    public var type: String?

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

  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(.kind) {
        self.kind = try container.decode(String?.self, forKey: .kind)
    }
    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.id != nil {try container.encode(self.id, forKey: .id)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.kind != nil {try container.encode(self.kind, forKey: .kind)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
  }
}

extension DataFactory {
  public static func createProxyOnlyResourceProtocol() -> ProxyOnlyResourceProtocol {
    return ProxyOnlyResourceData()
  }
}


// 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 PublicCertificateCollectionData : PublicCertificateCollectionProtocol {
    public var value: [PublicCertificateProtocol]
    public var _nextLink: String?

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

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

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

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

extension DataFactory {
  public static func createPublicCertificateCollectionProtocol(value: [PublicCertificateProtocol]) -> PublicCertificateCollectionProtocol {
    return PublicCertificateCollectionData(value: value)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct PublicCertificateData : PublicCertificateProtocol, ProxyOnlyResourceProtocol {
    public var id: String?
    public var name: String?
    public var kind: String?
    public var type: String?
    public var properties: PublicCertificatePropertiesProtocol?

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

extension DataFactory {
  public static func createPublicCertificateProtocol() -> PublicCertificateProtocol {
    return PublicCertificateData()
  }
}


// PublicCertificateLocation enumerates the values for public certificate location.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum PublicCertificateLocationEnum: String, Codable
{
// PublicCertificateLocationCurrentUserMy specifies the public certificate location current user my state for public
// certificate location.
    case PublicCertificateLocationCurrentUserMy = "CurrentUserMy"
// PublicCertificateLocationLocalMachineMy specifies the public certificate location local machine my state for public
// certificate location.
    case PublicCertificateLocationLocalMachineMy = "LocalMachineMy"
// PublicCertificateLocationUnknown specifies the public certificate location unknown state for public certificate
// location.
    case PublicCertificateLocationUnknown = "Unknown"
}


// 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 PublicCertificatePropertiesData : PublicCertificatePropertiesProtocol {
    public var blob: [UInt8]?
    public var publicCertificateLocation: PublicCertificateLocationEnum?
    public var thumbprint: String?

        enum CodingKeys: String, CodingKey {case blob = "blob"
        case publicCertificateLocation = "publicCertificateLocation"
        case thumbprint = "thumbprint"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createPublicCertificatePropertiesProtocol() -> PublicCertificatePropertiesProtocol {
    return PublicCertificatePropertiesData()
  }
}


// PublishingProfileFormat enumerates the values for publishing profile format.

// 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 PublishingProfileFormatEnum: String, Codable
{
// FileZilla3 specifies the file zilla 3 state for publishing profile format.
    case FileZilla3 = "FileZilla3"
// Ftp specifies the ftp state for publishing profile format.
    case Ftp = "Ftp"
// WebDeploy specifies the web deploy state for publishing profile format.
    case WebDeploy = "WebDeploy"
}


// 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 PushSettingsData : PushSettingsProtocol, ProxyOnlyResourceProtocol {
    public var id: String?
    public var name: String?
    public var kind: String?
    public var type: String?
    public var properties: PushSettingsPropertiesProtocol?

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

extension DataFactory {
  public static func createPushSettingsProtocol() -> PushSettingsProtocol {
    return PushSettingsData()
  }
}


// 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 PushSettingsPropertiesData : PushSettingsPropertiesProtocol {
    public var isPushEnabled: Bool?
    public var tagWhitelistJson: String?
    public var tagsRequiringAuth: String?
    public var dynamicTagsJson: String?

        enum CodingKeys: String, CodingKey {case isPushEnabled = "isPushEnabled"
        case tagWhitelistJson = "tagWhitelistJson"
        case tagsRequiringAuth = "tagsRequiringAuth"
        case dynamicTagsJson = "dynamicTagsJson"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createPushSettingsPropertiesProtocol() -> PushSettingsPropertiesProtocol {
    return PushSettingsPropertiesData()
  }
}


// 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 RampUpRuleData : RampUpRuleProtocol {
    public var actionHostName: String?
    public var reroutePercentage: Double?
    public var changeStep: Double?
    public var changeIntervalInMinutes: Int32?
    public var minReroutePercentage: Double?
    public var maxReroutePercentage: Double?
    public var changeDecisionCallbackUrl: String?
    public var name: String?

        enum CodingKeys: String, CodingKey {case actionHostName = "actionHostName"
        case reroutePercentage = "reroutePercentage"
        case changeStep = "changeStep"
        case changeIntervalInMinutes = "changeIntervalInMinutes"
        case minReroutePercentage = "minReroutePercentage"
        case maxReroutePercentage = "maxReroutePercentage"
        case changeDecisionCallbackUrl = "changeDecisionCallbackUrl"
        case name = "name"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.actionHostName) {
        self.actionHostName = try container.decode(String?.self, forKey: .actionHostName)
    }
    if container.contains(.reroutePercentage) {
        self.reroutePercentage = try container.decode(Double?.self, forKey: .reroutePercentage)
    }
    if container.contains(.changeStep) {
        self.changeStep = try container.decode(Double?.self, forKey: .changeStep)
    }
    if container.contains(.changeIntervalInMinutes) {
        self.changeIntervalInMinutes = try container.decode(Int32?.self, forKey: .changeIntervalInMinutes)
    }
    if container.contains(.minReroutePercentage) {
        self.minReroutePercentage = try container.decode(Double?.self, forKey: .minReroutePercentage)
    }
    if container.contains(.maxReroutePercentage) {
        self.maxReroutePercentage = try container.decode(Double?.self, forKey: .maxReroutePercentage)
    }
    if container.contains(.changeDecisionCallbackUrl) {
        self.changeDecisionCallbackUrl = try container.decode(String?.self, forKey: .changeDecisionCallbackUrl)
    }
    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.actionHostName != nil {try container.encode(self.actionHostName, forKey: .actionHostName)}
    if self.reroutePercentage != nil {try container.encode(self.reroutePercentage, forKey: .reroutePercentage)}
    if self.changeStep != nil {try container.encode(self.changeStep, forKey: .changeStep)}
    if self.changeIntervalInMinutes != nil {try container.encode(self.changeIntervalInMinutes, forKey: .changeIntervalInMinutes)}
    if self.minReroutePercentage != nil {try container.encode(self.minReroutePercentage, forKey: .minReroutePercentage)}
    if self.maxReroutePercentage != nil {try container.encode(self.maxReroutePercentage, forKey: .maxReroutePercentage)}
    if self.changeDecisionCallbackUrl != nil {try container.encode(self.changeDecisionCallbackUrl, forKey: .changeDecisionCallbackUrl)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
  }
}

extension DataFactory {
  public static func createRampUpRuleProtocol() -> RampUpRuleProtocol {
    return RampUpRuleData()
  }
}


// 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 RecommendationCollectionData : RecommendationCollectionProtocol {
    public var value: [RecommendationProtocol]
    public var _nextLink: String?

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

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

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

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

extension DataFactory {
  public static func createRecommendationCollectionProtocol(value: [RecommendationProtocol]) -> RecommendationCollectionProtocol {
    return RecommendationCollectionData(value: value)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct RecommendationData : RecommendationProtocol, ProxyOnlyResourceProtocol {
    public var id: String?
    public var name: String?
    public var kind: String?
    public var type: String?
    public var properties: RecommendationPropertiesProtocol?

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

extension DataFactory {
  public static func createRecommendationProtocol() -> RecommendationProtocol {
    return RecommendationData()
  }
}


// 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 RecommendationPropertiesData : RecommendationPropertiesProtocol {
    public var creationTime: Date?
    public var recommendationId: String?
    public var resourceId: String?
    public var resourceScope: ResourceScopeTypeEnum?
    public var ruleName: String?
    public var displayName: String?
    public var message: String?
    public var level: NotificationLevelEnum?
    public var channels: ChannelsEnum?
    public var tags: [String]?
    public var actionName: String?
    public var startTime: Date?
    public var endTime: Date?
    public var nextNotificationTime: Date?
    public var notificationExpirationTime: Date?
    public var notifiedTime: Date?
    public var score: Double?
    public var isDynamic: Bool?
    public var extensionName: String?
    public var bladeName: String?
    public var forwardLink: String?

        enum CodingKeys: String, CodingKey {case creationTime = "creationTime"
        case recommendationId = "recommendationId"
        case resourceId = "resourceId"
        case resourceScope = "resourceScope"
        case ruleName = "ruleName"
        case displayName = "displayName"
        case message = "message"
        case level = "level"
        case channels = "channels"
        case tags = "tags"
        case actionName = "actionName"
        case startTime = "startTime"
        case endTime = "endTime"
        case nextNotificationTime = "nextNotificationTime"
        case notificationExpirationTime = "notificationExpirationTime"
        case notifiedTime = "notifiedTime"
        case score = "score"
        case isDynamic = "isDynamic"
        case extensionName = "extensionName"
        case bladeName = "bladeName"
        case forwardLink = "forwardLink"
        }

  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(.recommendationId) {
        self.recommendationId = try container.decode(String?.self, forKey: .recommendationId)
    }
    if container.contains(.resourceId) {
        self.resourceId = try container.decode(String?.self, forKey: .resourceId)
    }
    if container.contains(.resourceScope) {
        self.resourceScope = try container.decode(ResourceScopeTypeEnum?.self, forKey: .resourceScope)
    }
    if container.contains(.ruleName) {
        self.ruleName = try container.decode(String?.self, forKey: .ruleName)
    }
    if container.contains(.displayName) {
        self.displayName = try container.decode(String?.self, forKey: .displayName)
    }
    if container.contains(.message) {
        self.message = try container.decode(String?.self, forKey: .message)
    }
    if container.contains(.level) {
        self.level = try container.decode(NotificationLevelEnum?.self, forKey: .level)
    }
    if container.contains(.channels) {
        self.channels = try container.decode(ChannelsEnum?.self, forKey: .channels)
    }
    if container.contains(.tags) {
        self.tags = try container.decode([String]?.self, forKey: .tags)
    }
    if container.contains(.actionName) {
        self.actionName = try container.decode(String?.self, forKey: .actionName)
    }
    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(.nextNotificationTime) {
        self.nextNotificationTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .nextNotificationTime)), format: .dateTime)
    }
    if container.contains(.notificationExpirationTime) {
        self.notificationExpirationTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .notificationExpirationTime)), format: .dateTime)
    }
    if container.contains(.notifiedTime) {
        self.notifiedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .notifiedTime)), format: .dateTime)
    }
    if container.contains(.score) {
        self.score = try container.decode(Double?.self, forKey: .score)
    }
    if container.contains(.isDynamic) {
        self.isDynamic = try container.decode(Bool?.self, forKey: .isDynamic)
    }
    if container.contains(.extensionName) {
        self.extensionName = try container.decode(String?.self, forKey: .extensionName)
    }
    if container.contains(.bladeName) {
        self.bladeName = try container.decode(String?.self, forKey: .bladeName)
    }
    if container.contains(.forwardLink) {
        self.forwardLink = try container.decode(String?.self, forKey: .forwardLink)
    }
    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.recommendationId != nil {try container.encode(self.recommendationId, forKey: .recommendationId)}
    if self.resourceId != nil {try container.encode(self.resourceId, forKey: .resourceId)}
    if self.resourceScope != nil {try container.encode(self.resourceScope, forKey: .resourceScope)}
    if self.ruleName != nil {try container.encode(self.ruleName, forKey: .ruleName)}
    if self.displayName != nil {try container.encode(self.displayName, forKey: .displayName)}
    if self.message != nil {try container.encode(self.message, forKey: .message)}
    if self.level != nil {try container.encode(self.level, forKey: .level)}
    if self.channels != nil {try container.encode(self.channels, forKey: .channels)}
    if self.tags != nil {try container.encode(self.tags as! [String]?, forKey: .tags)}
    if self.actionName != nil {try container.encode(self.actionName, forKey: .actionName)}
    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.nextNotificationTime != nil {
        try container.encode(DateConverter.toString(date: self.nextNotificationTime!, format: .dateTime), forKey: .nextNotificationTime)
    }
    if self.notificationExpirationTime != nil {
        try container.encode(DateConverter.toString(date: self.notificationExpirationTime!, format: .dateTime), forKey: .notificationExpirationTime)
    }
    if self.notifiedTime != nil {
        try container.encode(DateConverter.toString(date: self.notifiedTime!, format: .dateTime), forKey: .notifiedTime)
    }
    if self.score != nil {try container.encode(self.score, forKey: .score)}
    if self.isDynamic != nil {try container.encode(self.isDynamic, forKey: .isDynamic)}
    if self.extensionName != nil {try container.encode(self.extensionName, forKey: .extensionName)}
    if self.bladeName != nil {try container.encode(self.bladeName, forKey: .bladeName)}
    if self.forwardLink != nil {try container.encode(self.forwardLink, forKey: .forwardLink)}
  }
}

extension DataFactory {
  public static func createRecommendationPropertiesProtocol() -> RecommendationPropertiesProtocol {
    return RecommendationPropertiesData()
  }
}


// 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 RecommendationRuleData : RecommendationRuleProtocol, ProxyOnlyResourceProtocol {
    public var id: String?
    public var name: String?
    public var kind: String?
    public var type: String?
    public var properties: RecommendationRulePropertiesProtocol?

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

extension DataFactory {
  public static func createRecommendationRuleProtocol() -> RecommendationRuleProtocol {
    return RecommendationRuleData()
  }
}


// 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 RecommendationRulePropertiesData : RecommendationRulePropertiesProtocol {
    public var name: String?
    public var displayName: String?
    public var message: String?
    public var recommendationId: String?
    public var description: String?
    public var actionName: String?
    public var level: NotificationLevelEnum?
    public var channels: ChannelsEnum?
    public var tags: [String]?
    public var isDynamic: Bool?
    public var extensionName: String?
    public var bladeName: String?
    public var forwardLink: String?

        enum CodingKeys: String, CodingKey {case name = "name"
        case displayName = "displayName"
        case message = "message"
        case recommendationId = "recommendationId"
        case description = "description"
        case actionName = "actionName"
        case level = "level"
        case channels = "channels"
        case tags = "tags"
        case isDynamic = "isDynamic"
        case extensionName = "extensionName"
        case bladeName = "bladeName"
        case forwardLink = "forwardLink"
        }

  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(.displayName) {
        self.displayName = try container.decode(String?.self, forKey: .displayName)
    }
    if container.contains(.message) {
        self.message = try container.decode(String?.self, forKey: .message)
    }
    if container.contains(.recommendationId) {
        self.recommendationId = try container.decode(String?.self, forKey: .recommendationId)
    }
    if container.contains(.description) {
        self.description = try container.decode(String?.self, forKey: .description)
    }
    if container.contains(.actionName) {
        self.actionName = try container.decode(String?.self, forKey: .actionName)
    }
    if container.contains(.level) {
        self.level = try container.decode(NotificationLevelEnum?.self, forKey: .level)
    }
    if container.contains(.channels) {
        self.channels = try container.decode(ChannelsEnum?.self, forKey: .channels)
    }
    if container.contains(.tags) {
        self.tags = try container.decode([String]?.self, forKey: .tags)
    }
    if container.contains(.isDynamic) {
        self.isDynamic = try container.decode(Bool?.self, forKey: .isDynamic)
    }
    if container.contains(.extensionName) {
        self.extensionName = try container.decode(String?.self, forKey: .extensionName)
    }
    if container.contains(.bladeName) {
        self.bladeName = try container.decode(String?.self, forKey: .bladeName)
    }
    if container.contains(.forwardLink) {
        self.forwardLink = try container.decode(String?.self, forKey: .forwardLink)
    }
    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.displayName != nil {try container.encode(self.displayName, forKey: .displayName)}
    if self.message != nil {try container.encode(self.message, forKey: .message)}
    if self.recommendationId != nil {try container.encode(self.recommendationId, forKey: .recommendationId)}
    if self.description != nil {try container.encode(self.description, forKey: .description)}
    if self.actionName != nil {try container.encode(self.actionName, forKey: .actionName)}
    if self.level != nil {try container.encode(self.level, forKey: .level)}
    if self.channels != nil {try container.encode(self.channels, forKey: .channels)}
    if self.tags != nil {try container.encode(self.tags as! [String]?, forKey: .tags)}
    if self.isDynamic != nil {try container.encode(self.isDynamic, forKey: .isDynamic)}
    if self.extensionName != nil {try container.encode(self.extensionName, forKey: .extensionName)}
    if self.bladeName != nil {try container.encode(self.bladeName, forKey: .bladeName)}
    if self.forwardLink != nil {try container.encode(self.forwardLink, forKey: .forwardLink)}
  }
}

extension DataFactory {
  public static func createRecommendationRulePropertiesProtocol() -> RecommendationRulePropertiesProtocol {
    return RecommendationRulePropertiesData()
  }
}


// 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 ReissueCertificateOrderRequestData : ReissueCertificateOrderRequestProtocol, ProxyOnlyResourceProtocol {
    public var id: String?
    public var name: String?
    public var kind: String?
    public var type: String?
    public var properties: ReissueCertificateOrderRequestPropertiesProtocol?

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

extension DataFactory {
  public static func createReissueCertificateOrderRequestProtocol() -> ReissueCertificateOrderRequestProtocol {
    return ReissueCertificateOrderRequestData()
  }
}


// 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 ReissueCertificateOrderRequestPropertiesData : ReissueCertificateOrderRequestPropertiesProtocol {
    public var keySize: Int32?
    public var delayExistingRevokeInHours: Int32?
    public var csr: String?
    public var isPrivateKeyExternal: Bool?

        enum CodingKeys: String, CodingKey {case keySize = "keySize"
        case delayExistingRevokeInHours = "delayExistingRevokeInHours"
        case csr = "csr"
        case isPrivateKeyExternal = "isPrivateKeyExternal"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createReissueCertificateOrderRequestPropertiesProtocol() -> ReissueCertificateOrderRequestPropertiesProtocol {
    return ReissueCertificateOrderRequestPropertiesData()
  }
}


// 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 RelayServiceConnectionEntityData : RelayServiceConnectionEntityProtocol, ProxyOnlyResourceProtocol {
    public var id: String?
    public var name: String?
    public var kind: String?
    public var type: String?
    public var properties: RelayServiceConnectionEntityPropertiesProtocol?

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

extension DataFactory {
  public static func createRelayServiceConnectionEntityProtocol() -> RelayServiceConnectionEntityProtocol {
    return RelayServiceConnectionEntityData()
  }
}


// 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 RelayServiceConnectionEntityPropertiesData : RelayServiceConnectionEntityPropertiesProtocol {
    public var entityName: String?
    public var entityConnectionString: String?
    public var resourceType: String?
    public var resourceConnectionString: String?
    public var hostname: String?
    public var port: Int32?
    public var biztalkUri: String?

        enum CodingKeys: String, CodingKey {case entityName = "entityName"
        case entityConnectionString = "entityConnectionString"
        case resourceType = "resourceType"
        case resourceConnectionString = "resourceConnectionString"
        case hostname = "hostname"
        case port = "port"
        case biztalkUri = "biztalkUri"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createRelayServiceConnectionEntityPropertiesProtocol() -> RelayServiceConnectionEntityPropertiesProtocol {
    return RelayServiceConnectionEntityPropertiesData()
  }
}


// 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 RenewCertificateOrderRequestData : RenewCertificateOrderRequestProtocol, ProxyOnlyResourceProtocol {
    public var id: String?
    public var name: String?
    public var kind: String?
    public var type: String?
    public var properties: RenewCertificateOrderRequestPropertiesProtocol?

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

extension DataFactory {
  public static func createRenewCertificateOrderRequestProtocol() -> RenewCertificateOrderRequestProtocol {
    return RenewCertificateOrderRequestData()
  }
}


// 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 RenewCertificateOrderRequestPropertiesData : RenewCertificateOrderRequestPropertiesProtocol {
    public var keySize: Int32?
    public var csr: String?
    public var isPrivateKeyExternal: Bool?

        enum CodingKeys: String, CodingKey {case keySize = "keySize"
        case csr = "csr"
        case isPrivateKeyExternal = "isPrivateKeyExternal"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createRenewCertificateOrderRequestPropertiesProtocol() -> RenewCertificateOrderRequestPropertiesProtocol {
    return RenewCertificateOrderRequestPropertiesData()
  }
}


// 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 RequestsBasedTriggerData : RequestsBasedTriggerProtocol {
    public var count: Int32?
    public var timeInterval: String?

        enum CodingKeys: String, CodingKey {case count = "count"
        case timeInterval = "timeInterval"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createRequestsBasedTriggerProtocol() -> RequestsBasedTriggerProtocol {
    return RequestsBasedTriggerData()
  }
}


// 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 ResourceCollectionData : ResourceCollectionProtocol {
    public var value: [String]
    public var _nextLink: String?

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

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

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

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

extension DataFactory {
  public static func createResourceCollectionProtocol(value: [String]) -> ResourceCollectionProtocol {
    return ResourceCollectionData(value: value)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct ResourceData : ResourceProtocol {
    public var id: String?
    public var name: String?
    public var kind: String?
    public var location: String
    public var type: String?
    public var tags: [String:String]?

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

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

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

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

extension DataFactory {
  public static func createResourceProtocol(location: String) -> ResourceProtocol {
    return ResourceData(location: location)
  }
}


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

        enum CodingKeys: String, CodingKey {case timeGrain = "timeGrain"
        case retention = "retention"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createResourceMetricAvailabilityProtocol() -> ResourceMetricAvailabilityProtocol {
    return ResourceMetricAvailabilityData()
  }
}


// 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 ResourceMetricCollectionData : ResourceMetricCollectionProtocol {
    public var value: [ResourceMetricProtocol]
    public var _nextLink: String?

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

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

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

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

extension DataFactory {
  public static func createResourceMetricCollectionProtocol(value: [ResourceMetricProtocol]) -> ResourceMetricCollectionProtocol {
    return ResourceMetricCollectionData(value: value)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct ResourceMetricData : ResourceMetricProtocol {
    public var name: ResourceMetricNameProtocol?
    public var unit: String?
    public var timeGrain: String?
    public var startTime: Date?
    public var endTime: Date?
    public var resourceId: String?
    public var id: String?
    public var metricValues: [ResourceMetricValueProtocol?]?
    public var properties: [ResourceMetricPropertyProtocol?]?

        enum CodingKeys: String, CodingKey {case name = "name"
        case unit = "unit"
        case timeGrain = "timeGrain"
        case startTime = "startTime"
        case endTime = "endTime"
        case resourceId = "resourceId"
        case id = "id"
        case metricValues = "metricValues"
        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(ResourceMetricNameData?.self, forKey: .name)
    }
    if container.contains(.unit) {
        self.unit = try container.decode(String?.self, forKey: .unit)
    }
    if container.contains(.timeGrain) {
        self.timeGrain = try container.decode(String?.self, forKey: .timeGrain)
    }
    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(.resourceId) {
        self.resourceId = try container.decode(String?.self, forKey: .resourceId)
    }
    if container.contains(.id) {
        self.id = try container.decode(String?.self, forKey: .id)
    }
    if container.contains(.metricValues) {
        self.metricValues = try container.decode([ResourceMetricValueData?]?.self, forKey: .metricValues)
    }
    if container.contains(.properties) {
        self.properties = try container.decode([ResourceMetricPropertyData?]?.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 as! ResourceMetricNameData?, forKey: .name)}
    if self.unit != nil {try container.encode(self.unit, forKey: .unit)}
    if self.timeGrain != nil {try container.encode(self.timeGrain, forKey: .timeGrain)}
    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.resourceId != nil {try container.encode(self.resourceId, forKey: .resourceId)}
    if self.id != nil {try container.encode(self.id, forKey: .id)}
    if self.metricValues != nil {try container.encode(self.metricValues as! [ResourceMetricValueData?]?, forKey: .metricValues)}
    if self.properties != nil {try container.encode(self.properties as! [ResourceMetricPropertyData?]?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createResourceMetricProtocol() -> ResourceMetricProtocol {
    return ResourceMetricData()
  }
}