// 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 InteractionTypeDefinitionData : InteractionTypeDefinitionProtocol, EntityTypeDefinitionProtocol, MetadataDefinitionBaseProtocol {
    public var attributes: [String:[String]?]?
    public var description: [String:String]?
    public var displayName: [String:String]?
    public var localizedAttributes: [String:[String:String]?]?
    public var smallImage: String?
    public var mediumImage: String?
    public var largeImage: String?
    public var apiEntitySetName: String?
    public var entityType: EntityTypesEnum?
    public var fields: [PropertyDefinitionProtocol?]?
    public var instancesCount: Int32?
    public var lastChangedUtc: Date?
    public var provisioningState: ProvisioningStatesEnum?
    public var schemaItemTypeLink: String?
    public var tenantId: String?
    public var timestampFieldName: String?
    public var typeName: String?
    public var idPropertyNames: [String]?
    public var participantProfiles: [ParticipantProtocol?]?
    public var primaryParticipantProfilePropertyName: String?
    public var dataSourcePrecedenceRules: [DataSourcePrecedenceProtocol?]?
    public var defaultDataSource: DataSourceProtocol?
    public var isActivity: Bool?

        enum CodingKeys: String, CodingKey {case attributes = "attributes"
        case description = "description"
        case displayName = "displayName"
        case localizedAttributes = "localizedAttributes"
        case smallImage = "smallImage"
        case mediumImage = "mediumImage"
        case largeImage = "largeImage"
        case apiEntitySetName = "apiEntitySetName"
        case entityType = "entityType"
        case fields = "fields"
        case instancesCount = "instancesCount"
        case lastChangedUtc = "lastChangedUtc"
        case provisioningState = "provisioningState"
        case schemaItemTypeLink = "schemaItemTypeLink"
        case tenantId = "tenantId"
        case timestampFieldName = "timestampFieldName"
        case typeName = "typeName"
        case idPropertyNames = "idPropertyNames"
        case participantProfiles = "participantProfiles"
        case primaryParticipantProfilePropertyName = "primaryParticipantProfilePropertyName"
        case dataSourcePrecedenceRules = "dataSourcePrecedenceRules"
        case defaultDataSource = "defaultDataSource"
        case isActivity = "isActivity"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.attributes) {
        self.attributes = try container.decode([String:[String]?]?.self, forKey: .attributes)
    }
    if container.contains(.description) {
        self.description = try container.decode([String:String]?.self, forKey: .description)
    }
    if container.contains(.displayName) {
        self.displayName = try container.decode([String:String]?.self, forKey: .displayName)
    }
    if container.contains(.localizedAttributes) {
        self.localizedAttributes = try container.decode([String:[String:String]?]?.self, forKey: .localizedAttributes)
    }
    if container.contains(.smallImage) {
        self.smallImage = try container.decode(String?.self, forKey: .smallImage)
    }
    if container.contains(.mediumImage) {
        self.mediumImage = try container.decode(String?.self, forKey: .mediumImage)
    }
    if container.contains(.largeImage) {
        self.largeImage = try container.decode(String?.self, forKey: .largeImage)
    }
    if container.contains(.apiEntitySetName) {
        self.apiEntitySetName = try container.decode(String?.self, forKey: .apiEntitySetName)
    }
    if container.contains(.entityType) {
        self.entityType = try container.decode(EntityTypesEnum?.self, forKey: .entityType)
    }
    if container.contains(.fields) {
        self.fields = try container.decode([PropertyDefinitionData?]?.self, forKey: .fields)
    }
    if container.contains(.instancesCount) {
        self.instancesCount = try container.decode(Int32?.self, forKey: .instancesCount)
    }
    if container.contains(.lastChangedUtc) {
        self.lastChangedUtc = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastChangedUtc)), format: .dateTime)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(ProvisioningStatesEnum?.self, forKey: .provisioningState)
    }
    if container.contains(.schemaItemTypeLink) {
        self.schemaItemTypeLink = try container.decode(String?.self, forKey: .schemaItemTypeLink)
    }
    if container.contains(.tenantId) {
        self.tenantId = try container.decode(String?.self, forKey: .tenantId)
    }
    if container.contains(.timestampFieldName) {
        self.timestampFieldName = try container.decode(String?.self, forKey: .timestampFieldName)
    }
    if container.contains(.typeName) {
        self.typeName = try container.decode(String?.self, forKey: .typeName)
    }
    if container.contains(.idPropertyNames) {
        self.idPropertyNames = try container.decode([String]?.self, forKey: .idPropertyNames)
    }
    if container.contains(.participantProfiles) {
        self.participantProfiles = try container.decode([ParticipantData?]?.self, forKey: .participantProfiles)
    }
    if container.contains(.primaryParticipantProfilePropertyName) {
        self.primaryParticipantProfilePropertyName = try container.decode(String?.self, forKey: .primaryParticipantProfilePropertyName)
    }
    if container.contains(.dataSourcePrecedenceRules) {
        self.dataSourcePrecedenceRules = try container.decode([DataSourcePrecedenceData?]?.self, forKey: .dataSourcePrecedenceRules)
    }
    if container.contains(.defaultDataSource) {
        self.defaultDataSource = try container.decode(DataSourceData?.self, forKey: .defaultDataSource)
    }
    if container.contains(.isActivity) {
        self.isActivity = try container.decode(Bool?.self, forKey: .isActivity)
    }
    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.attributes != nil {try container.encode(self.attributes, forKey: .attributes)}
    if self.description != nil {try container.encode(self.description, forKey: .description)}
    if self.displayName != nil {try container.encode(self.displayName, forKey: .displayName)}
    if self.localizedAttributes != nil {try container.encode(self.localizedAttributes, forKey: .localizedAttributes)}
    if self.smallImage != nil {try container.encode(self.smallImage, forKey: .smallImage)}
    if self.mediumImage != nil {try container.encode(self.mediumImage, forKey: .mediumImage)}
    if self.largeImage != nil {try container.encode(self.largeImage, forKey: .largeImage)}
    if self.apiEntitySetName != nil {try container.encode(self.apiEntitySetName, forKey: .apiEntitySetName)}
    if self.entityType != nil {try container.encode(self.entityType, forKey: .entityType)}
    if self.fields != nil {try container.encode(self.fields as! [PropertyDefinitionData?]?, forKey: .fields)}
    if self.instancesCount != nil {try container.encode(self.instancesCount, forKey: .instancesCount)}
    if self.lastChangedUtc != nil {
        try container.encode(DateConverter.toString(date: self.lastChangedUtc!, format: .dateTime), forKey: .lastChangedUtc)
    }
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.schemaItemTypeLink != nil {try container.encode(self.schemaItemTypeLink, forKey: .schemaItemTypeLink)}
    if self.tenantId != nil {try container.encode(self.tenantId, forKey: .tenantId)}
    if self.timestampFieldName != nil {try container.encode(self.timestampFieldName, forKey: .timestampFieldName)}
    if self.typeName != nil {try container.encode(self.typeName, forKey: .typeName)}
    if self.idPropertyNames != nil {try container.encode(self.idPropertyNames as! [String]?, forKey: .idPropertyNames)}
    if self.participantProfiles != nil {try container.encode(self.participantProfiles as! [ParticipantData?]?, forKey: .participantProfiles)}
    if self.primaryParticipantProfilePropertyName != nil {try container.encode(self.primaryParticipantProfilePropertyName, forKey: .primaryParticipantProfilePropertyName)}
    if self.dataSourcePrecedenceRules != nil {try container.encode(self.dataSourcePrecedenceRules as! [DataSourcePrecedenceData?]?, forKey: .dataSourcePrecedenceRules)}
    if self.defaultDataSource != nil {try container.encode(self.defaultDataSource as! DataSourceData?, forKey: .defaultDataSource)}
    if self.isActivity != nil {try container.encode(self.isActivity, forKey: .isActivity)}
  }
}

