// 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 ProfileTypeDefinitionData : ProfileTypeDefinitionProtocol, 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 strongIds: [StrongIdProtocol?]?

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

  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(.strongIds) {
        self.strongIds = try container.decode([StrongIdData?]?.self, forKey: .strongIds)
    }
    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.strongIds != nil {try container.encode(self.strongIds as! [StrongIdData?]?, forKey: .strongIds)}
  }
}

extension DataFactory {
  public static func createProfileTypeDefinitionProtocol() -> ProfileTypeDefinitionProtocol {
    return ProfileTypeDefinitionData()
  }
}


// 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 PropertyDefinitionData : PropertyDefinitionProtocol {
    public var arrayValueSeparator: String?
    public var enumValidValues: [ProfileEnumValidValuesFormatProtocol?]?
    public var fieldName: String
    public var fieldType: String
    public var isArray: Bool?
    public var isEnum: Bool?
    public var isFlagEnum: Bool?
    public var isImage: Bool?
    public var isLocalizedString: Bool?
    public var isName: Bool?
    public var isRequired: Bool?
    public var propertyId: String?
    public var schemaItemPropLink: String?
    public var maxLength: Int32?
    public var isAvailableInGraph: Bool?
    public var dataSourcePrecedenceRules: [DataSourcePrecedenceProtocol?]?

        enum CodingKeys: String, CodingKey {case arrayValueSeparator = "arrayValueSeparator"
        case enumValidValues = "enumValidValues"
        case fieldName = "fieldName"
        case fieldType = "fieldType"
        case isArray = "isArray"
        case isEnum = "isEnum"
        case isFlagEnum = "isFlagEnum"
        case isImage = "isImage"
        case isLocalizedString = "isLocalizedString"
        case isName = "isName"
        case isRequired = "isRequired"
        case propertyId = "propertyId"
        case schemaItemPropLink = "schemaItemPropLink"
        case maxLength = "maxLength"
        case isAvailableInGraph = "isAvailableInGraph"
        case dataSourcePrecedenceRules = "dataSourcePrecedenceRules"
        }

  public init(fieldName: String, fieldType: String)  {
    self.fieldName = fieldName
    self.fieldType = fieldType
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.arrayValueSeparator) {
        self.arrayValueSeparator = try container.decode(String?.self, forKey: .arrayValueSeparator)
    }
    if container.contains(.enumValidValues) {
        self.enumValidValues = try container.decode([ProfileEnumValidValuesFormatData?]?.self, forKey: .enumValidValues)
    }
    self.fieldName = try container.decode(String.self, forKey: .fieldName)
    self.fieldType = try container.decode(String.self, forKey: .fieldType)
    if container.contains(.isArray) {
        self.isArray = try container.decode(Bool?.self, forKey: .isArray)
    }
    if container.contains(.isEnum) {
        self.isEnum = try container.decode(Bool?.self, forKey: .isEnum)
    }
    if container.contains(.isFlagEnum) {
        self.isFlagEnum = try container.decode(Bool?.self, forKey: .isFlagEnum)
    }
    if container.contains(.isImage) {
        self.isImage = try container.decode(Bool?.self, forKey: .isImage)
    }
    if container.contains(.isLocalizedString) {
        self.isLocalizedString = try container.decode(Bool?.self, forKey: .isLocalizedString)
    }
    if container.contains(.isName) {
        self.isName = try container.decode(Bool?.self, forKey: .isName)
    }
    if container.contains(.isRequired) {
        self.isRequired = try container.decode(Bool?.self, forKey: .isRequired)
    }
    if container.contains(.propertyId) {
        self.propertyId = try container.decode(String?.self, forKey: .propertyId)
    }
    if container.contains(.schemaItemPropLink) {
        self.schemaItemPropLink = try container.decode(String?.self, forKey: .schemaItemPropLink)
    }
    if container.contains(.maxLength) {
        self.maxLength = try container.decode(Int32?.self, forKey: .maxLength)
    }
    if container.contains(.isAvailableInGraph) {
        self.isAvailableInGraph = try container.decode(Bool?.self, forKey: .isAvailableInGraph)
    }
    if container.contains(.dataSourcePrecedenceRules) {
        self.dataSourcePrecedenceRules = try container.decode([DataSourcePrecedenceData?]?.self, forKey: .dataSourcePrecedenceRules)
    }
    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.arrayValueSeparator != nil {try container.encode(self.arrayValueSeparator, forKey: .arrayValueSeparator)}
    if self.enumValidValues != nil {try container.encode(self.enumValidValues as! [ProfileEnumValidValuesFormatData?]?, forKey: .enumValidValues)}
    try container.encode(self.fieldName, forKey: .fieldName)
    try container.encode(self.fieldType, forKey: .fieldType)
    if self.isArray != nil {try container.encode(self.isArray, forKey: .isArray)}
    if self.isEnum != nil {try container.encode(self.isEnum, forKey: .isEnum)}
    if self.isFlagEnum != nil {try container.encode(self.isFlagEnum, forKey: .isFlagEnum)}
    if self.isImage != nil {try container.encode(self.isImage, forKey: .isImage)}
    if self.isLocalizedString != nil {try container.encode(self.isLocalizedString, forKey: .isLocalizedString)}
    if self.isName != nil {try container.encode(self.isName, forKey: .isName)}
    if self.isRequired != nil {try container.encode(self.isRequired, forKey: .isRequired)}
    if self.propertyId != nil {try container.encode(self.propertyId, forKey: .propertyId)}
    if self.schemaItemPropLink != nil {try container.encode(self.schemaItemPropLink, forKey: .schemaItemPropLink)}
    if self.maxLength != nil {try container.encode(self.maxLength, forKey: .maxLength)}
    if self.isAvailableInGraph != nil {try container.encode(self.isAvailableInGraph, forKey: .isAvailableInGraph)}
    if self.dataSourcePrecedenceRules != nil {try container.encode(self.dataSourcePrecedenceRules as! [DataSourcePrecedenceData?]?, forKey: .dataSourcePrecedenceRules)}
  }
}

