// 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 AzureBlobConnectorPropertiesData : AzureBlobConnectorPropertiesProtocol {
    public var connectionKeyVaultUrl: String

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

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

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

extension DataFactory {
  public static func createAzureBlobConnectorPropertiesProtocol(connectionKeyVaultUrl: String) -> AzureBlobConnectorPropertiesProtocol {
    return AzureBlobConnectorPropertiesData(connectionKeyVaultUrl: connectionKeyVaultUrl)
  }
}


// CalculationWindowTypes enumerates the values for calculation window 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 CalculationWindowTypesEnum: String, Codable
{
// Day specifies the day state for calculation window types.
    case Day = "Day"
// Hour specifies the hour state for calculation window types.
    case Hour = "Hour"
// Lifetime specifies the lifetime state for calculation window types.
    case Lifetime = "Lifetime"
// Month specifies the month state for calculation window types.
    case Month = "Month"
// Week specifies the week state for calculation window types.
    case Week = "Week"
}


// 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 CanonicalProfileDefinitionData : CanonicalProfileDefinitionProtocol {
    public var canonicalProfileId: Int32?
    public var properties: [CanonicalProfileDefinitionPropertiesItemProtocol?]?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createCanonicalProfileDefinitionProtocol() -> CanonicalProfileDefinitionProtocol {
    return CanonicalProfileDefinitionData()
  }
}


// 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 CanonicalProfileDefinitionPropertiesItemData : CanonicalProfileDefinitionPropertiesItemProtocol {
    public var profileName: String?
    public var profilePropertyName: String?
    public var rank: Int32?
    public var type: CanonicalPropertyValueTypeEnum?
    public var value: String?

        enum CodingKeys: String, CodingKey {case profileName = "profileName"
        case profilePropertyName = "profilePropertyName"
        case rank = "rank"
        case type = "type"
        case value = "value"
        }

  public init()  {
  }

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

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

extension DataFactory {
  public static func createCanonicalProfileDefinitionPropertiesItemProtocol() -> CanonicalProfileDefinitionPropertiesItemProtocol {
    return CanonicalProfileDefinitionPropertiesItemData()
  }
}


// CanonicalPropertyValueType enumerates the values for canonical property value type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum CanonicalPropertyValueTypeEnum: String, Codable
{
// Categorical specifies the categorical state for canonical property value type.
    case Categorical = "Categorical"
// DerivedCategorical specifies the derived categorical state for canonical property value type.
    case DerivedCategorical = "DerivedCategorical"
// DerivedNumeric specifies the derived numeric state for canonical property value type.
    case DerivedNumeric = "DerivedNumeric"
// Numeric specifies the numeric state for canonical property value type.
    case Numeric = "Numeric"
}


// CardinalityTypes enumerates the values for cardinality 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 CardinalityTypesEnum: String, Codable
{
// ManyToMany specifies the many to many state for cardinality types.
    case ManyToMany = "ManyToMany"
// OneToMany specifies the one to many state for cardinality types.
    case OneToMany = "OneToMany"
// OneToOne specifies the one to one state for cardinality types.
    case OneToOne = "OneToOne"
}


// CompletionOperationTypes enumerates the values for completion operation 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 CompletionOperationTypesEnum: String, Codable
{
// DeleteFile specifies the delete file state for completion operation types.
    case DeleteFile = "DeleteFile"
// DoNothing specifies the do nothing state for completion operation types.
    case DoNothing = "DoNothing"
// MoveFile specifies the move file state for completion operation types.
    case MoveFile = "MoveFile"
}