extension DataFactory {
  public static func createInteractionTypeDefinitionProtocol() -> InteractionTypeDefinitionProtocol {
    return InteractionTypeDefinitionData()
  }
}


// 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 KpiAliasData : KpiAliasProtocol {
    public var aliasName: String
    public var expression: String

        enum CodingKeys: String, CodingKey {case aliasName = "aliasName"
        case expression = "expression"
        }

  public init(aliasName: String, expression: String)  {
    self.aliasName = aliasName
    self.expression = expression
  }

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

extension DataFactory {
  public static func createKpiAliasProtocol(aliasName: String, expression: String) -> KpiAliasProtocol {
    return KpiAliasData(aliasName: aliasName, expression: expression)
  }
}


// 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 KpiDefinitionData : KpiDefinitionProtocol {
    public var entityType: EntityTypesEnum
    public var entityTypeName: String
    public var tenantId: String?
    public var kpiName: String?
    public var displayName: [String:String]?
    public var description: [String:String]?
    public var calculationWindow: CalculationWindowTypesEnum
    public var calculationWindowFieldName: String?
    public var function: KpiFunctionsEnum
    public var expression: String
    public var unit: String?
    public var filter: String?
    public var groupBy: [String]?
    public var groupByMetadata: [KpiGroupByMetadataProtocol?]?
    public var participantProfilesMetadata: [KpiParticipantProfilesMetadataProtocol?]?
    public var provisioningState: ProvisioningStatesEnum?
    public var thresHolds: KpiThresholdsProtocol?
    public var aliases: [KpiAliasProtocol?]?
    public var extracts: [KpiExtractProtocol?]?

        enum CodingKeys: String, CodingKey {case entityType = "entityType"
        case entityTypeName = "entityTypeName"
        case tenantId = "tenantId"
        case kpiName = "kpiName"
        case displayName = "displayName"
        case description = "description"
        case calculationWindow = "calculationWindow"
        case calculationWindowFieldName = "calculationWindowFieldName"
        case function = "function"
        case expression = "expression"
        case unit = "unit"
        case filter = "filter"
        case groupBy = "groupBy"
        case groupByMetadata = "groupByMetadata"
        case participantProfilesMetadata = "participantProfilesMetadata"
        case provisioningState = "provisioningState"
        case thresHolds = "thresHolds"
        case aliases = "aliases"
        case extracts = "extracts"
        }

  public init(entityType: EntityTypesEnum, entityTypeName: String, calculationWindow: CalculationWindowTypesEnum, function: KpiFunctionsEnum, expression: String)  {
    self.entityType = entityType
    self.entityTypeName = entityTypeName
    self.calculationWindow = calculationWindow
    self.function = function
    self.expression = expression
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.entityType = try container.decode(EntityTypesEnum.self, forKey: .entityType)
    self.entityTypeName = try container.decode(String.self, forKey: .entityTypeName)
    if container.contains(.tenantId) {
        self.tenantId = try container.decode(String?.self, forKey: .tenantId)
    }
    if container.contains(.kpiName) {
        self.kpiName = try container.decode(String?.self, forKey: .kpiName)
    }
    if container.contains(.displayName) {
        self.displayName = try container.decode([String:String]?.self, forKey: .displayName)
    }
    if container.contains(.description) {
        self.description = try container.decode([String:String]?.self, forKey: .description)
    }
    self.calculationWindow = try container.decode(CalculationWindowTypesEnum.self, forKey: .calculationWindow)
    if container.contains(.calculationWindowFieldName) {
        self.calculationWindowFieldName = try container.decode(String?.self, forKey: .calculationWindowFieldName)
    }
    self.function = try container.decode(KpiFunctionsEnum.self, forKey: .function)
    self.expression = try container.decode(String.self, forKey: .expression)
    if container.contains(.unit) {
        self.unit = try container.decode(String?.self, forKey: .unit)
    }
    if container.contains(.filter) {
        self.filter = try container.decode(String?.self, forKey: .filter)
    }
    if container.contains(.groupBy) {
        self.groupBy = try container.decode([String]?.self, forKey: .groupBy)
    }
    if container.contains(.groupByMetadata) {
        self.groupByMetadata = try container.decode([KpiGroupByMetadataData?]?.self, forKey: .groupByMetadata)
    }
    if container.contains(.participantProfilesMetadata) {
        self.participantProfilesMetadata = try container.decode([KpiParticipantProfilesMetadataData?]?.self, forKey: .participantProfilesMetadata)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(ProvisioningStatesEnum?.self, forKey: .provisioningState)
    }
    if container.contains(.thresHolds) {
        self.thresHolds = try container.decode(KpiThresholdsData?.self, forKey: .thresHolds)
    }
    if container.contains(.aliases) {
        self.aliases = try container.decode([KpiAliasData?]?.self, forKey: .aliases)
    }
    if container.contains(.extracts) {
        self.extracts = try container.decode([KpiExtractData?]?.self, forKey: .extracts)
    }
    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.entityType, forKey: .entityType)
    try container.encode(self.entityTypeName, forKey: .entityTypeName)
    if self.tenantId != nil {try container.encode(self.tenantId, forKey: .tenantId)}
    if self.kpiName != nil {try container.encode(self.kpiName, forKey: .kpiName)}
    if self.displayName != nil {try container.encode(self.displayName, forKey: .displayName)}
    if self.description != nil {try container.encode(self.description, forKey: .description)}
    try container.encode(self.calculationWindow, forKey: .calculationWindow)
    if self.calculationWindowFieldName != nil {try container.encode(self.calculationWindowFieldName, forKey: .calculationWindowFieldName)}
    try container.encode(self.function, forKey: .function)
    try container.encode(self.expression, forKey: .expression)
    if self.unit != nil {try container.encode(self.unit, forKey: .unit)}
    if self.filter != nil {try container.encode(self.filter, forKey: .filter)}
    if self.groupBy != nil {try container.encode(self.groupBy as! [String]?, forKey: .groupBy)}
    if self.groupByMetadata != nil {try container.encode(self.groupByMetadata as! [KpiGroupByMetadataData?]?, forKey: .groupByMetadata)}
    if self.participantProfilesMetadata != nil {try container.encode(self.participantProfilesMetadata as! [KpiParticipantProfilesMetadataData?]?, forKey: .participantProfilesMetadata)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.thresHolds != nil {try container.encode(self.thresHolds as! KpiThresholdsData?, forKey: .thresHolds)}
    if self.aliases != nil {try container.encode(self.aliases as! [KpiAliasData?]?, forKey: .aliases)}
    if self.extracts != nil {try container.encode(self.extracts as! [KpiExtractData?]?, forKey: .extracts)}
  }
}