extension DataFactory {
  public static func createPropertyDefinitionProtocol(fieldName: String, fieldType: String) -> PropertyDefinitionProtocol {
    return PropertyDefinitionData(fieldName: fieldName, fieldType: fieldType)
  }
}


// ProvisioningStates enumerates the values for provisioning 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 ProvisioningStatesEnum: String, Codable
{
// ProvisioningStatesDeleting specifies the provisioning states deleting state for provisioning states.
    case ProvisioningStatesDeleting = "Deleting"
// ProvisioningStatesExpiring specifies the provisioning states expiring state for provisioning states.
    case ProvisioningStatesExpiring = "Expiring"
// ProvisioningStatesFailed specifies the provisioning states failed state for provisioning states.
    case ProvisioningStatesFailed = "Failed"
// ProvisioningStatesHumanIntervention specifies the provisioning states human intervention state for provisioning
// states.
    case ProvisioningStatesHumanIntervention = "HumanIntervention"
// ProvisioningStatesProvisioning specifies the provisioning states provisioning state for provisioning states.
    case ProvisioningStatesProvisioning = "Provisioning"
// ProvisioningStatesSucceeded specifies the provisioning states succeeded state for provisioning states.
    case ProvisioningStatesSucceeded = "Succeeded"
}


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

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

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.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 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)}
  }
}

extension DataFactory {
  public static func createProxyResourceProtocol() -> ProxyResourceProtocol {
    return ProxyResourceData()
  }
}


// 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 RelationshipDefinitionData : RelationshipDefinitionProtocol {
    public var cardinality: CardinalityTypesEnum?
    public var displayName: [String:String]?
    public var description: [String:String]?
    public var expiryDateTimeUtc: Date?
    public var fields: [PropertyDefinitionProtocol?]?
    public var lookupMappings: [RelationshipTypeMappingProtocol?]?
    public var profileType: String
    public var provisioningState: ProvisioningStatesEnum?
    public var relationshipName: String?
    public var relatedProfileType: String
    public var relationshipGuidId: String?
    public var tenantId: String?

        enum CodingKeys: String, CodingKey {case cardinality = "cardinality"
        case displayName = "displayName"
        case description = "description"
        case expiryDateTimeUtc = "expiryDateTimeUtc"
        case fields = "fields"
        case lookupMappings = "lookupMappings"
        case profileType = "profileType"
        case provisioningState = "provisioningState"
        case relationshipName = "relationshipName"
        case relatedProfileType = "relatedProfileType"
        case relationshipGuidId = "relationshipGuidId"
        case tenantId = "tenantId"
        }

  public init(profileType: String, relatedProfileType: String)  {
    self.profileType = profileType
    self.relatedProfileType = relatedProfileType
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.cardinality) {
        self.cardinality = try container.decode(CardinalityTypesEnum?.self, forKey: .cardinality)
    }
    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(.expiryDateTimeUtc) {
        self.expiryDateTimeUtc = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .expiryDateTimeUtc)), format: .dateTime)
    }
    if container.contains(.fields) {
        self.fields = try container.decode([PropertyDefinitionData?]?.self, forKey: .fields)
    }
    if container.contains(.lookupMappings) {
        self.lookupMappings = try container.decode([RelationshipTypeMappingData?]?.self, forKey: .lookupMappings)
    }
    self.profileType = try container.decode(String.self, forKey: .profileType)
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(ProvisioningStatesEnum?.self, forKey: .provisioningState)
    }
    if container.contains(.relationshipName) {
        self.relationshipName = try container.decode(String?.self, forKey: .relationshipName)
    }
    self.relatedProfileType = try container.decode(String.self, forKey: .relatedProfileType)
    if container.contains(.relationshipGuidId) {
        self.relationshipGuidId = try container.decode(String?.self, forKey: .relationshipGuidId)
    }
    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.cardinality != nil {try container.encode(self.cardinality, forKey: .cardinality)}
    if self.displayName != nil {try container.encode(self.displayName, forKey: .displayName)}
    if self.description != nil {try container.encode(self.description, forKey: .description)}
    if self.expiryDateTimeUtc != nil {
        try container.encode(DateConverter.toString(date: self.expiryDateTimeUtc!, format: .dateTime), forKey: .expiryDateTimeUtc)
    }
    if self.fields != nil {try container.encode(self.fields as! [PropertyDefinitionData?]?, forKey: .fields)}
    if self.lookupMappings != nil {try container.encode(self.lookupMappings as! [RelationshipTypeMappingData?]?, forKey: .lookupMappings)}
    try container.encode(self.profileType, forKey: .profileType)
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.relationshipName != nil {try container.encode(self.relationshipName, forKey: .relationshipName)}
    try container.encode(self.relatedProfileType, forKey: .relatedProfileType)
    if self.relationshipGuidId != nil {try container.encode(self.relationshipGuidId, forKey: .relationshipGuidId)}
    if self.tenantId != nil {try container.encode(self.tenantId, forKey: .tenantId)}
  }
}