// 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 ConnectorData : ConnectorProtocol {
    public var connectorId: Int32?
    public var connectorName: String?
    public var connectorType: ConnectorTypesEnum
    public var displayName: String?
    public var description: String?
    public var connectorProperties: [String:[String: String?]]
    public var created: Date?
    public var lastModified: Date?
    public var state: ConnectorStatesEnum?
    public var tenantId: String?
    public var isInternal: Bool?

        enum CodingKeys: String, CodingKey {case connectorId = "connectorId"
        case connectorName = "connectorName"
        case connectorType = "connectorType"
        case displayName = "displayName"
        case description = "description"
        case connectorProperties = "connectorProperties"
        case created = "created"
        case lastModified = "lastModified"
        case state = "state"
        case tenantId = "tenantId"
        case isInternal = "isInternal"
        }

  public init(connectorType: ConnectorTypesEnum, connectorProperties: [String:[String: String?]])  {
    self.connectorType = connectorType
    self.connectorProperties = connectorProperties
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.connectorId) {
        self.connectorId = try container.decode(Int32?.self, forKey: .connectorId)
    }
    if container.contains(.connectorName) {
        self.connectorName = try container.decode(String?.self, forKey: .connectorName)
    }
    self.connectorType = try container.decode(ConnectorTypesEnum.self, forKey: .connectorType)
    if container.contains(.displayName) {
        self.displayName = try container.decode(String?.self, forKey: .displayName)
    }
    if container.contains(.description) {
        self.description = try container.decode(String?.self, forKey: .description)
    }
    self.connectorProperties = try container.decode([String:[String: String?]].self, forKey: .connectorProperties)
    if container.contains(.created) {
        self.created = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .created)), format: .dateTime)
    }
    if container.contains(.lastModified) {
        self.lastModified = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastModified)), format: .dateTime)
    }
    if container.contains(.state) {
        self.state = try container.decode(ConnectorStatesEnum?.self, forKey: .state)
    }
    if container.contains(.tenantId) {
        self.tenantId = try container.decode(String?.self, forKey: .tenantId)
    }
    if container.contains(.isInternal) {
        self.isInternal = try container.decode(Bool?.self, forKey: .isInternal)
    }
    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.connectorId != nil {try container.encode(self.connectorId, forKey: .connectorId)}
    if self.connectorName != nil {try container.encode(self.connectorName, forKey: .connectorName)}
    try container.encode(self.connectorType, forKey: .connectorType)
    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.connectorProperties, forKey: .connectorProperties)
    if self.created != nil {
        try container.encode(DateConverter.toString(date: self.created!, format: .dateTime), forKey: .created)
    }
    if self.lastModified != nil {
        try container.encode(DateConverter.toString(date: self.lastModified!, format: .dateTime), forKey: .lastModified)
    }
    if self.state != nil {try container.encode(self.state, forKey: .state)}
    if self.tenantId != nil {try container.encode(self.tenantId, forKey: .tenantId)}
    if self.isInternal != nil {try container.encode(self.isInternal, forKey: .isInternal)}
  }
}

extension DataFactory {
  public static func createConnectorProtocol(connectorType: ConnectorTypesEnum, connectorProperties: [String:[String: String?]]) -> ConnectorProtocol {
    return ConnectorData(connectorType: connectorType, connectorProperties: connectorProperties)
  }
}


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

extension DataFactory {
  public static func createConnectorListResultProtocol() -> ConnectorListResultProtocol {
    return ConnectorListResultData()
  }
}


// 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 ConnectorMappingAvailabilityData : ConnectorMappingAvailabilityProtocol {
    public var frequency: FrequencyTypesEnum?
    public var interval: Int32

        enum CodingKeys: String, CodingKey {case frequency = "frequency"
        case interval = "interval"
        }

  public init(interval: Int32)  {
    self.interval = interval
  }

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

extension DataFactory {
  public static func createConnectorMappingAvailabilityProtocol(interval: Int32) -> ConnectorMappingAvailabilityProtocol {
    return ConnectorMappingAvailabilityData(interval: interval)
  }
}


// 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 ConnectorMappingCompleteOperationData : ConnectorMappingCompleteOperationProtocol {
    public var completionOperationType: CompletionOperationTypesEnum?
    public var destinationFolder: String?

        enum CodingKeys: String, CodingKey {case completionOperationType = "completionOperationType"
        case destinationFolder = "destinationFolder"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createConnectorMappingCompleteOperationProtocol() -> ConnectorMappingCompleteOperationProtocol {
    return ConnectorMappingCompleteOperationData()
  }
}