extension DataFactory {
  public static func createKpiDefinitionProtocol(entityType: EntityTypesEnum, entityTypeName: String, calculationWindow: CalculationWindowTypesEnum, function: KpiFunctionsEnum, expression: String) -> KpiDefinitionProtocol {
    return KpiDefinitionData(entityType: entityType, entityTypeName: entityTypeName, calculationWindow: calculationWindow, function: function, expression: expression)
  }
}


// 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 KpiExtractData : KpiExtractProtocol {
    public var extractName: String
    public var expression: String

        enum CodingKeys: String, CodingKey {case extractName = "extractName"
        case expression = "expression"
        }

  public init(extractName: String, expression: String)  {
    self.extractName = extractName
    self.expression = expression
  }

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

extension DataFactory {
  public static func createKpiExtractProtocol(extractName: String, expression: String) -> KpiExtractProtocol {
    return KpiExtractData(extractName: extractName, expression: expression)
  }
}


// KpiFunctions enumerates the values for kpi functions.

// 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 KpiFunctionsEnum: String, Codable
{
// KpiFunctionsAvg specifies the kpi functions avg state for kpi functions.
    case KpiFunctionsAvg = "Avg"
// KpiFunctionsCount specifies the kpi functions count state for kpi functions.
    case KpiFunctionsCount = "Count"
// KpiFunctionsCountDistinct specifies the kpi functions count distinct state for kpi functions.
    case KpiFunctionsCountDistinct = "CountDistinct"
// KpiFunctionsLast specifies the kpi functions last state for kpi functions.
    case KpiFunctionsLast = "Last"
// KpiFunctionsMax specifies the kpi functions max state for kpi functions.
    case KpiFunctionsMax = "Max"
// KpiFunctionsMin specifies the kpi functions min state for kpi functions.
    case KpiFunctionsMin = "Min"
// KpiFunctionsNone specifies the kpi functions none state for kpi functions.
    case KpiFunctionsNone = "None"
// KpiFunctionsSum specifies the kpi functions sum state for kpi functions.
    case KpiFunctionsSum = "Sum"
}


// 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 KpiGroupByMetadataData : KpiGroupByMetadataProtocol {
    public var displayName: [String:String]?
    public var fieldName: String?
    public var fieldType: String?

        enum CodingKeys: String, CodingKey {case displayName = "displayName"
        case fieldName = "fieldName"
        case fieldType = "fieldType"
        }

  public init()  {
  }

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

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

extension DataFactory {
  public static func createKpiGroupByMetadataProtocol() -> KpiGroupByMetadataProtocol {
    return KpiGroupByMetadataData()
  }
}


// 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 KpiListResultData : KpiListResultProtocol {
    public var value: [KpiResourceFormatProtocol?]?
    public var _nextLink: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createKpiListResultProtocol() -> KpiListResultProtocol {
    return KpiListResultData()
  }
}


// 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 KpiParticipantProfilesMetadataData : KpiParticipantProfilesMetadataProtocol {
    public var typeName: String

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

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

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

extension DataFactory {
  public static func createKpiParticipantProfilesMetadataProtocol(typeName: String) -> KpiParticipantProfilesMetadataProtocol {
    return KpiParticipantProfilesMetadataData(typeName: typeName)
  }
}


// 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 KpiResourceFormatData : KpiResourceFormatProtocol, ProxyResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: KpiDefinitionProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createKpiResourceFormatProtocol() -> KpiResourceFormatProtocol {
    return KpiResourceFormatData()
  }
}


// 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 KpiThresholdsData : KpiThresholdsProtocol {
    public var lowerLimit: Decimal
    public var upperLimit: Decimal
    public var increasingKpi: Bool

        enum CodingKeys: String, CodingKey {case lowerLimit = "lowerLimit"
        case upperLimit = "upperLimit"
        case increasingKpi = "increasingKpi"
        }

  public init(lowerLimit: Decimal, upperLimit: Decimal, increasingKpi: Bool)  {
    self.lowerLimit = lowerLimit
    self.upperLimit = upperLimit
    self.increasingKpi = increasingKpi
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.lowerLimit = try container.decode(Decimal.self, forKey: .lowerLimit)
    self.upperLimit = try container.decode(Decimal.self, forKey: .upperLimit)
    self.increasingKpi = try container.decode(Bool.self, forKey: .increasingKpi)
    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.lowerLimit, forKey: .lowerLimit)
    try container.encode(self.upperLimit, forKey: .upperLimit)
    try container.encode(self.increasingKpi, forKey: .increasingKpi)
  }
}