extension DataFactory {
  public static func createRelationshipDefinitionProtocol(profileType: String, relatedProfileType: String) -> RelationshipDefinitionProtocol {
    return RelationshipDefinitionData(profileType: profileType, relatedProfileType: relatedProfileType)
  }
}


// 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 RelationshipLinkDefinitionData : RelationshipLinkDefinitionProtocol {
    public var displayName: [String:String]?
    public var description: [String:String]?
    public var interactionType: String
    public var linkName: String?
    public var mappings: [RelationshipLinkFieldMappingProtocol?]?
    public var profilePropertyReferences: [ParticipantProfilePropertyReferenceProtocol]
    public var provisioningState: ProvisioningStatesEnum?
    public var relatedProfilePropertyReferences: [ParticipantProfilePropertyReferenceProtocol]
    public var relationshipName: String
    public var relationshipGuidId: String?
    public var tenantId: String?

        enum CodingKeys: String, CodingKey {case displayName = "displayName"
        case description = "description"
        case interactionType = "interactionType"
        case linkName = "linkName"
        case mappings = "mappings"
        case profilePropertyReferences = "profilePropertyReferences"
        case provisioningState = "provisioningState"
        case relatedProfilePropertyReferences = "relatedProfilePropertyReferences"
        case relationshipName = "relationshipName"
        case relationshipGuidId = "relationshipGuidId"
        case tenantId = "tenantId"
        }

  public init(interactionType: String, profilePropertyReferences: [ParticipantProfilePropertyReferenceProtocol], relatedProfilePropertyReferences: [ParticipantProfilePropertyReferenceProtocol], relationshipName: String)  {
    self.interactionType = interactionType
    self.profilePropertyReferences = profilePropertyReferences
    self.relatedProfilePropertyReferences = relatedProfilePropertyReferences
    self.relationshipName = relationshipName
  }

  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(.description) {
        self.description = try container.decode([String:String]?.self, forKey: .description)
    }
    self.interactionType = try container.decode(String.self, forKey: .interactionType)
    if container.contains(.linkName) {
        self.linkName = try container.decode(String?.self, forKey: .linkName)
    }
    if container.contains(.mappings) {
        self.mappings = try container.decode([RelationshipLinkFieldMappingData?]?.self, forKey: .mappings)
    }
    self.profilePropertyReferences = try container.decode([ParticipantProfilePropertyReferenceData].self, forKey: .profilePropertyReferences)
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(ProvisioningStatesEnum?.self, forKey: .provisioningState)
    }
    self.relatedProfilePropertyReferences = try container.decode([ParticipantProfilePropertyReferenceData].self, forKey: .relatedProfilePropertyReferences)
    self.relationshipName = try container.decode(String.self, forKey: .relationshipName)
    if container.contains(.relationshipGuidId) {
        self.relationshipGuidId = try container.decode(String?.self, forKey: .relationshipGuidId)
    }
    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.displayName != nil {try container.encode(self.displayName, forKey: .displayName)}
    if self.description != nil {try container.encode(self.description, forKey: .description)}
    try container.encode(self.interactionType, forKey: .interactionType)
    if self.linkName != nil {try container.encode(self.linkName, forKey: .linkName)}
    if self.mappings != nil {try container.encode(self.mappings as! [RelationshipLinkFieldMappingData?]?, forKey: .mappings)}
    try container.encode(self.profilePropertyReferences as! [ParticipantProfilePropertyReferenceData], forKey: .profilePropertyReferences)
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    try container.encode(self.relatedProfilePropertyReferences as! [ParticipantProfilePropertyReferenceData], forKey: .relatedProfilePropertyReferences)
    try container.encode(self.relationshipName, forKey: .relationshipName)
    if self.relationshipGuidId != nil {try container.encode(self.relationshipGuidId, forKey: .relationshipGuidId)}
    if self.tenantId != nil {try container.encode(self.tenantId, forKey: .tenantId)}
  }
}

extension DataFactory {
  public static func createRelationshipLinkDefinitionProtocol(interactionType: String, profilePropertyReferences: [ParticipantProfilePropertyReferenceProtocol], relatedProfilePropertyReferences: [ParticipantProfilePropertyReferenceProtocol], relationshipName: String) -> RelationshipLinkDefinitionProtocol {
    return RelationshipLinkDefinitionData(interactionType: interactionType, profilePropertyReferences: profilePropertyReferences, relatedProfilePropertyReferences: relatedProfilePropertyReferences, relationshipName: relationshipName)
  }
}


// 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 RelationshipLinkFieldMappingData : RelationshipLinkFieldMappingProtocol {
    public var interactionFieldName: String
    public var linkType: LinkTypesEnum?
    public var relationshipFieldName: String

        enum CodingKeys: String, CodingKey {case interactionFieldName = "interactionFieldName"
        case linkType = "linkType"
        case relationshipFieldName = "relationshipFieldName"
        }

  public init(interactionFieldName: String, relationshipFieldName: String)  {
    self.interactionFieldName = interactionFieldName
    self.relationshipFieldName = relationshipFieldName
  }

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