// 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 ConnectorMappingData : ConnectorMappingProtocol {
    public var connectorName: String?
    public var connectorType: ConnectorTypesEnum?
    public var created: Date?
    public var lastModified: Date?
    public var entityType: EntityTypesEnum
    public var entityTypeName: String
    public var connectorMappingName: String?
    public var displayName: String?
    public var description: String?
    public var dataFormatId: String?
    public var mappingProperties: ConnectorMappingPropertiesProtocol
    public var nextRunTime: Date?
    public var runId: String?
    public var state: ConnectorMappingStatesEnum?
    public var tenantId: String?

        enum CodingKeys: String, CodingKey {case connectorName = "connectorName"
        case connectorType = "connectorType"
        case created = "created"
        case lastModified = "lastModified"
        case entityType = "entityType"
        case entityTypeName = "entityTypeName"
        case connectorMappingName = "connectorMappingName"
        case displayName = "displayName"
        case description = "description"
        case dataFormatId = "dataFormatId"
        case mappingProperties = "mappingProperties"
        case nextRunTime = "nextRunTime"
        case runId = "runId"
        case state = "state"
        case tenantId = "tenantId"
        }

  public init(entityType: EntityTypesEnum, entityTypeName: String, mappingProperties: ConnectorMappingPropertiesProtocol)  {
    self.entityType = entityType
    self.entityTypeName = entityTypeName
    self.mappingProperties = mappingProperties
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.connectorName) {
        self.connectorName = try container.decode(String?.self, forKey: .connectorName)
    }
    if container.contains(.connectorType) {
        self.connectorType = try container.decode(ConnectorTypesEnum?.self, forKey: .connectorType)
    }
    if container.contains(.created) {
        self.created = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .created)), format: .dateTime)
    }
    if container.contains(.lastModified) {
        self.lastModified = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastModified)), format: .dateTime)
    }
    self.entityType = try container.decode(EntityTypesEnum.self, forKey: .entityType)
    self.entityTypeName = try container.decode(String.self, forKey: .entityTypeName)
    if container.contains(.connectorMappingName) {
        self.connectorMappingName = try container.decode(String?.self, forKey: .connectorMappingName)
    }
    if container.contains(.displayName) {
        self.displayName = try container.decode(String?.self, forKey: .displayName)
    }
    if container.contains(.description) {
        self.description = try container.decode(String?.self, forKey: .description)
    }
    if container.contains(.dataFormatId) {
        self.dataFormatId = try container.decode(String?.self, forKey: .dataFormatId)
    }
    self.mappingProperties = try container.decode(ConnectorMappingPropertiesData.self, forKey: .mappingProperties)
    if container.contains(.nextRunTime) {
        self.nextRunTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .nextRunTime)), format: .dateTime)
    }
    if container.contains(.runId) {
        self.runId = try container.decode(String?.self, forKey: .runId)
    }
    if container.contains(.state) {
        self.state = try container.decode(ConnectorMappingStatesEnum?.self, forKey: .state)
    }
    if container.contains(.tenantId) {
        self.tenantId = try container.decode(String?.self, forKey: .tenantId)
    }
    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.connectorName != nil {try container.encode(self.connectorName, forKey: .connectorName)}
    if self.connectorType != nil {try container.encode(self.connectorType, forKey: .connectorType)}
    if self.created != nil {
        try container.encode(DateConverter.toString(date: self.created!, format: .dateTime), forKey: .created)
    }
    if self.lastModified != nil {
        try container.encode(DateConverter.toString(date: self.lastModified!, format: .dateTime), forKey: .lastModified)
    }
    try container.encode(self.entityType, forKey: .entityType)
    try container.encode(self.entityTypeName, forKey: .entityTypeName)
    if self.connectorMappingName != nil {try container.encode(self.connectorMappingName, forKey: .connectorMappingName)}
    if self.displayName != nil {try container.encode(self.displayName, forKey: .displayName)}
    if self.description != nil {try container.encode(self.description, forKey: .description)}
    if self.dataFormatId != nil {try container.encode(self.dataFormatId, forKey: .dataFormatId)}
    try container.encode(self.mappingProperties as! ConnectorMappingPropertiesData, forKey: .mappingProperties)
    if self.nextRunTime != nil {
        try container.encode(DateConverter.toString(date: self.nextRunTime!, format: .dateTime), forKey: .nextRunTime)
    }
    if self.runId != nil {try container.encode(self.runId, forKey: .runId)}
    if self.state != nil {try container.encode(self.state, forKey: .state)}
    if self.tenantId != nil {try container.encode(self.tenantId, forKey: .tenantId)}
  }
}