extension DataFactory {
  public static func createKpiThresholdsProtocol(lowerLimit: Decimal, upperLimit: Decimal, increasingKpi: Bool) -> KpiThresholdsProtocol {
    return KpiThresholdsData(lowerLimit: lowerLimit, upperLimit: upperLimit, increasingKpi: increasingKpi)
  }
}


// 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 LinkDefinitionData : LinkDefinitionProtocol {
    public var tenantId: String?
    public var linkName: String?
    public var sourceEntityType: EntityTypeEnum
    public var targetEntityType: EntityTypeEnum
    public var sourceEntityTypeName: String
    public var targetEntityTypeName: String
    public var displayName: [String:String]?
    public var description: [String:String]?
    public var mappings: [TypePropertiesMappingProtocol?]?
    public var participantPropertyReferences: [ParticipantPropertyReferenceProtocol]
    public var provisioningState: ProvisioningStatesEnum?
    public var referenceOnly: Bool?
    public var operationType: InstanceOperationTypeEnum?

        enum CodingKeys: String, CodingKey {case tenantId = "tenantId"
        case linkName = "linkName"
        case sourceEntityType = "sourceEntityType"
        case targetEntityType = "targetEntityType"
        case sourceEntityTypeName = "sourceEntityTypeName"
        case targetEntityTypeName = "targetEntityTypeName"
        case displayName = "displayName"
        case description = "description"
        case mappings = "mappings"
        case participantPropertyReferences = "participantPropertyReferences"
        case provisioningState = "provisioningState"
        case referenceOnly = "referenceOnly"
        case operationType = "operationType"
        }

  public init(sourceEntityType: EntityTypeEnum, targetEntityType: EntityTypeEnum, sourceEntityTypeName: String, targetEntityTypeName: String, participantPropertyReferences: [ParticipantPropertyReferenceProtocol])  {
    self.sourceEntityType = sourceEntityType
    self.targetEntityType = targetEntityType
    self.sourceEntityTypeName = sourceEntityTypeName
    self.targetEntityTypeName = targetEntityTypeName
    self.participantPropertyReferences = participantPropertyReferences
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.tenantId) {
        self.tenantId = try container.decode(String?.self, forKey: .tenantId)
    }
    if container.contains(.linkName) {
        self.linkName = try container.decode(String?.self, forKey: .linkName)
    }
    self.sourceEntityType = try container.decode(EntityTypeEnum.self, forKey: .sourceEntityType)
    self.targetEntityType = try container.decode(EntityTypeEnum.self, forKey: .targetEntityType)
    self.sourceEntityTypeName = try container.decode(String.self, forKey: .sourceEntityTypeName)
    self.targetEntityTypeName = try container.decode(String.self, forKey: .targetEntityTypeName)
    if container.contains(.displayName) {
        self.displayName = try container.decode([String:String]?.self, forKey: .displayName)
    }
    if container.contains(.description) {
        self.description = try container.decode([String:String]?.self, forKey: .description)
    }
    if container.contains(.mappings) {
        self.mappings = try container.decode([TypePropertiesMappingData?]?.self, forKey: .mappings)
    }
    self.participantPropertyReferences = try container.decode([ParticipantPropertyReferenceData].self, forKey: .participantPropertyReferences)
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(ProvisioningStatesEnum?.self, forKey: .provisioningState)
    }
    if container.contains(.referenceOnly) {
        self.referenceOnly = try container.decode(Bool?.self, forKey: .referenceOnly)
    }
    if container.contains(.operationType) {
        self.operationType = try container.decode(InstanceOperationTypeEnum?.self, forKey: .operationType)
    }
    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.tenantId != nil {try container.encode(self.tenantId, forKey: .tenantId)}
    if self.linkName != nil {try container.encode(self.linkName, forKey: .linkName)}
    try container.encode(self.sourceEntityType, forKey: .sourceEntityType)
    try container.encode(self.targetEntityType, forKey: .targetEntityType)
    try container.encode(self.sourceEntityTypeName, forKey: .sourceEntityTypeName)
    try container.encode(self.targetEntityTypeName, forKey: .targetEntityTypeName)
    if self.displayName != nil {try container.encode(self.displayName, forKey: .displayName)}
    if self.description != nil {try container.encode(self.description, forKey: .description)}
    if self.mappings != nil {try container.encode(self.mappings as! [TypePropertiesMappingData?]?, forKey: .mappings)}
    try container.encode(self.participantPropertyReferences as! [ParticipantPropertyReferenceData], forKey: .participantPropertyReferences)
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.referenceOnly != nil {try container.encode(self.referenceOnly, forKey: .referenceOnly)}
    if self.operationType != nil {try container.encode(self.operationType, forKey: .operationType)}
  }
}

extension DataFactory {
  public static func createLinkDefinitionProtocol(sourceEntityType: EntityTypeEnum, targetEntityType: EntityTypeEnum, sourceEntityTypeName: String, targetEntityTypeName: String, participantPropertyReferences: [ParticipantPropertyReferenceProtocol]) -> LinkDefinitionProtocol {
    return LinkDefinitionData(sourceEntityType: sourceEntityType, targetEntityType: targetEntityType, sourceEntityTypeName: sourceEntityTypeName, targetEntityTypeName: targetEntityTypeName, participantPropertyReferences: participantPropertyReferences)
  }
}


// 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 LinkListResultData : LinkListResultProtocol {
    public var value: [LinkResourceFormatProtocol?]?
    public var _nextLink: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createLinkListResultProtocol() -> LinkListResultProtocol {
    return LinkListResultData()
  }
}


// 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 LinkResourceFormatData : LinkResourceFormatProtocol, ProxyResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: LinkDefinitionProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createLinkResourceFormatProtocol() -> LinkResourceFormatProtocol {
    return LinkResourceFormatData()
  }
}