extension DataFactory {
  public static func createRelationshipLinkFieldMappingProtocol(interactionFieldName: String, relationshipFieldName: String) -> RelationshipLinkFieldMappingProtocol {
    return RelationshipLinkFieldMappingData(interactionFieldName: interactionFieldName, relationshipFieldName: relationshipFieldName)
  }
}


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

extension DataFactory {
  public static func createRelationshipLinkListResultProtocol() -> RelationshipLinkListResultProtocol {
    return RelationshipLinkListResultData()
  }
}


// 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 RelationshipLinkResourceFormatData : RelationshipLinkResourceFormatProtocol, ProxyResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: RelationshipLinkDefinitionProtocol?

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

extension DataFactory {
  public static func createRelationshipLinkResourceFormatProtocol() -> RelationshipLinkResourceFormatProtocol {
    return RelationshipLinkResourceFormatData()
  }
}


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

extension DataFactory {
  public static func createRelationshipListResultProtocol() -> RelationshipListResultProtocol {
    return RelationshipListResultData()
  }
}


// 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 RelationshipResourceFormatData : RelationshipResourceFormatProtocol, ProxyResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: RelationshipDefinitionProtocol?

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

extension DataFactory {
  public static func createRelationshipResourceFormatProtocol() -> RelationshipResourceFormatProtocol {
    return RelationshipResourceFormatData()
  }
}


// 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 RelationshipsLookupData : RelationshipsLookupProtocol {
    public var profileName: String?
    public var profilePropertyReferences: [ParticipantProfilePropertyReferenceProtocol?]?
    public var relatedProfileName: String?
    public var relatedProfilePropertyReferences: [ParticipantProfilePropertyReferenceProtocol?]?
    public var existingRelationshipName: String?

        enum CodingKeys: String, CodingKey {case profileName = "profileName"
        case profilePropertyReferences = "profilePropertyReferences"
        case relatedProfileName = "relatedProfileName"
        case relatedProfilePropertyReferences = "relatedProfilePropertyReferences"
        case existingRelationshipName = "existingRelationshipName"
        }

  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(.profilePropertyReferences) {
        self.profilePropertyReferences = try container.decode([ParticipantProfilePropertyReferenceData?]?.self, forKey: .profilePropertyReferences)
    }
    if container.contains(.relatedProfileName) {
        self.relatedProfileName = try container.decode(String?.self, forKey: .relatedProfileName)
    }
    if container.contains(.relatedProfilePropertyReferences) {
        self.relatedProfilePropertyReferences = try container.decode([ParticipantProfilePropertyReferenceData?]?.self, forKey: .relatedProfilePropertyReferences)
    }
    if container.contains(.existingRelationshipName) {
        self.existingRelationshipName = try container.decode(String?.self, forKey: .existingRelationshipName)
    }
    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.profilePropertyReferences != nil {try container.encode(self.profilePropertyReferences as! [ParticipantProfilePropertyReferenceData?]?, forKey: .profilePropertyReferences)}
    if self.relatedProfileName != nil {try container.encode(self.relatedProfileName, forKey: .relatedProfileName)}
    if self.relatedProfilePropertyReferences != nil {try container.encode(self.relatedProfilePropertyReferences as! [ParticipantProfilePropertyReferenceData?]?, forKey: .relatedProfilePropertyReferences)}
    if self.existingRelationshipName != nil {try container.encode(self.existingRelationshipName, forKey: .existingRelationshipName)}
  }
}

extension DataFactory {
  public static func createRelationshipsLookupProtocol() -> RelationshipsLookupProtocol {
    return RelationshipsLookupData()
  }
}


// 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 RelationshipTypeFieldMappingData : RelationshipTypeFieldMappingProtocol {
    public var profileFieldName: String
    public var relatedProfileKeyProperty: String

        enum CodingKeys: String, CodingKey {case profileFieldName = "profileFieldName"
        case relatedProfileKeyProperty = "relatedProfileKeyProperty"
        }

  public init(profileFieldName: String, relatedProfileKeyProperty: String)  {
    self.profileFieldName = profileFieldName
    self.relatedProfileKeyProperty = relatedProfileKeyProperty
  }

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

extension DataFactory {
  public static func createRelationshipTypeFieldMappingProtocol(profileFieldName: String, relatedProfileKeyProperty: String) -> RelationshipTypeFieldMappingProtocol {
    return RelationshipTypeFieldMappingData(profileFieldName: profileFieldName, relatedProfileKeyProperty: relatedProfileKeyProperty)
  }
}


// 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 RelationshipTypeMappingData : RelationshipTypeMappingProtocol {
    public var fieldMappings: [RelationshipTypeFieldMappingProtocol]

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

  public init(fieldMappings: [RelationshipTypeFieldMappingProtocol])  {
    self.fieldMappings = fieldMappings
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.fieldMappings = try container.decode([RelationshipTypeFieldMappingData].self, forKey: .fieldMappings)
    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.fieldMappings as! [RelationshipTypeFieldMappingData], forKey: .fieldMappings)
  }
}