extension DataFactory {
  public static func createConnectorMappingProtocol(entityType: EntityTypesEnum, entityTypeName: String, mappingProperties: ConnectorMappingPropertiesProtocol) -> ConnectorMappingProtocol {
    return ConnectorMappingData(entityType: entityType, entityTypeName: entityTypeName, mappingProperties: mappingProperties)
  }
}


// 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 ConnectorMappingErrorManagementData : ConnectorMappingErrorManagementProtocol {
    public var errorManagementType: ErrorManagementTypesEnum
    public var errorLimit: Int32?

        enum CodingKeys: String, CodingKey {case errorManagementType = "errorManagementType"
        case errorLimit = "errorLimit"
        }

  public init(errorManagementType: ErrorManagementTypesEnum)  {
    self.errorManagementType = errorManagementType
  }

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

extension DataFactory {
  public static func createConnectorMappingErrorManagementProtocol(errorManagementType: ErrorManagementTypesEnum) -> ConnectorMappingErrorManagementProtocol {
    return ConnectorMappingErrorManagementData(errorManagementType: errorManagementType)
  }
}


// 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 ConnectorMappingFormatData : ConnectorMappingFormatProtocol {
    public var formatType: String
    public var columnDelimiter: String?
    public var acceptLanguage: String?
    public var quoteCharacter: String?
    public var quoteEscapeCharacter: String?
    public var arraySeparator: String?

        enum CodingKeys: String, CodingKey {case formatType = "formatType"
        case columnDelimiter = "columnDelimiter"
        case acceptLanguage = "acceptLanguage"
        case quoteCharacter = "quoteCharacter"
        case quoteEscapeCharacter = "quoteEscapeCharacter"
        case arraySeparator = "arraySeparator"
        }

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

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

extension DataFactory {
  public static func createConnectorMappingFormatProtocol(formatType: String) -> ConnectorMappingFormatProtocol {
    return ConnectorMappingFormatData(formatType: formatType)
  }
}


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

extension DataFactory {
  public static func createConnectorMappingListResultProtocol() -> ConnectorMappingListResultProtocol {
    return ConnectorMappingListResultData()
  }
}