// LinkTypes enumerates the values for link types.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum LinkTypesEnum: String, Codable
{
// CopyIfNull specifies the copy if null state for link types.
    case CopyIfNull = "CopyIfNull"
// UpdateAlways specifies the update always state for link types.
    case UpdateAlways = "UpdateAlways"
}


// 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 MetadataDefinitionBaseData : MetadataDefinitionBaseProtocol {
    public var attributes: [String:[String]?]?
    public var description: [String:String]?
    public var displayName: [String:String]?
    public var localizedAttributes: [String:[String:String]?]?
    public var smallImage: String?
    public var mediumImage: String?
    public var largeImage: String?

        enum CodingKeys: String, CodingKey {case attributes = "attributes"
        case description = "description"
        case displayName = "displayName"
        case localizedAttributes = "localizedAttributes"
        case smallImage = "smallImage"
        case mediumImage = "mediumImage"
        case largeImage = "largeImage"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createMetadataDefinitionBaseProtocol() -> MetadataDefinitionBaseProtocol {
    return MetadataDefinitionBaseData()
  }
}


// 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 OperationData : OperationProtocol {
    public var name: String?
    public var display: OperationDisplayProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createOperationProtocol() -> OperationProtocol {
    return OperationData()
  }
}


// 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 OperationDisplayData : OperationDisplayProtocol {
    public var provider: String?
    public var resource: String?
    public var operation: String?

        enum CodingKeys: String, CodingKey {case provider = "provider"
        case resource = "resource"
        case operation = "operation"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createOperationDisplayProtocol() -> OperationDisplayProtocol {
    return OperationDisplayData()
  }
}


// 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 OperationListResultData : OperationListResultProtocol {
    public var value: [OperationProtocol?]?
    public var _nextLink: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createOperationListResultProtocol() -> OperationListResultProtocol {
    return OperationListResultData()
  }
}


// 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 ParticipantData : ParticipantProtocol {
    public var profileTypeName: String
    public var participantPropertyReferences: [ParticipantPropertyReferenceProtocol]
    public var participantName: String
    public var displayName: [String:String]?
    public var description: [String:String]?
    public var role: String?

        enum CodingKeys: String, CodingKey {case profileTypeName = "profileTypeName"
        case participantPropertyReferences = "participantPropertyReferences"
        case participantName = "participantName"
        case displayName = "displayName"
        case description = "description"
        case role = "role"
        }

  public init(profileTypeName: String, participantPropertyReferences: [ParticipantPropertyReferenceProtocol], participantName: String)  {
    self.profileTypeName = profileTypeName
    self.participantPropertyReferences = participantPropertyReferences
    self.participantName = participantName
  }

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

extension DataFactory {
  public static func createParticipantProtocol(profileTypeName: String, participantPropertyReferences: [ParticipantPropertyReferenceProtocol], participantName: String) -> ParticipantProtocol {
    return ParticipantData(profileTypeName: profileTypeName, participantPropertyReferences: participantPropertyReferences, participantName: participantName)
  }
}


// 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 ParticipantProfilePropertyReferenceData : ParticipantProfilePropertyReferenceProtocol {
    public var interactionPropertyName: String
    public var profilePropertyName: String

        enum CodingKeys: String, CodingKey {case interactionPropertyName = "interactionPropertyName"
        case profilePropertyName = "profilePropertyName"
        }

  public init(interactionPropertyName: String, profilePropertyName: String)  {
    self.interactionPropertyName = interactionPropertyName
    self.profilePropertyName = profilePropertyName
  }

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

extension DataFactory {
  public static func createParticipantProfilePropertyReferenceProtocol(interactionPropertyName: String, profilePropertyName: String) -> ParticipantProfilePropertyReferenceProtocol {
    return ParticipantProfilePropertyReferenceData(interactionPropertyName: interactionPropertyName, profilePropertyName: profilePropertyName)
  }
}


// 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 ParticipantPropertyReferenceData : ParticipantPropertyReferenceProtocol {
    public var sourcePropertyName: String
    public var targetPropertyName: String

        enum CodingKeys: String, CodingKey {case sourcePropertyName = "sourcePropertyName"
        case targetPropertyName = "targetPropertyName"
        }

  public init(sourcePropertyName: String, targetPropertyName: String)  {
    self.sourcePropertyName = sourcePropertyName
    self.targetPropertyName = targetPropertyName
  }

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

extension DataFactory {
  public static func createParticipantPropertyReferenceProtocol(sourcePropertyName: String, targetPropertyName: String) -> ParticipantPropertyReferenceProtocol {
    return ParticipantPropertyReferenceData(sourcePropertyName: sourcePropertyName, targetPropertyName: targetPropertyName)
  }
}


// PermissionTypes enumerates the values for permission types.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum PermissionTypesEnum: String, Codable
{
// Manage specifies the manage state for permission types.
    case Manage = "Manage"
// Read specifies the read state for permission types.
    case Read = "Read"
// Write specifies the write state for permission types.
    case Write = "Write"
}