extension DataFactory {
  public static func createRelationshipTypeMappingProtocol(fieldMappings: [RelationshipTypeFieldMappingProtocol]) -> RelationshipTypeMappingProtocol {
    return RelationshipTypeMappingData(fieldMappings: fieldMappings)
  }
}


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

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

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

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


// 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 ResourceSetDescriptionData : ResourceSetDescriptionProtocol {
    public var elements: [String]?
    public var exceptions: [String]?

        enum CodingKeys: String, CodingKey {case elements = "elements"
        case exceptions = "exceptions"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createResourceSetDescriptionProtocol() -> ResourceSetDescriptionProtocol {
    return ResourceSetDescriptionData()
  }
}


// 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 RoleAssignmentData : RoleAssignmentProtocol {
    public var tenantId: String?
    public var assignmentName: String?
    public var displayName: [String:String]?
    public var description: [String:String]?
    public var provisioningState: ProvisioningStatesEnum?
    public var role: RoleTypesEnum
    public var principals: [AssignmentPrincipalProtocol]
    public var profiles: ResourceSetDescriptionProtocol?
    public var interactions: ResourceSetDescriptionProtocol?
    public var links: ResourceSetDescriptionProtocol?
    public var kpis: ResourceSetDescriptionProtocol?
    public var sasPolicies: ResourceSetDescriptionProtocol?
    public var connectors: ResourceSetDescriptionProtocol?
    public var views: ResourceSetDescriptionProtocol?
    public var relationshipLinks: ResourceSetDescriptionProtocol?
    public var relationships: ResourceSetDescriptionProtocol?
    public var widgetTypes: ResourceSetDescriptionProtocol?
    public var roleAssignments: ResourceSetDescriptionProtocol?
    public var conflationPolicies: ResourceSetDescriptionProtocol?
    public var segments: ResourceSetDescriptionProtocol?

        enum CodingKeys: String, CodingKey {case tenantId = "tenantId"
        case assignmentName = "assignmentName"
        case displayName = "displayName"
        case description = "description"
        case provisioningState = "provisioningState"
        case role = "role"
        case principals = "principals"
        case profiles = "profiles"
        case interactions = "interactions"
        case links = "links"
        case kpis = "kpis"
        case sasPolicies = "sasPolicies"
        case connectors = "connectors"
        case views = "views"
        case relationshipLinks = "relationshipLinks"
        case relationships = "relationships"
        case widgetTypes = "widgetTypes"
        case roleAssignments = "roleAssignments"
        case conflationPolicies = "conflationPolicies"
        case segments = "segments"
        }

  public init(role: RoleTypesEnum, principals: [AssignmentPrincipalProtocol])  {
    self.role = role
    self.principals = principals
  }

  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(.assignmentName) {
        self.assignmentName = try container.decode(String?.self, forKey: .assignmentName)
    }
    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(.provisioningState) {
        self.provisioningState = try container.decode(ProvisioningStatesEnum?.self, forKey: .provisioningState)
    }
    self.role = try container.decode(RoleTypesEnum.self, forKey: .role)
    self.principals = try container.decode([AssignmentPrincipalData].self, forKey: .principals)
    if container.contains(.profiles) {
        self.profiles = try container.decode(ResourceSetDescriptionData?.self, forKey: .profiles)
    }
    if container.contains(.interactions) {
        self.interactions = try container.decode(ResourceSetDescriptionData?.self, forKey: .interactions)
    }
    if container.contains(.links) {
        self.links = try container.decode(ResourceSetDescriptionData?.self, forKey: .links)
    }
    if container.contains(.kpis) {
        self.kpis = try container.decode(ResourceSetDescriptionData?.self, forKey: .kpis)
    }
    if container.contains(.sasPolicies) {
        self.sasPolicies = try container.decode(ResourceSetDescriptionData?.self, forKey: .sasPolicies)
    }
    if container.contains(.connectors) {
        self.connectors = try container.decode(ResourceSetDescriptionData?.self, forKey: .connectors)
    }
    if container.contains(.views) {
        self.views = try container.decode(ResourceSetDescriptionData?.self, forKey: .views)
    }
    if container.contains(.relationshipLinks) {
        self.relationshipLinks = try container.decode(ResourceSetDescriptionData?.self, forKey: .relationshipLinks)
    }
    if container.contains(.relationships) {
        self.relationships = try container.decode(ResourceSetDescriptionData?.self, forKey: .relationships)
    }
    if container.contains(.widgetTypes) {
        self.widgetTypes = try container.decode(ResourceSetDescriptionData?.self, forKey: .widgetTypes)
    }
    if container.contains(.roleAssignments) {
        self.roleAssignments = try container.decode(ResourceSetDescriptionData?.self, forKey: .roleAssignments)
    }
    if container.contains(.conflationPolicies) {
        self.conflationPolicies = try container.decode(ResourceSetDescriptionData?.self, forKey: .conflationPolicies)
    }
    if container.contains(.segments) {
        self.segments = try container.decode(ResourceSetDescriptionData?.self, forKey: .segments)
    }
    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.assignmentName != nil {try container.encode(self.assignmentName, forKey: .assignmentName)}
    if self.displayName != nil {try container.encode(self.displayName, forKey: .displayName)}
    if self.description != nil {try container.encode(self.description, forKey: .description)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    try container.encode(self.role, forKey: .role)
    try container.encode(self.principals as! [AssignmentPrincipalData], forKey: .principals)
    if self.profiles != nil {try container.encode(self.profiles as! ResourceSetDescriptionData?, forKey: .profiles)}
    if self.interactions != nil {try container.encode(self.interactions as! ResourceSetDescriptionData?, forKey: .interactions)}
    if self.links != nil {try container.encode(self.links as! ResourceSetDescriptionData?, forKey: .links)}
    if self.kpis != nil {try container.encode(self.kpis as! ResourceSetDescriptionData?, forKey: .kpis)}
    if self.sasPolicies != nil {try container.encode(self.sasPolicies as! ResourceSetDescriptionData?, forKey: .sasPolicies)}
    if self.connectors != nil {try container.encode(self.connectors as! ResourceSetDescriptionData?, forKey: .connectors)}
    if self.views != nil {try container.encode(self.views as! ResourceSetDescriptionData?, forKey: .views)}
    if self.relationshipLinks != nil {try container.encode(self.relationshipLinks as! ResourceSetDescriptionData?, forKey: .relationshipLinks)}
    if self.relationships != nil {try container.encode(self.relationships as! ResourceSetDescriptionData?, forKey: .relationships)}
    if self.widgetTypes != nil {try container.encode(self.widgetTypes as! ResourceSetDescriptionData?, forKey: .widgetTypes)}
    if self.roleAssignments != nil {try container.encode(self.roleAssignments as! ResourceSetDescriptionData?, forKey: .roleAssignments)}
    if self.conflationPolicies != nil {try container.encode(self.conflationPolicies as! ResourceSetDescriptionData?, forKey: .conflationPolicies)}
    if self.segments != nil {try container.encode(self.segments as! ResourceSetDescriptionData?, forKey: .segments)}
  }
}