// 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 ConnectorMappingPropertiesData : ConnectorMappingPropertiesProtocol {
    public var folderPath: String?
    public var fileFilter: String?
    public var hasHeader: Bool?
    public var errorManagement: ConnectorMappingErrorManagementProtocol
    public var format: ConnectorMappingFormatProtocol
    public var availability: ConnectorMappingAvailabilityProtocol
    public var structure: [ConnectorMappingStructureProtocol]
    public var completeOperation: ConnectorMappingCompleteOperationProtocol

        enum CodingKeys: String, CodingKey {case folderPath = "folderPath"
        case fileFilter = "fileFilter"
        case hasHeader = "hasHeader"
        case errorManagement = "errorManagement"
        case format = "format"
        case availability = "availability"
        case structure = "structure"
        case completeOperation = "completeOperation"
        }

  public init(errorManagement: ConnectorMappingErrorManagementProtocol, format: ConnectorMappingFormatProtocol, availability: ConnectorMappingAvailabilityProtocol, structure: [ConnectorMappingStructureProtocol], completeOperation: ConnectorMappingCompleteOperationProtocol)  {
    self.errorManagement = errorManagement
    self.format = format
    self.availability = availability
    self.structure = structure
    self.completeOperation = completeOperation
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.folderPath) {
        self.folderPath = try container.decode(String?.self, forKey: .folderPath)
    }
    if container.contains(.fileFilter) {
        self.fileFilter = try container.decode(String?.self, forKey: .fileFilter)
    }
    if container.contains(.hasHeader) {
        self.hasHeader = try container.decode(Bool?.self, forKey: .hasHeader)
    }
    self.errorManagement = try container.decode(ConnectorMappingErrorManagementData.self, forKey: .errorManagement)
    self.format = try container.decode(ConnectorMappingFormatData.self, forKey: .format)
    self.availability = try container.decode(ConnectorMappingAvailabilityData.self, forKey: .availability)
    self.structure = try container.decode([ConnectorMappingStructureData].self, forKey: .structure)
    self.completeOperation = try container.decode(ConnectorMappingCompleteOperationData.self, forKey: .completeOperation)
    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.folderPath != nil {try container.encode(self.folderPath, forKey: .folderPath)}
    if self.fileFilter != nil {try container.encode(self.fileFilter, forKey: .fileFilter)}
    if self.hasHeader != nil {try container.encode(self.hasHeader, forKey: .hasHeader)}
    try container.encode(self.errorManagement as! ConnectorMappingErrorManagementData, forKey: .errorManagement)
    try container.encode(self.format as! ConnectorMappingFormatData, forKey: .format)
    try container.encode(self.availability as! ConnectorMappingAvailabilityData, forKey: .availability)
    try container.encode(self.structure as! [ConnectorMappingStructureData], forKey: .structure)
    try container.encode(self.completeOperation as! ConnectorMappingCompleteOperationData, forKey: .completeOperation)
  }
}

extension DataFactory {
  public static func createConnectorMappingPropertiesProtocol(errorManagement: ConnectorMappingErrorManagementProtocol, format: ConnectorMappingFormatProtocol, availability: ConnectorMappingAvailabilityProtocol, structure: [ConnectorMappingStructureProtocol], completeOperation: ConnectorMappingCompleteOperationProtocol) -> ConnectorMappingPropertiesProtocol {
    return ConnectorMappingPropertiesData(errorManagement: errorManagement, format: format, availability: availability, structure: structure, completeOperation: completeOperation)
  }
}


// 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 ConnectorMappingResourceFormatData : ConnectorMappingResourceFormatProtocol, ProxyResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: ConnectorMappingProtocol?

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

extension DataFactory {
  public static func createConnectorMappingResourceFormatProtocol() -> ConnectorMappingResourceFormatProtocol {
    return ConnectorMappingResourceFormatData()
  }
}


// ConnectorMappingStates enumerates the values for connector mapping states.

// 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 ConnectorMappingStatesEnum: String, Codable
{
// Created specifies the created state for connector mapping states.
    case Created = "Created"
// Creating specifies the creating state for connector mapping states.
    case Creating = "Creating"
// Expiring specifies the expiring state for connector mapping states.
    case Expiring = "Expiring"
// Failed specifies the failed state for connector mapping states.
    case Failed = "Failed"
// Ready specifies the ready state for connector mapping states.
    case Ready = "Ready"
// Running specifies the running state for connector mapping states.
    case Running = "Running"
// Stopped specifies the stopped state for connector mapping states.
    case Stopped = "Stopped"
}


// 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 ConnectorMappingStructureData : ConnectorMappingStructureProtocol {
    public var propertyName: String
    public var columnName: String
    public var customFormatSpecifier: String?
    public var isEncrypted: Bool?

        enum CodingKeys: String, CodingKey {case propertyName = "propertyName"
        case columnName = "columnName"
        case customFormatSpecifier = "customFormatSpecifier"
        case isEncrypted = "isEncrypted"
        }

  public init(propertyName: String, columnName: String)  {
    self.propertyName = propertyName
    self.columnName = columnName
  }

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

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