// 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 PredictionData : PredictionProtocol {
    public var description: [String:String]?
    public var displayName: [String:String]?
    public var involvedInteractionTypes: [String]?
    public var involvedKpiTypes: [String]?
    public var involvedRelationships: [String]?
    public var negativeOutcomeExpression: String
    public var positiveOutcomeExpression: String
    public var primaryProfileType: String
    public var provisioningState: ProvisioningStatesEnum?
    public var predictionName: String?
    public var scopeExpression: String
    public var tenantId: String?
    public var autoAnalyze: Bool
    public var mappings: PredictionMappingsProtocol
    public var scoreLabel: String
    public var grades: [PredictionGradesItemProtocol?]?
    public var systemGeneratedEntities: PredictionSystemGeneratedEntitiesProtocol?

        enum CodingKeys: String, CodingKey {case description = "description"
        case displayName = "displayName"
        case involvedInteractionTypes = "involvedInteractionTypes"
        case involvedKpiTypes = "involvedKpiTypes"
        case involvedRelationships = "involvedRelationships"
        case negativeOutcomeExpression = "negativeOutcomeExpression"
        case positiveOutcomeExpression = "positiveOutcomeExpression"
        case primaryProfileType = "primaryProfileType"
        case provisioningState = "provisioningState"
        case predictionName = "predictionName"
        case scopeExpression = "scopeExpression"
        case tenantId = "tenantId"
        case autoAnalyze = "autoAnalyze"
        case mappings = "mappings"
        case scoreLabel = "scoreLabel"
        case grades = "grades"
        case systemGeneratedEntities = "systemGeneratedEntities"
        }

  public init(negativeOutcomeExpression: String, positiveOutcomeExpression: String, primaryProfileType: String, scopeExpression: String, autoAnalyze: Bool, mappings: PredictionMappingsProtocol, scoreLabel: String)  {
    self.negativeOutcomeExpression = negativeOutcomeExpression
    self.positiveOutcomeExpression = positiveOutcomeExpression
    self.primaryProfileType = primaryProfileType
    self.scopeExpression = scopeExpression
    self.autoAnalyze = autoAnalyze
    self.mappings = mappings
    self.scoreLabel = scoreLabel
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.description) {
        self.description = try container.decode([String:String]?.self, forKey: .description)
    }
    if container.contains(.displayName) {
        self.displayName = try container.decode([String:String]?.self, forKey: .displayName)
    }
    if container.contains(.involvedInteractionTypes) {
        self.involvedInteractionTypes = try container.decode([String]?.self, forKey: .involvedInteractionTypes)
    }
    if container.contains(.involvedKpiTypes) {
        self.involvedKpiTypes = try container.decode([String]?.self, forKey: .involvedKpiTypes)
    }
    if container.contains(.involvedRelationships) {
        self.involvedRelationships = try container.decode([String]?.self, forKey: .involvedRelationships)
    }
    self.negativeOutcomeExpression = try container.decode(String.self, forKey: .negativeOutcomeExpression)
    self.positiveOutcomeExpression = try container.decode(String.self, forKey: .positiveOutcomeExpression)
    self.primaryProfileType = try container.decode(String.self, forKey: .primaryProfileType)
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(ProvisioningStatesEnum?.self, forKey: .provisioningState)
    }
    if container.contains(.predictionName) {
        self.predictionName = try container.decode(String?.self, forKey: .predictionName)
    }
    self.scopeExpression = try container.decode(String.self, forKey: .scopeExpression)
    if container.contains(.tenantId) {
        self.tenantId = try container.decode(String?.self, forKey: .tenantId)
    }
    self.autoAnalyze = try container.decode(Bool.self, forKey: .autoAnalyze)
    self.mappings = try container.decode(PredictionMappingsData.self, forKey: .mappings)
    self.scoreLabel = try container.decode(String.self, forKey: .scoreLabel)
    if container.contains(.grades) {
        self.grades = try container.decode([PredictionGradesItemData?]?.self, forKey: .grades)
    }
    if container.contains(.systemGeneratedEntities) {
        self.systemGeneratedEntities = try container.decode(PredictionSystemGeneratedEntitiesData?.self, forKey: .systemGeneratedEntities)
    }
    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.description != nil {try container.encode(self.description, forKey: .description)}
    if self.displayName != nil {try container.encode(self.displayName, forKey: .displayName)}
    if self.involvedInteractionTypes != nil {try container.encode(self.involvedInteractionTypes as! [String]?, forKey: .involvedInteractionTypes)}
    if self.involvedKpiTypes != nil {try container.encode(self.involvedKpiTypes as! [String]?, forKey: .involvedKpiTypes)}
    if self.involvedRelationships != nil {try container.encode(self.involvedRelationships as! [String]?, forKey: .involvedRelationships)}
    try container.encode(self.negativeOutcomeExpression, forKey: .negativeOutcomeExpression)
    try container.encode(self.positiveOutcomeExpression, forKey: .positiveOutcomeExpression)
    try container.encode(self.primaryProfileType, forKey: .primaryProfileType)
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.predictionName != nil {try container.encode(self.predictionName, forKey: .predictionName)}
    try container.encode(self.scopeExpression, forKey: .scopeExpression)
    if self.tenantId != nil {try container.encode(self.tenantId, forKey: .tenantId)}
    try container.encode(self.autoAnalyze, forKey: .autoAnalyze)
    try container.encode(self.mappings as! PredictionMappingsData, forKey: .mappings)
    try container.encode(self.scoreLabel, forKey: .scoreLabel)
    if self.grades != nil {try container.encode(self.grades as! [PredictionGradesItemData?]?, forKey: .grades)}
    if self.systemGeneratedEntities != nil {try container.encode(self.systemGeneratedEntities as! PredictionSystemGeneratedEntitiesData?, forKey: .systemGeneratedEntities)}
  }
}

extension DataFactory {
  public static func createPredictionProtocol(negativeOutcomeExpression: String, positiveOutcomeExpression: String, primaryProfileType: String, scopeExpression: String, autoAnalyze: Bool, mappings: PredictionMappingsProtocol, scoreLabel: String) -> PredictionProtocol {
    return PredictionData(negativeOutcomeExpression: negativeOutcomeExpression, positiveOutcomeExpression: positiveOutcomeExpression, primaryProfileType: primaryProfileType, scopeExpression: scopeExpression, autoAnalyze: autoAnalyze, mappings: mappings, scoreLabel: scoreLabel)
  }
}


// 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 PredictionDistributionDefinitionData : PredictionDistributionDefinitionProtocol {
    public var totalPositives: Int64?
    public var totalNegatives: Int64?
    public var distributions: [PredictionDistributionDefinitionDistributionsItemProtocol?]?

        enum CodingKeys: String, CodingKey {case totalPositives = "totalPositives"
        case totalNegatives = "totalNegatives"
        case distributions = "distributions"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createPredictionDistributionDefinitionProtocol() -> PredictionDistributionDefinitionProtocol {
    return PredictionDistributionDefinitionData()
  }
}


// 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 PredictionDistributionDefinitionDistributionsItemData : PredictionDistributionDefinitionDistributionsItemProtocol {
    public var scoreThreshold: Int32?
    public var positives: Int64?
    public var negatives: Int64?
    public var positivesAboveThreshold: Int64?
    public var negativesAboveThreshold: Int64?

        enum CodingKeys: String, CodingKey {case scoreThreshold = "scoreThreshold"
        case positives = "positives"
        case negatives = "negatives"
        case positivesAboveThreshold = "positivesAboveThreshold"
        case negativesAboveThreshold = "negativesAboveThreshold"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createPredictionDistributionDefinitionDistributionsItemProtocol() -> PredictionDistributionDefinitionDistributionsItemProtocol {
    return PredictionDistributionDefinitionDistributionsItemData()
  }
}