extension DataFactory {
  public static func createRoleAssignmentProtocol(role: RoleTypesEnum, principals: [AssignmentPrincipalProtocol]) -> RoleAssignmentProtocol {
    return RoleAssignmentData(role: role, principals: principals)
  }
}


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

extension DataFactory {
  public static func createRoleAssignmentListResultProtocol() -> RoleAssignmentListResultProtocol {
    return RoleAssignmentListResultData()
  }
}


// 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 RoleAssignmentResourceFormatData : RoleAssignmentResourceFormatProtocol, ProxyResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: RoleAssignmentProtocol?

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

extension DataFactory {
  public static func createRoleAssignmentResourceFormatProtocol() -> RoleAssignmentResourceFormatProtocol {
    return RoleAssignmentResourceFormatData()
  }
}


// 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 RoleData : RoleProtocol {
    public var roleName: String?
    public var description: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createRoleProtocol() -> RoleProtocol {
    return RoleData()
  }
}


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

extension DataFactory {
  public static func createRoleListResultProtocol() -> RoleListResultProtocol {
    return RoleListResultData()
  }
}


// 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 RoleResourceFormatData : RoleResourceFormatProtocol, ProxyResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: RoleProtocol?

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

extension DataFactory {
  public static func createRoleResourceFormatProtocol() -> RoleResourceFormatProtocol {
    return RoleResourceFormatData()
  }
}


// RoleTypes enumerates the values for role 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 RoleTypesEnum: String, Codable
{
// Admin specifies the admin state for role types.
    case Admin = "Admin"
// DataAdmin specifies the data admin state for role types.
    case DataAdmin = "DataAdmin"
// DataReader specifies the data reader state for role types.
    case DataReader = "DataReader"
// ManageAdmin specifies the manage admin state for role types.
    case ManageAdmin = "ManageAdmin"
// ManageReader specifies the manage reader state for role types.
    case ManageReader = "ManageReader"
// Reader specifies the reader state for role types.
    case Reader = "Reader"
}


// 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 SalesforceConnectorPropertiesData : SalesforceConnectorPropertiesProtocol {
    public var usersetting: SalesforceDiscoverSettingProtocol
    public var salesforcetables: [SalesforceTableProtocol]

        enum CodingKeys: String, CodingKey {case usersetting = "usersetting"
        case salesforcetables = "salesforcetables"
        }

  public init(usersetting: SalesforceDiscoverSettingProtocol, salesforcetables: [SalesforceTableProtocol])  {
    self.usersetting = usersetting
    self.salesforcetables = salesforcetables
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.usersetting = try container.decode(SalesforceDiscoverSettingData.self, forKey: .usersetting)
    self.salesforcetables = try container.decode([SalesforceTableData].self, forKey: .salesforcetables)
    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.usersetting as! SalesforceDiscoverSettingData, forKey: .usersetting)
    try container.encode(self.salesforcetables as! [SalesforceTableData], forKey: .salesforcetables)
  }
}

extension DataFactory {
  public static func createSalesforceConnectorPropertiesProtocol(usersetting: SalesforceDiscoverSettingProtocol, salesforcetables: [SalesforceTableProtocol]) -> SalesforceConnectorPropertiesProtocol {
    return SalesforceConnectorPropertiesData(usersetting: usersetting, salesforcetables: salesforcetables)
  }
}


// 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 SalesforceDiscoverSettingData : SalesforceDiscoverSettingProtocol {
    public var salesforceConnectionStringSecretUrl: String

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

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

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