extension DataFactory {
  public static func createConnectorMappingStructureProtocol(propertyName: String, columnName: String) -> ConnectorMappingStructureProtocol {
    return ConnectorMappingStructureData(propertyName: propertyName, columnName: columnName)
  }
}


// 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 ConnectorResourceFormatData : ConnectorResourceFormatProtocol, ProxyResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: ConnectorProtocol?

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

extension DataFactory {
  public static func createConnectorResourceFormatProtocol() -> ConnectorResourceFormatProtocol {
    return ConnectorResourceFormatData()
  }
}


// ConnectorStates enumerates the values for connector states.

// 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 ConnectorStatesEnum: String, Codable
{
// ConnectorStatesCreated specifies the connector states created state for connector states.
    case ConnectorStatesCreated = "Created"
// ConnectorStatesCreating specifies the connector states creating state for connector states.
    case ConnectorStatesCreating = "Creating"
// ConnectorStatesDeleting specifies the connector states deleting state for connector states.
    case ConnectorStatesDeleting = "Deleting"
// ConnectorStatesExpiring specifies the connector states expiring state for connector states.
    case ConnectorStatesExpiring = "Expiring"
// ConnectorStatesFailed specifies the connector states failed state for connector states.
    case ConnectorStatesFailed = "Failed"
// ConnectorStatesReady specifies the connector states ready state for connector states.
    case ConnectorStatesReady = "Ready"
}


// ConnectorTypes enumerates the values for connector 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 ConnectorTypesEnum: String, Codable
{
// AzureBlob specifies the azure blob state for connector types.
    case AzureBlob = "AzureBlob"
// CRM specifies the crm state for connector types.
    case CRM = "CRM"
// ExchangeOnline specifies the exchange online state for connector types.
    case ExchangeOnline = "ExchangeOnline"
// None specifies the none state for connector types.
    case None = "None"
// Outbound specifies the outbound state for connector types.
    case Outbound = "Outbound"
// Salesforce specifies the salesforce state for connector types.
    case Salesforce = "Salesforce"
}


// 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 CrmConnectorEntitiesData : CrmConnectorEntitiesProtocol {
    public var logicalName: String
    public var displayName: String?
    public var isProfile: Bool?

        enum CodingKeys: String, CodingKey {case logicalName = "logicalName"
        case displayName = "displayName"
        case isProfile = "isProfile"
        }

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

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

extension DataFactory {
  public static func createCrmConnectorEntitiesProtocol(logicalName: String) -> CrmConnectorEntitiesProtocol {
    return CrmConnectorEntitiesData(logicalName: logicalName)
  }
}


// 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 CrmConnectorPropertiesData : CrmConnectorPropertiesProtocol {
    public var connectionString: String?
    public var organizationId: String
    public var organizationUrl: String
    public var entities: [CrmConnectorEntitiesProtocol]
    public var accessToken: String?

        enum CodingKeys: String, CodingKey {case connectionString = "connectionString"
        case organizationId = "organizationId"
        case organizationUrl = "organizationUrl"
        case entities = "entities"
        case accessToken = "accessToken"
        }

  public init(organizationId: String, organizationUrl: String, entities: [CrmConnectorEntitiesProtocol])  {
    self.organizationId = organizationId
    self.organizationUrl = organizationUrl
    self.entities = entities
  }

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

extension DataFactory {
  public static func createCrmConnectorPropertiesProtocol(organizationId: String, organizationUrl: String, entities: [CrmConnectorEntitiesProtocol]) -> CrmConnectorPropertiesProtocol {
    return CrmConnectorPropertiesData(organizationId: organizationId, organizationUrl: organizationUrl, entities: entities)
  }
}