// 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 PredictionGradesItemData : PredictionGradesItemProtocol {
    public var gradeName: String?
    public var minScoreThreshold: Int32?
    public var maxScoreThreshold: Int32?

        enum CodingKeys: String, CodingKey {case gradeName = "gradeName"
        case minScoreThreshold = "minScoreThreshold"
        case maxScoreThreshold = "maxScoreThreshold"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createPredictionGradesItemProtocol() -> PredictionGradesItemProtocol {
    return PredictionGradesItemData()
  }
}


// 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 PredictionListResultData : PredictionListResultProtocol {
    public var value: [PredictionResourceFormatProtocol?]?
    public var _nextLink: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createPredictionListResultProtocol() -> PredictionListResultProtocol {
    return PredictionListResultData()
  }
}


// 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 PredictionMappingsData : PredictionMappingsProtocol {
    public var score: String?
    public var grade: String?
    public var reason: String?

        enum CodingKeys: String, CodingKey {case score = "score"
        case grade = "grade"
        case reason = "reason"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createPredictionMappingsProtocol() -> PredictionMappingsProtocol {
    return PredictionMappingsData()
  }
}


// PredictionModelLifeCycle enumerates the values for prediction model life cycle.

// 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 PredictionModelLifeCycleEnum: String, Codable
{
// PredictionModelLifeCycleActive specifies the prediction model life cycle active state for prediction model life
// cycle.
    case PredictionModelLifeCycleActive = "Active"
// PredictionModelLifeCycleDeleted specifies the prediction model life cycle deleted state for prediction model life
// cycle.
    case PredictionModelLifeCycleDeleted = "Deleted"
// PredictionModelLifeCycleDiscovering specifies the prediction model life cycle discovering state for prediction model
// life cycle.
    case PredictionModelLifeCycleDiscovering = "Discovering"
// PredictionModelLifeCycleEvaluating specifies the prediction model life cycle evaluating state for prediction model
// life cycle.
    case PredictionModelLifeCycleEvaluating = "Evaluating"
// PredictionModelLifeCycleEvaluatingFailed specifies the prediction model life cycle evaluating failed state for
// prediction model life cycle.
    case PredictionModelLifeCycleEvaluatingFailed = "EvaluatingFailed"
// PredictionModelLifeCycleFailed specifies the prediction model life cycle failed state for prediction model life
// cycle.
    case PredictionModelLifeCycleFailed = "Failed"
// PredictionModelLifeCycleFeaturing specifies the prediction model life cycle featuring state for prediction model
// life cycle.
    case PredictionModelLifeCycleFeaturing = "Featuring"
// PredictionModelLifeCycleFeaturingFailed specifies the prediction model life cycle featuring failed state for
// prediction model life cycle.
    case PredictionModelLifeCycleFeaturingFailed = "FeaturingFailed"
// PredictionModelLifeCycleHumanIntervention specifies the prediction model life cycle human intervention state for
// prediction model life cycle.
    case PredictionModelLifeCycleHumanIntervention = "HumanIntervention"
// PredictionModelLifeCycleNew specifies the prediction model life cycle new state for prediction model life cycle.
    case PredictionModelLifeCycleNew = "New"
// PredictionModelLifeCyclePendingDiscovering specifies the prediction model life cycle pending discovering state for
// prediction model life cycle.
    case PredictionModelLifeCyclePendingDiscovering = "PendingDiscovering"
// PredictionModelLifeCyclePendingFeaturing specifies the prediction model life cycle pending featuring state for
// prediction model life cycle.
    case PredictionModelLifeCyclePendingFeaturing = "PendingFeaturing"
// PredictionModelLifeCyclePendingModelConfirmation specifies the prediction model life cycle pending model
// confirmation state for prediction model life cycle.
    case PredictionModelLifeCyclePendingModelConfirmation = "PendingModelConfirmation"
// PredictionModelLifeCyclePendingTraining specifies the prediction model life cycle pending training state for
// prediction model life cycle.
    case PredictionModelLifeCyclePendingTraining = "PendingTraining"
// PredictionModelLifeCycleProvisioning specifies the prediction model life cycle provisioning state for prediction
// model life cycle.
    case PredictionModelLifeCycleProvisioning = "Provisioning"
// PredictionModelLifeCycleProvisioningFailed specifies the prediction model life cycle provisioning failed state for
// prediction model life cycle.
    case PredictionModelLifeCycleProvisioningFailed = "ProvisioningFailed"
// PredictionModelLifeCycleTraining specifies the prediction model life cycle training state for prediction model life
// cycle.
    case PredictionModelLifeCycleTraining = "Training"
// PredictionModelLifeCycleTrainingFailed specifies the prediction model life cycle training failed state for
// prediction model life cycle.
    case PredictionModelLifeCycleTrainingFailed = "TrainingFailed"
}