extension DataFactory {
  public static func createSalesforceDiscoverSettingProtocol(salesforceConnectionStringSecretUrl: String) -> SalesforceDiscoverSettingProtocol {
    return SalesforceDiscoverSettingData(salesforceConnectionStringSecretUrl: salesforceConnectionStringSecretUrl)
  }
}


// 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 SalesforceTableData : SalesforceTableProtocol {
    public var isProfile: String?
    public var tableCategory: String
    public var tableName: String
    public var tableRemarks: String?
    public var tableSchema: String

        enum CodingKeys: String, CodingKey {case isProfile = "isProfile"
        case tableCategory = "tableCategory"
        case tableName = "tableName"
        case tableRemarks = "tableRemarks"
        case tableSchema = "tableSchema"
        }

  public init(tableCategory: String, tableName: String, tableSchema: String)  {
    self.tableCategory = tableCategory
    self.tableName = tableName
    self.tableSchema = tableSchema
  }

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

extension DataFactory {
  public static func createSalesforceTableProtocol(tableCategory: String, tableName: String, tableSchema: String) -> SalesforceTableProtocol {
    return SalesforceTableData(tableCategory: tableCategory, tableName: tableName, tableSchema: tableSchema)
  }
}


// Status enumerates the values for status.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum StatusEnum: String, Codable
{
// StatusActive specifies the status active state for status.
    case StatusActive = "Active"
// StatusDeleted specifies the status deleted state for status.
    case StatusDeleted = "Deleted"
// StatusNone specifies the status none state for status.
    case StatusNone = "None"
}


// 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 StrongIdData : StrongIdProtocol {
    public var keyPropertyNames: [String]
    public var strongIdName: String
    public var displayName: [String:String]?
    public var description: [String:String]?

        enum CodingKeys: String, CodingKey {case keyPropertyNames = "keyPropertyNames"
        case strongIdName = "strongIdName"
        case displayName = "displayName"
        case description = "description"
        }

  public init(keyPropertyNames: [String], strongIdName: String)  {
    self.keyPropertyNames = keyPropertyNames
    self.strongIdName = strongIdName
  }

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

extension DataFactory {
  public static func createStrongIdProtocol(keyPropertyNames: [String], strongIdName: String) -> StrongIdProtocol {
    return StrongIdData(keyPropertyNames: keyPropertyNames, strongIdName: strongIdName)
  }
}


// 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 SuggestRelationshipLinksResponseData : SuggestRelationshipLinksResponseProtocol {
    public var interactionName: String?
    public var suggestedRelationships: [RelationshipsLookupProtocol?]?

        enum CodingKeys: String, CodingKey {case interactionName = "interactionName"
        case suggestedRelationships = "suggestedRelationships"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createSuggestRelationshipLinksResponseProtocol() -> SuggestRelationshipLinksResponseProtocol {
    return SuggestRelationshipLinksResponseData()
  }
}


// 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 TypePropertiesMappingData : TypePropertiesMappingProtocol {
    public var sourcePropertyName: String
    public var targetPropertyName: String
    public var linkType: LinkTypesEnum?

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

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

extension DataFactory {
  public static func createTypePropertiesMappingProtocol(sourcePropertyName: String, targetPropertyName: String) -> TypePropertiesMappingProtocol {
    return TypePropertiesMappingData(sourcePropertyName: sourcePropertyName, targetPropertyName: targetPropertyName)
  }
}


// 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 ViewData : ViewProtocol {
    public var viewName: String?
    public var userId: String?
    public var tenantId: String?
    public var displayName: [String:String]?
    public var definition: String
    public var changed: Date?
    public var created: Date?

        enum CodingKeys: String, CodingKey {case viewName = "viewName"
        case userId = "userId"
        case tenantId = "tenantId"
        case displayName = "displayName"
        case definition = "definition"
        case changed = "changed"
        case created = "created"
        }

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

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.viewName) {
        self.viewName = try container.decode(String?.self, forKey: .viewName)
    }
    if container.contains(.userId) {
        self.userId = try container.decode(String?.self, forKey: .userId)
    }
    if container.contains(.tenantId) {
        self.tenantId = try container.decode(String?.self, forKey: .tenantId)
    }
    if container.contains(.displayName) {
        self.displayName = try container.decode([String:String]?.self, forKey: .displayName)
    }
    self.definition = try container.decode(String.self, forKey: .definition)
    if container.contains(.changed) {
        self.changed = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .changed)), format: .dateTime)
    }
    if container.contains(.created) {
        self.created = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .created)), format: .dateTime)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.viewName != nil {try container.encode(self.viewName, forKey: .viewName)}
    if self.userId != nil {try container.encode(self.userId, forKey: .userId)}
    if self.tenantId != nil {try container.encode(self.tenantId, forKey: .tenantId)}
    if self.displayName != nil {try container.encode(self.displayName, forKey: .displayName)}
    try container.encode(self.definition, forKey: .definition)
    if self.changed != nil {
        try container.encode(DateConverter.toString(date: self.changed!, format: .dateTime), forKey: .changed)
    }
    if self.created != nil {
        try container.encode(DateConverter.toString(date: self.created!, format: .dateTime), forKey: .created)
    }
  }
}

extension DataFactory {
  public static func createViewProtocol(definition: String) -> ViewProtocol {
    return ViewData(definition: definition)
  }
}


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