// 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 DataSourceData : DataSourceProtocol {
    public var name: String?
    public var dataSourceType: DataSourceTypeEnum?
    public var status: StatusEnum?
    public var id: Int32?
    public var dataSourceReferenceId: String?

        enum CodingKeys: String, CodingKey {case name = "name"
        case dataSourceType = "dataSourceType"
        case status = "status"
        case id = "id"
        case dataSourceReferenceId = "dataSourceReferenceId"
        }

  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(.dataSourceType) {
        self.dataSourceType = try container.decode(DataSourceTypeEnum?.self, forKey: .dataSourceType)
    }
    if container.contains(.status) {
        self.status = try container.decode(StatusEnum?.self, forKey: .status)
    }
    if container.contains(.id) {
        self.id = try container.decode(Int32?.self, forKey: .id)
    }
    if container.contains(.dataSourceReferenceId) {
        self.dataSourceReferenceId = try container.decode(String?.self, forKey: .dataSourceReferenceId)
    }
    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.dataSourceType != nil {try container.encode(self.dataSourceType, forKey: .dataSourceType)}
    if self.status != nil {try container.encode(self.status, forKey: .status)}
    if self.id != nil {try container.encode(self.id, forKey: .id)}
    if self.dataSourceReferenceId != nil {try container.encode(self.dataSourceReferenceId, forKey: .dataSourceReferenceId)}
  }
}

extension DataFactory {
  public static func createDataSourceProtocol() -> DataSourceProtocol {
    return DataSourceData()
  }
}


// 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 DataSourcePrecedenceData : DataSourcePrecedenceProtocol {
    public var dataSource: DataSourceProtocol?
    public var _precedence: Int32?

        enum CodingKeys: String, CodingKey {case dataSource = "dataSource"
        case _precedence = "precedence"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createDataSourcePrecedenceProtocol() -> DataSourcePrecedenceProtocol {
    return DataSourcePrecedenceData()
  }
}


// DataSourceType enumerates the values for data source type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum DataSourceTypeEnum: String, Codable
{
// DataSourceTypeConnector specifies the data source type connector state for data source type.
    case DataSourceTypeConnector = "Connector"
// DataSourceTypeLinkInteraction specifies the data source type link interaction state for data source type.
    case DataSourceTypeLinkInteraction = "LinkInteraction"
// DataSourceTypeSystemDefault specifies the data source type system default state for data source type.
    case DataSourceTypeSystemDefault = "SystemDefault"
}