// 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 PredictionModelStatusData : PredictionModelStatusProtocol {
    public var tenantId: String?
    public var predictionName: String?
    public var predictionGuidId: String?
    public var status: PredictionModelLifeCycleEnum
    public var message: String?
    public var trainingSetCount: Int32?
    public var testSetCount: Int32?
    public var validationSetCount: Int32?
    public var trainingAccuracy: Int32?
    public var signalsUsed: Int32?
    public var modelVersion: String?

        enum CodingKeys: String, CodingKey {case tenantId = "tenantId"
        case predictionName = "predictionName"
        case predictionGuidId = "predictionGuidId"
        case status = "status"
        case message = "message"
        case trainingSetCount = "trainingSetCount"
        case testSetCount = "testSetCount"
        case validationSetCount = "validationSetCount"
        case trainingAccuracy = "trainingAccuracy"
        case signalsUsed = "signalsUsed"
        case modelVersion = "modelVersion"
        }

  public init(status: PredictionModelLifeCycleEnum)  {
    self.status = status
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.tenantId) {
        self.tenantId = try container.decode(String?.self, forKey: .tenantId)
    }
    if container.contains(.predictionName) {
        self.predictionName = try container.decode(String?.self, forKey: .predictionName)
    }
    if container.contains(.predictionGuidId) {
        self.predictionGuidId = try container.decode(String?.self, forKey: .predictionGuidId)
    }
    self.status = try container.decode(PredictionModelLifeCycleEnum.self, forKey: .status)
    if container.contains(.message) {
        self.message = try container.decode(String?.self, forKey: .message)
    }
    if container.contains(.trainingSetCount) {
        self.trainingSetCount = try container.decode(Int32?.self, forKey: .trainingSetCount)
    }
    if container.contains(.testSetCount) {
        self.testSetCount = try container.decode(Int32?.self, forKey: .testSetCount)
    }
    if container.contains(.validationSetCount) {
        self.validationSetCount = try container.decode(Int32?.self, forKey: .validationSetCount)
    }
    if container.contains(.trainingAccuracy) {
        self.trainingAccuracy = try container.decode(Int32?.self, forKey: .trainingAccuracy)
    }
    if container.contains(.signalsUsed) {
        self.signalsUsed = try container.decode(Int32?.self, forKey: .signalsUsed)
    }
    if container.contains(.modelVersion) {
        self.modelVersion = try container.decode(String?.self, forKey: .modelVersion)
    }
    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.tenantId != nil {try container.encode(self.tenantId, forKey: .tenantId)}
    if self.predictionName != nil {try container.encode(self.predictionName, forKey: .predictionName)}
    if self.predictionGuidId != nil {try container.encode(self.predictionGuidId, forKey: .predictionGuidId)}
    try container.encode(self.status, forKey: .status)
    if self.message != nil {try container.encode(self.message, forKey: .message)}
    if self.trainingSetCount != nil {try container.encode(self.trainingSetCount, forKey: .trainingSetCount)}
    if self.testSetCount != nil {try container.encode(self.testSetCount, forKey: .testSetCount)}
    if self.validationSetCount != nil {try container.encode(self.validationSetCount, forKey: .validationSetCount)}
    if self.trainingAccuracy != nil {try container.encode(self.trainingAccuracy, forKey: .trainingAccuracy)}
    if self.signalsUsed != nil {try container.encode(self.signalsUsed, forKey: .signalsUsed)}
    if self.modelVersion != nil {try container.encode(self.modelVersion, forKey: .modelVersion)}
  }
}

extension DataFactory {
  public static func createPredictionModelStatusProtocol(status: PredictionModelLifeCycleEnum) -> PredictionModelStatusProtocol {
    return PredictionModelStatusData(status: status)
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createPredictionResourceFormatProtocol() -> PredictionResourceFormatProtocol {
    return PredictionResourceFormatData()
  }
}


// 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 PredictionSystemGeneratedEntitiesData : PredictionSystemGeneratedEntitiesProtocol {
    public var generatedInteractionTypes: [String]?
    public var generatedLinks: [String]?
    public var generatedKpis: [String:String]?

        enum CodingKeys: String, CodingKey {case generatedInteractionTypes = "generatedInteractionTypes"
        case generatedLinks = "generatedLinks"
        case generatedKpis = "generatedKpis"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createPredictionSystemGeneratedEntitiesProtocol() -> PredictionSystemGeneratedEntitiesProtocol {
    return PredictionSystemGeneratedEntitiesData()
  }
}


// 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 PredictionTrainingResultsData : PredictionTrainingResultsProtocol {
    public var tenantId: String?
    public var scoreName: String?
    public var predictionDistribution: PredictionDistributionDefinitionProtocol?
    public var canonicalProfiles: [CanonicalProfileDefinitionProtocol?]?
    public var primaryProfileInstanceCount: Int64?

        enum CodingKeys: String, CodingKey {case tenantId = "tenantId"
        case scoreName = "scoreName"
        case predictionDistribution = "predictionDistribution"
        case canonicalProfiles = "canonicalProfiles"
        case primaryProfileInstanceCount = "primaryProfileInstanceCount"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.tenantId) {
        self.tenantId = try container.decode(String?.self, forKey: .tenantId)
    }
    if container.contains(.scoreName) {
        self.scoreName = try container.decode(String?.self, forKey: .scoreName)
    }
    if container.contains(.predictionDistribution) {
        self.predictionDistribution = try container.decode(PredictionDistributionDefinitionData?.self, forKey: .predictionDistribution)
    }
    if container.contains(.canonicalProfiles) {
        self.canonicalProfiles = try container.decode([CanonicalProfileDefinitionData?]?.self, forKey: .canonicalProfiles)
    }
    if container.contains(.primaryProfileInstanceCount) {
        self.primaryProfileInstanceCount = try container.decode(Int64?.self, forKey: .primaryProfileInstanceCount)
    }
    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.tenantId != nil {try container.encode(self.tenantId, forKey: .tenantId)}
    if self.scoreName != nil {try container.encode(self.scoreName, forKey: .scoreName)}
    if self.predictionDistribution != nil {try container.encode(self.predictionDistribution as! PredictionDistributionDefinitionData?, forKey: .predictionDistribution)}
    if self.canonicalProfiles != nil {try container.encode(self.canonicalProfiles as! [CanonicalProfileDefinitionData?]?, forKey: .canonicalProfiles)}
    if self.primaryProfileInstanceCount != nil {try container.encode(self.primaryProfileInstanceCount, forKey: .primaryProfileInstanceCount)}
  }
}

extension DataFactory {
  public static func createPredictionTrainingResultsProtocol() -> PredictionTrainingResultsProtocol {
    return PredictionTrainingResultsData()
  }
}


// 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 ProfileEnumValidValuesFormatData : ProfileEnumValidValuesFormatProtocol {
    public var value: Int32?
    public var localizedValueNames: [String:String]?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createProfileEnumValidValuesFormatProtocol() -> ProfileEnumValidValuesFormatProtocol {
    return ProfileEnumValidValuesFormatData()
  }
}


// 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 ProfileListResultData : ProfileListResultProtocol {
    public var value: [ProfileResourceFormatProtocol?]?
    public var _nextLink: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createProfileListResultProtocol() -> ProfileListResultProtocol {
    return ProfileListResultData()
  }
}


// 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 ProfileResourceFormatData : ProfileResourceFormatProtocol, ProxyResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: ProfileTypeDefinitionProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createProfileResourceFormatProtocol() -> ProfileResourceFormatProtocol {
    return ProfileResourceFormatData()
  }
}