extension DataFactory {
  public static func createViewListResultProtocol() -> ViewListResultProtocol {
    return ViewListResultData()
  }
}


// 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 ViewResourceFormatData : ViewResourceFormatProtocol, ProxyResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: ViewProtocol?

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

extension DataFactory {
  public static func createViewResourceFormatProtocol() -> ViewResourceFormatProtocol {
    return ViewResourceFormatData()
  }
}


// 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 WidgetTypeData : WidgetTypeProtocol {
    public var widgetTypeName: String?
    public var definition: String
    public var description: String?
    public var displayName: [String:String]?
    public var imageUrl: String?
    public var tenantId: String?
    public var widgetVersion: String?
    public var changed: Date?
    public var created: Date?

        enum CodingKeys: String, CodingKey {case widgetTypeName = "widgetTypeName"
        case definition = "definition"
        case description = "description"
        case displayName = "displayName"
        case imageUrl = "imageUrl"
        case tenantId = "tenantId"
        case widgetVersion = "widgetVersion"
        case changed = "changed"
        case created = "created"
        }

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

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.widgetTypeName) {
        self.widgetTypeName = try container.decode(String?.self, forKey: .widgetTypeName)
    }
    self.definition = try container.decode(String.self, forKey: .definition)
    if container.contains(.description) {
        self.description = try container.decode(String?.self, forKey: .description)
    }
    if container.contains(.displayName) {
        self.displayName = try container.decode([String:String]?.self, forKey: .displayName)
    }
    if container.contains(.imageUrl) {
        self.imageUrl = try container.decode(String?.self, forKey: .imageUrl)
    }
    if container.contains(.tenantId) {
        self.tenantId = try container.decode(String?.self, forKey: .tenantId)
    }
    if container.contains(.widgetVersion) {
        self.widgetVersion = try container.decode(String?.self, forKey: .widgetVersion)
    }
    if container.contains(.changed) {
        self.changed = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .changed)), format: .dateTime)
    }
    if container.contains(.created) {
        self.created = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .created)), format: .dateTime)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.widgetTypeName != nil {try container.encode(self.widgetTypeName, forKey: .widgetTypeName)}
    try container.encode(self.definition, forKey: .definition)
    if self.description != nil {try container.encode(self.description, forKey: .description)}
    if self.displayName != nil {try container.encode(self.displayName, forKey: .displayName)}
    if self.imageUrl != nil {try container.encode(self.imageUrl, forKey: .imageUrl)}
    if self.tenantId != nil {try container.encode(self.tenantId, forKey: .tenantId)}
    if self.widgetVersion != nil {try container.encode(self.widgetVersion, forKey: .widgetVersion)}
    if self.changed != nil {
        try container.encode(DateConverter.toString(date: self.changed!, format: .dateTime), forKey: .changed)
    }
    if self.created != nil {
        try container.encode(DateConverter.toString(date: self.created!, format: .dateTime), forKey: .created)
    }
  }
}

extension DataFactory {
  public static func createWidgetTypeProtocol(definition: String) -> WidgetTypeProtocol {
    return WidgetTypeData(definition: definition)
  }
}


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

extension DataFactory {
  public static func createWidgetTypeListResultProtocol() -> WidgetTypeListResultProtocol {
    return WidgetTypeListResultData()
  }
}


// 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 WidgetTypeResourceFormatData : WidgetTypeResourceFormatProtocol, ProxyResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: WidgetTypeProtocol?

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

extension DataFactory {
  public static func createWidgetTypeResourceFormatProtocol() -> WidgetTypeResourceFormatProtocol {
    return WidgetTypeResourceFormatData()
  }
}


// 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
// AssignmentPrincipalProtocol is the AssignmentPrincipal
public protocol AssignmentPrincipalProtocol : Codable {
     var principalId: String { get set }
     var principalType: String { get set }
     var principalMetadata: [String:String]? { get set }
}


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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// AuthorizationPolicyProtocol is the authorization policy.
public protocol AuthorizationPolicyProtocol : Codable {
     var policyName: String? { get set }
     var permissions: [PermissionTypesEnum] { get set }
     var primaryKey: String? { get set }
     var secondaryKey: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// AuthorizationPolicyResourceFormatProtocol is the authorization policy resource format.
public protocol AuthorizationPolicyResourceFormatProtocol : ProxyResourceProtocol {
     var properties: AuthorizationPolicyProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// AzureBlobConnectorPropertiesProtocol is the Azure Blob connector properties.
public protocol AzureBlobConnectorPropertiesProtocol : Codable {
     var connectionKeyVaultUrl: String { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CanonicalProfileDefinitionPropertiesItemProtocol is the definition of a canonical profile property.
public protocol CanonicalProfileDefinitionPropertiesItemProtocol : Codable {
     var profileName: String? { get set }
     var profilePropertyName: String? { get set }
     var rank: Int32? { get set }
     var type: CanonicalPropertyValueTypeEnum? { get set }
     var value: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CanonicalProfileDefinitionProtocol is definition of canonical profile.
public protocol CanonicalProfileDefinitionProtocol : Codable {
     var canonicalProfileId: Int32? { get set }
     var properties: [CanonicalProfileDefinitionPropertiesItemProtocol?]? { get set }
}


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