// 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 EnrichingKpiData : EnrichingKpiProtocol, 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 createEnrichingKpiProtocol(entityType: EntityTypesEnum, entityTypeName: String, calculationWindow: CalculationWindowTypesEnum, function: KpiFunctionsEnum, expression: String) -> EnrichingKpiProtocol {
    return EnrichingKpiData(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 EntityTypeDefinitionData : 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?

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

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

extension DataFactory {
  public static func createEntityTypeDefinitionProtocol() -> EntityTypeDefinitionProtocol {
    return EntityTypeDefinitionData()
  }
}


// EntityType enumerates the values for entity type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum EntityTypeEnum: String, Codable
{
// EntityTypeInteraction specifies the entity type interaction state for entity type.
    case EntityTypeInteraction = "Interaction"
// EntityTypeNone specifies the entity type none state for entity type.
    case EntityTypeNone = "None"
// EntityTypeProfile specifies the entity type profile state for entity type.
    case EntityTypeProfile = "Profile"
// EntityTypeRelationship specifies the entity type relationship state for entity type.
    case EntityTypeRelationship = "Relationship"
}


// EntityTypes enumerates the values for entity 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 EntityTypesEnum: String, Codable
{
// EntityTypesInteraction specifies the entity types interaction state for entity types.
    case EntityTypesInteraction = "Interaction"
// EntityTypesNone specifies the entity types none state for entity types.
    case EntityTypesNone = "None"
// EntityTypesProfile specifies the entity types profile state for entity types.
    case EntityTypesProfile = "Profile"
// EntityTypesRelationship specifies the entity types relationship state for entity types.
    case EntityTypesRelationship = "Relationship"
}


// ErrorManagementTypes enumerates the values for error management 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 ErrorManagementTypesEnum: String, Codable
{
// RejectAndContinue specifies the reject and continue state for error management types.
    case RejectAndContinue = "RejectAndContinue"
// RejectUntilLimit specifies the reject until limit state for error management types.
    case RejectUntilLimit = "RejectUntilLimit"
// StopImport specifies the stop import state for error management types.
    case StopImport = "StopImport"
}


// FrequencyTypes enumerates the values for frequency 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 FrequencyTypesEnum: String, Codable
{
// FrequencyTypesDay specifies the frequency types day state for frequency types.
    case FrequencyTypesDay = "Day"
// FrequencyTypesHour specifies the frequency types hour state for frequency types.
    case FrequencyTypesHour = "Hour"
// FrequencyTypesMinute specifies the frequency types minute state for frequency types.
    case FrequencyTypesMinute = "Minute"
// FrequencyTypesMonth specifies the frequency types month state for frequency types.
    case FrequencyTypesMonth = "Month"
// FrequencyTypesWeek specifies the frequency types week state for frequency types.
    case FrequencyTypesWeek = "Week"
}


// 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 GetImageUploadUrlInputData : GetImageUploadUrlInputProtocol {
    public var entityType: String?
    public var entityTypeName: String?
    public var relativePath: String?

        enum CodingKeys: String, CodingKey {case entityType = "entityType"
        case entityTypeName = "entityTypeName"
        case relativePath = "relativePath"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createGetImageUploadUrlInputProtocol() -> GetImageUploadUrlInputProtocol {
    return GetImageUploadUrlInputData()
  }
}


// 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 HubBillingInfoFormatData : HubBillingInfoFormatProtocol {
    public var skuName: String?
    public var minUnits: Int32?
    public var maxUnits: Int32?

        enum CodingKeys: String, CodingKey {case skuName = "skuName"
        case minUnits = "minUnits"
        case maxUnits = "maxUnits"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createHubBillingInfoFormatProtocol() -> HubBillingInfoFormatProtocol {
    return HubBillingInfoFormatData()
  }
}


// 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 HubData : HubProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?
    public var properties: HubPropertiesFormatProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createHubProtocol() -> HubProtocol {
    return HubData()
  }
}


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

extension DataFactory {
  public static func createHubListResultProtocol() -> HubListResultProtocol {
    return HubListResultData()
  }
}


// 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 HubPropertiesFormatData : HubPropertiesFormatProtocol {
    public var apiEndpoint: String?
    public var webEndpoint: String?
    public var provisioningState: String?
    public var tenantFeatures: Int32?
    public var hubBillingInfo: HubBillingInfoFormatProtocol?

        enum CodingKeys: String, CodingKey {case apiEndpoint = "apiEndpoint"
        case webEndpoint = "webEndpoint"
        case provisioningState = "provisioningState"
        case tenantFeatures = "tenantFeatures"
        case hubBillingInfo = "hubBillingInfo"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createHubPropertiesFormatProtocol() -> HubPropertiesFormatProtocol {
    return HubPropertiesFormatData()
  }
}


// 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 ImageDefinitionData : ImageDefinitionProtocol {
    public var imageExists: Bool?
    public var contentUrl: String?
    public var relativePath: String?

        enum CodingKeys: String, CodingKey {case imageExists = "imageExists"
        case contentUrl = "contentUrl"
        case relativePath = "relativePath"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createImageDefinitionProtocol() -> ImageDefinitionProtocol {
    return ImageDefinitionData()
  }
}


// InstanceOperationType enumerates the values for instance operation type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum InstanceOperationTypeEnum: String, Codable
{
// Delete specifies the delete state for instance operation type.
    case Delete = "Delete"
// Upsert specifies the upsert state for instance operation type.
    case Upsert = "Upsert"
}


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

extension DataFactory {
  public static func createInteractionListResultProtocol() -> InteractionListResultProtocol {
    return InteractionListResultData()
  }
}


// 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 InteractionResourceFormatData : InteractionResourceFormatProtocol, ProxyResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: InteractionTypeDefinitionProtocol?

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

extension DataFactory {
  public static func createInteractionResourceFormatProtocol() -> InteractionResourceFormatProtocol {
    return InteractionResourceFormatData()
  }
}