// 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 IntegrationAccountCertificatePropertiesData : IntegrationAccountCertificatePropertiesProtocol {
    public var createdTime: Date?
    public var changedTime: Date?
    public var metadata: [String: String?]?
    public var key: KeyVaultKeyReferenceProtocol?
    public var publicCertificate: String?

        enum CodingKeys: String, CodingKey {case createdTime = "createdTime"
        case changedTime = "changedTime"
        case metadata = "metadata"
        case key = "key"
        case publicCertificate = "publicCertificate"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.createdTime) {
        self.createdTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .createdTime)), format: .dateTime)
    }
    if container.contains(.changedTime) {
        self.changedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .changedTime)), format: .dateTime)
    }
    if container.contains(.metadata) {
        self.metadata = try container.decode([String: String?]?.self, forKey: .metadata)
    }
    if container.contains(.key) {
        self.key = try container.decode(KeyVaultKeyReferenceData?.self, forKey: .key)
    }
    if container.contains(.publicCertificate) {
        self.publicCertificate = try container.decode(String?.self, forKey: .publicCertificate)
    }
    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.createdTime != nil {
        try container.encode(DateConverter.toString(date: self.createdTime!, format: .dateTime), forKey: .createdTime)
    }
    if self.changedTime != nil {
        try container.encode(DateConverter.toString(date: self.changedTime!, format: .dateTime), forKey: .changedTime)
    }
    if self.metadata != nil {try container.encode(self.metadata, forKey: .metadata)}
    if self.key != nil {try container.encode(self.key as! KeyVaultKeyReferenceData?, forKey: .key)}
    if self.publicCertificate != nil {try container.encode(self.publicCertificate, forKey: .publicCertificate)}
  }
}

extension DataFactory {
  public static func createIntegrationAccountCertificatePropertiesProtocol() -> IntegrationAccountCertificatePropertiesProtocol {
    return IntegrationAccountCertificatePropertiesData()
  }
}


// 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 IntegrationAccountData : IntegrationAccountProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?
    public var properties: [String: String?]?
    public var sku: IntegrationAccountSkuProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createIntegrationAccountProtocol() -> IntegrationAccountProtocol {
    return IntegrationAccountData()
  }
}


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

extension DataFactory {
  public static func createIntegrationAccountListResultProtocol() -> IntegrationAccountListResultProtocol {
    return IntegrationAccountListResultData()
  }
}


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

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

  public init(properties: IntegrationAccountMapPropertiesProtocol)  {
    self.properties = properties
  }

  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)
    }
    self.properties = try container.decode(IntegrationAccountMapPropertiesData.self, forKey: .properties)
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

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

extension DataFactory {
  public static func createIntegrationAccountMapProtocol(properties: IntegrationAccountMapPropertiesProtocol) -> IntegrationAccountMapProtocol {
    return IntegrationAccountMapData(properties: properties)
  }
}


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

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

  public init(mapType: MapTypeEnum)  {
    self.mapType = mapType
  }

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

extension DataFactory {
  public static func createIntegrationAccountMapFilterProtocol(mapType: MapTypeEnum) -> IntegrationAccountMapFilterProtocol {
    return IntegrationAccountMapFilterData(mapType: mapType)
  }
}


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

extension DataFactory {
  public static func createIntegrationAccountMapListResultProtocol() -> IntegrationAccountMapListResultProtocol {
    return IntegrationAccountMapListResultData()
  }
}


// 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 IntegrationAccountMapPropertiesData : IntegrationAccountMapPropertiesProtocol {
    public var mapType: MapTypeEnum
    public var parametersSchema: IntegrationAccountMapPropertiesParametersSchemaProtocol?
    public var createdTime: Date?
    public var changedTime: Date?
    public var content: String?
    public var contentType: String?
    public var contentLink: ContentLinkProtocol?
    public var metadata: [String: String?]?

        enum CodingKeys: String, CodingKey {case mapType = "mapType"
        case parametersSchema = "parametersSchema"
        case createdTime = "createdTime"
        case changedTime = "changedTime"
        case content = "content"
        case contentType = "contentType"
        case contentLink = "contentLink"
        case metadata = "metadata"
        }

  public init(mapType: MapTypeEnum)  {
    self.mapType = mapType
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.mapType = try container.decode(MapTypeEnum.self, forKey: .mapType)
    if container.contains(.parametersSchema) {
        self.parametersSchema = try container.decode(IntegrationAccountMapPropertiesParametersSchemaData?.self, forKey: .parametersSchema)
    }
    if container.contains(.createdTime) {
        self.createdTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .createdTime)), format: .dateTime)
    }
    if container.contains(.changedTime) {
        self.changedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .changedTime)), format: .dateTime)
    }
    if container.contains(.content) {
        self.content = try container.decode(String?.self, forKey: .content)
    }
    if container.contains(.contentType) {
        self.contentType = try container.decode(String?.self, forKey: .contentType)
    }
    if container.contains(.contentLink) {
        self.contentLink = try container.decode(ContentLinkData?.self, forKey: .contentLink)
    }
    if container.contains(.metadata) {
        self.metadata = try container.decode([String: String?]?.self, forKey: .metadata)
    }
    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.mapType, forKey: .mapType)
    if self.parametersSchema != nil {try container.encode(self.parametersSchema as! IntegrationAccountMapPropertiesParametersSchemaData?, forKey: .parametersSchema)}
    if self.createdTime != nil {
        try container.encode(DateConverter.toString(date: self.createdTime!, format: .dateTime), forKey: .createdTime)
    }
    if self.changedTime != nil {
        try container.encode(DateConverter.toString(date: self.changedTime!, format: .dateTime), forKey: .changedTime)
    }
    if self.content != nil {try container.encode(self.content, forKey: .content)}
    if self.contentType != nil {try container.encode(self.contentType, forKey: .contentType)}
    if self.contentLink != nil {try container.encode(self.contentLink as! ContentLinkData?, forKey: .contentLink)}
    if self.metadata != nil {try container.encode(self.metadata, forKey: .metadata)}
  }
}

extension DataFactory {
  public static func createIntegrationAccountMapPropertiesProtocol(mapType: MapTypeEnum) -> IntegrationAccountMapPropertiesProtocol {
    return IntegrationAccountMapPropertiesData(mapType: mapType)
  }
}


// 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 IntegrationAccountMapPropertiesParametersSchemaData : IntegrationAccountMapPropertiesParametersSchemaProtocol {
    public var ref: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createIntegrationAccountMapPropertiesParametersSchemaProtocol() -> IntegrationAccountMapPropertiesParametersSchemaProtocol {
    return IntegrationAccountMapPropertiesParametersSchemaData()
  }
}


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

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

  public init(properties: IntegrationAccountPartnerPropertiesProtocol)  {
    self.properties = properties
  }

  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)
    }
    self.properties = try container.decode(IntegrationAccountPartnerPropertiesData.self, forKey: .properties)
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

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

extension DataFactory {
  public static func createIntegrationAccountPartnerProtocol(properties: IntegrationAccountPartnerPropertiesProtocol) -> IntegrationAccountPartnerProtocol {
    return IntegrationAccountPartnerData(properties: properties)
  }
}


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

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

  public init(partnerType: PartnerTypeEnum)  {
    self.partnerType = partnerType
  }

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

extension DataFactory {
  public static func createIntegrationAccountPartnerFilterProtocol(partnerType: PartnerTypeEnum) -> IntegrationAccountPartnerFilterProtocol {
    return IntegrationAccountPartnerFilterData(partnerType: partnerType)
  }
}


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

extension DataFactory {
  public static func createIntegrationAccountPartnerListResultProtocol() -> IntegrationAccountPartnerListResultProtocol {
    return IntegrationAccountPartnerListResultData()
  }
}


// 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 IntegrationAccountPartnerPropertiesData : IntegrationAccountPartnerPropertiesProtocol {
    public var partnerType: PartnerTypeEnum
    public var createdTime: Date?
    public var changedTime: Date?
    public var metadata: [String: String?]?
    public var content: PartnerContentProtocol

        enum CodingKeys: String, CodingKey {case partnerType = "partnerType"
        case createdTime = "createdTime"
        case changedTime = "changedTime"
        case metadata = "metadata"
        case content = "content"
        }

  public init(partnerType: PartnerTypeEnum, content: PartnerContentProtocol)  {
    self.partnerType = partnerType
    self.content = content
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.partnerType = try container.decode(PartnerTypeEnum.self, forKey: .partnerType)
    if container.contains(.createdTime) {
        self.createdTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .createdTime)), format: .dateTime)
    }
    if container.contains(.changedTime) {
        self.changedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .changedTime)), format: .dateTime)
    }
    if container.contains(.metadata) {
        self.metadata = try container.decode([String: String?]?.self, forKey: .metadata)
    }
    self.content = try container.decode(PartnerContentData.self, forKey: .content)
    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.partnerType, forKey: .partnerType)
    if self.createdTime != nil {
        try container.encode(DateConverter.toString(date: self.createdTime!, format: .dateTime), forKey: .createdTime)
    }
    if self.changedTime != nil {
        try container.encode(DateConverter.toString(date: self.changedTime!, format: .dateTime), forKey: .changedTime)
    }
    if self.metadata != nil {try container.encode(self.metadata, forKey: .metadata)}
    try container.encode(self.content as! PartnerContentData, forKey: .content)
  }
}

extension DataFactory {
  public static func createIntegrationAccountPartnerPropertiesProtocol(partnerType: PartnerTypeEnum, content: PartnerContentProtocol) -> IntegrationAccountPartnerPropertiesProtocol {
    return IntegrationAccountPartnerPropertiesData(partnerType: partnerType, content: content)
  }
}


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

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

  public init(properties: IntegrationAccountSchemaPropertiesProtocol)  {
    self.properties = properties
  }

  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)
    }
    self.properties = try container.decode(IntegrationAccountSchemaPropertiesData.self, forKey: .properties)
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

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

extension DataFactory {
  public static func createIntegrationAccountSchemaProtocol(properties: IntegrationAccountSchemaPropertiesProtocol) -> IntegrationAccountSchemaProtocol {
    return IntegrationAccountSchemaData(properties: properties)
  }
}


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

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

  public init(schemaType: SchemaTypeEnum)  {
    self.schemaType = schemaType
  }

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

extension DataFactory {
  public static func createIntegrationAccountSchemaFilterProtocol(schemaType: SchemaTypeEnum) -> IntegrationAccountSchemaFilterProtocol {
    return IntegrationAccountSchemaFilterData(schemaType: schemaType)
  }
}


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

extension DataFactory {
  public static func createIntegrationAccountSchemaListResultProtocol() -> IntegrationAccountSchemaListResultProtocol {
    return IntegrationAccountSchemaListResultData()
  }
}


// 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 IntegrationAccountSchemaPropertiesData : IntegrationAccountSchemaPropertiesProtocol {
    public var schemaType: SchemaTypeEnum
    public var targetNamespace: String?
    public var documentName: String?
    public var fileName: String?
    public var createdTime: Date?
    public var changedTime: Date?
    public var metadata: [String: String?]?
    public var content: String?
    public var contentType: String?
    public var contentLink: ContentLinkProtocol?

        enum CodingKeys: String, CodingKey {case schemaType = "schemaType"
        case targetNamespace = "targetNamespace"
        case documentName = "documentName"
        case fileName = "fileName"
        case createdTime = "createdTime"
        case changedTime = "changedTime"
        case metadata = "metadata"
        case content = "content"
        case contentType = "contentType"
        case contentLink = "contentLink"
        }

  public init(schemaType: SchemaTypeEnum)  {
    self.schemaType = schemaType
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.schemaType = try container.decode(SchemaTypeEnum.self, forKey: .schemaType)
    if container.contains(.targetNamespace) {
        self.targetNamespace = try container.decode(String?.self, forKey: .targetNamespace)
    }
    if container.contains(.documentName) {
        self.documentName = try container.decode(String?.self, forKey: .documentName)
    }
    if container.contains(.fileName) {
        self.fileName = try container.decode(String?.self, forKey: .fileName)
    }
    if container.contains(.createdTime) {
        self.createdTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .createdTime)), format: .dateTime)
    }
    if container.contains(.changedTime) {
        self.changedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .changedTime)), format: .dateTime)
    }
    if container.contains(.metadata) {
        self.metadata = try container.decode([String: String?]?.self, forKey: .metadata)
    }
    if container.contains(.content) {
        self.content = try container.decode(String?.self, forKey: .content)
    }
    if container.contains(.contentType) {
        self.contentType = try container.decode(String?.self, forKey: .contentType)
    }
    if container.contains(.contentLink) {
        self.contentLink = try container.decode(ContentLinkData?.self, forKey: .contentLink)
    }
    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.schemaType, forKey: .schemaType)
    if self.targetNamespace != nil {try container.encode(self.targetNamespace, forKey: .targetNamespace)}
    if self.documentName != nil {try container.encode(self.documentName, forKey: .documentName)}
    if self.fileName != nil {try container.encode(self.fileName, forKey: .fileName)}
    if self.createdTime != nil {
        try container.encode(DateConverter.toString(date: self.createdTime!, format: .dateTime), forKey: .createdTime)
    }
    if self.changedTime != nil {
        try container.encode(DateConverter.toString(date: self.changedTime!, format: .dateTime), forKey: .changedTime)
    }
    if self.metadata != nil {try container.encode(self.metadata, forKey: .metadata)}
    if self.content != nil {try container.encode(self.content, forKey: .content)}
    if self.contentType != nil {try container.encode(self.contentType, forKey: .contentType)}
    if self.contentLink != nil {try container.encode(self.contentLink as! ContentLinkData?, forKey: .contentLink)}
  }
}

extension DataFactory {
  public static func createIntegrationAccountSchemaPropertiesProtocol(schemaType: SchemaTypeEnum) -> IntegrationAccountSchemaPropertiesProtocol {
    return IntegrationAccountSchemaPropertiesData(schemaType: schemaType)
  }
}


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

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

  public init(properties: IntegrationAccountSessionPropertiesProtocol)  {
    self.properties = properties
  }

  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)
    }
    self.properties = try container.decode(IntegrationAccountSessionPropertiesData.self, forKey: .properties)
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

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

extension DataFactory {
  public static func createIntegrationAccountSessionProtocol(properties: IntegrationAccountSessionPropertiesProtocol) -> IntegrationAccountSessionProtocol {
    return IntegrationAccountSessionData(properties: properties)
  }
}


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

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

  public init(changedTime: Date)  {
    self.changedTime = changedTime
  }

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

extension DataFactory {
  public static func createIntegrationAccountSessionFilterProtocol(changedTime: Date) -> IntegrationAccountSessionFilterProtocol {
    return IntegrationAccountSessionFilterData(changedTime: changedTime)
  }
}


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

extension DataFactory {
  public static func createIntegrationAccountSessionListResultProtocol() -> IntegrationAccountSessionListResultProtocol {
    return IntegrationAccountSessionListResultData()
  }
}


// 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 IntegrationAccountSessionPropertiesData : IntegrationAccountSessionPropertiesProtocol {
    public var createdTime: Date?
    public var changedTime: Date?
    public var content: [String: String?]?

        enum CodingKeys: String, CodingKey {case createdTime = "createdTime"
        case changedTime = "changedTime"
        case content = "content"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createIntegrationAccountSessionPropertiesProtocol() -> IntegrationAccountSessionPropertiesProtocol {
    return IntegrationAccountSessionPropertiesData()
  }
}


// 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 IntegrationAccountSkuData : IntegrationAccountSkuProtocol {
    public var name: IntegrationAccountSkuNameEnum

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

  public init(name: IntegrationAccountSkuNameEnum)  {
    self.name = name
  }

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

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

extension DataFactory {
  public static func createIntegrationAccountSkuProtocol(name: IntegrationAccountSkuNameEnum) -> IntegrationAccountSkuProtocol {
    return IntegrationAccountSkuData(name: name)
  }
}


// IntegrationAccountSkuName enumerates the values for integration account sku name.

// 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 IntegrationAccountSkuNameEnum: String, Codable
{
// IntegrationAccountSkuNameFree specifies the integration account sku name free state for integration account sku
// name.
    case IntegrationAccountSkuNameFree = "Free"
// IntegrationAccountSkuNameNotSpecified specifies the integration account sku name not specified state for integration
// account sku name.
    case IntegrationAccountSkuNameNotSpecified = "NotSpecified"
// IntegrationAccountSkuNameStandard specifies the integration account sku name standard state for integration account
// sku name.
    case IntegrationAccountSkuNameStandard = "Standard"
}


// KeyType enumerates the values for key type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum KeyTypeEnum: String, Codable
{
// KeyTypeNotSpecified specifies the key type not specified state for key type.
    case KeyTypeNotSpecified = "NotSpecified"
// KeyTypePrimary specifies the key type primary state for key type.
    case KeyTypePrimary = "Primary"
// KeyTypeSecondary specifies the key type secondary state for key type.
    case KeyTypeSecondary = "Secondary"
}


// 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 KeyVaultKeyReferenceData : KeyVaultKeyReferenceProtocol {
    public var keyVault: KeyVaultKeyReferenceKeyVaultProtocol
    public var keyName: String
    public var keyVersion: String?

        enum CodingKeys: String, CodingKey {case keyVault = "keyVault"
        case keyName = "keyName"
        case keyVersion = "keyVersion"
        }

  public init(keyVault: KeyVaultKeyReferenceKeyVaultProtocol, keyName: String)  {
    self.keyVault = keyVault
    self.keyName = keyName
  }

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

extension DataFactory {
  public static func createKeyVaultKeyReferenceProtocol(keyVault: KeyVaultKeyReferenceKeyVaultProtocol, keyName: String) -> KeyVaultKeyReferenceProtocol {
    return KeyVaultKeyReferenceData(keyVault: keyVault, keyName: keyName)
  }
}


// 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 KeyVaultKeyReferenceKeyVaultData : KeyVaultKeyReferenceKeyVaultProtocol {
    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 createKeyVaultKeyReferenceKeyVaultProtocol() -> KeyVaultKeyReferenceKeyVaultProtocol {
    return KeyVaultKeyReferenceKeyVaultData()
  }
}


// MapType enumerates the values for map type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum MapTypeEnum: String, Codable
{
// MapTypeNotSpecified specifies the map type not specified state for map type.
    case MapTypeNotSpecified = "NotSpecified"
// MapTypeXslt specifies the map type xslt state for map type.
    case MapTypeXslt = "Xslt"
}


// MessageFilterType enumerates the values for message filter type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum MessageFilterTypeEnum: String, Codable
{
// MessageFilterTypeExclude specifies the message filter type exclude state for message filter type.
    case MessageFilterTypeExclude = "Exclude"
// MessageFilterTypeInclude specifies the message filter type include state for message filter type.
    case MessageFilterTypeInclude = "Include"
// MessageFilterTypeNotSpecified specifies the message filter type not specified state for message filter type.
    case MessageFilterTypeNotSpecified = "NotSpecified"
}


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

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

  public init()  {
  }

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

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

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


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

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

  public init()  {
  }

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

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

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


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

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

  public init()  {
  }

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

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

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


// ParameterType enumerates the values for parameter type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum ParameterTypeEnum: String, Codable
{
// ParameterTypeArray specifies the parameter type _ array state for parameter type.
    case ParameterTypeArray = "Array"
// ParameterTypeString specifies the parameter type _ string state for parameter type.
    case ParameterTypeString = "String"
// ParameterTypeBool specifies the parameter type bool state for parameter type.
    case ParameterTypeBool = "Bool"
// ParameterTypeFloat specifies the parameter type float state for parameter type.
    case ParameterTypeFloat = "Float"
// ParameterTypeInt specifies the parameter type int state for parameter type.
    case ParameterTypeInt = "Int"
// ParameterTypeNotSpecified specifies the parameter type not specified state for parameter type.
    case ParameterTypeNotSpecified = "NotSpecified"
// ParameterTypeObject specifies the parameter type object state for parameter type.
    case ParameterTypeObject = "Object"
// ParameterTypeSecureObject specifies the parameter type secure object state for parameter type.
    case ParameterTypeSecureObject = "SecureObject"
// ParameterTypeSecureString specifies the parameter type secure string state for parameter type.
    case ParameterTypeSecureString = "SecureString"
}


// 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 PartnerContentData : PartnerContentProtocol {
    public var b2b: B2BPartnerContentProtocol?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createPartnerContentProtocol() -> PartnerContentProtocol {
    return PartnerContentData()
  }
}


// PartnerType enumerates the values for partner type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum PartnerTypeEnum: String, Codable
{
// PartnerTypeB2B specifies the partner type b2b state for partner type.
    case PartnerTypeB2B = "B2B"
// PartnerTypeNotSpecified specifies the partner type not specified state for partner type.
    case PartnerTypeNotSpecified = "NotSpecified"
}


// RecurrenceFrequency enumerates the values for recurrence frequency.

// 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 RecurrenceFrequencyEnum: String, Codable
{
// RecurrenceFrequencyDay specifies the recurrence frequency day state for recurrence frequency.
    case RecurrenceFrequencyDay = "Day"
// RecurrenceFrequencyHour specifies the recurrence frequency hour state for recurrence frequency.
    case RecurrenceFrequencyHour = "Hour"
// RecurrenceFrequencyMinute specifies the recurrence frequency minute state for recurrence frequency.
    case RecurrenceFrequencyMinute = "Minute"
// RecurrenceFrequencyMonth specifies the recurrence frequency month state for recurrence frequency.
    case RecurrenceFrequencyMonth = "Month"
// RecurrenceFrequencyNotSpecified specifies the recurrence frequency not specified state for recurrence frequency.
    case RecurrenceFrequencyNotSpecified = "NotSpecified"
// RecurrenceFrequencySecond specifies the recurrence frequency second state for recurrence frequency.
    case RecurrenceFrequencySecond = "Second"
// RecurrenceFrequencyWeek specifies the recurrence frequency week state for recurrence frequency.
    case RecurrenceFrequencyWeek = "Week"
// RecurrenceFrequencyYear specifies the recurrence frequency year state for recurrence frequency.
    case RecurrenceFrequencyYear = "Year"
}


// 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 RecurrenceScheduleData : RecurrenceScheduleProtocol {
    public var minutes: [Int32]?
    public var hours: [Int32]?
    public var weekDays: [DaysOfWeekEnum?]?
    public var monthDays: [Int32]?
    public var monthlyOccurrences: [RecurrenceScheduleOccurrenceProtocol?]?

        enum CodingKeys: String, CodingKey {case minutes = "minutes"
        case hours = "hours"
        case weekDays = "weekDays"
        case monthDays = "monthDays"
        case monthlyOccurrences = "monthlyOccurrences"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createRecurrenceScheduleProtocol() -> RecurrenceScheduleProtocol {
    return RecurrenceScheduleData()
  }
}


// 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 RecurrenceScheduleOccurrenceData : RecurrenceScheduleOccurrenceProtocol {
    public var day: DayOfWeekEnum?
    public var occurrence: Int32?

        enum CodingKeys: String, CodingKey {case day = "day"
        case occurrence = "occurrence"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createRecurrenceScheduleOccurrenceProtocol() -> RecurrenceScheduleOccurrenceProtocol {
    return RecurrenceScheduleOccurrenceData()
  }
}


// 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 RegenerateActionParameterData : RegenerateActionParameterProtocol {
    public var keyType: KeyTypeEnum?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createRegenerateActionParameterProtocol() -> RegenerateActionParameterProtocol {
    return RegenerateActionParameterData()
  }
}


// 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 ResourceReferenceData : ResourceReferenceProtocol {
    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 createResourceReferenceProtocol() -> ResourceReferenceProtocol {
    return ResourceReferenceData()
  }
}


// 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 RetryHistoryData : RetryHistoryProtocol {
    public var startTime: Date?
    public var endTime: Date?
    public var code: String?
    public var clientRequestId: String?
    public var serviceRequestId: String?
    public var error: ErrorResponseProtocol?

        enum CodingKeys: String, CodingKey {case startTime = "startTime"
        case endTime = "endTime"
        case code = "code"
        case clientRequestId = "clientRequestId"
        case serviceRequestId = "serviceRequestId"
        case error = "error"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.startTime) {
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)
    }
    if container.contains(.endTime) {
        self.endTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .endTime)), format: .dateTime)
    }
    if container.contains(.code) {
        self.code = try container.decode(String?.self, forKey: .code)
    }
    if container.contains(.clientRequestId) {
        self.clientRequestId = try container.decode(String?.self, forKey: .clientRequestId)
    }
    if container.contains(.serviceRequestId) {
        self.serviceRequestId = try container.decode(String?.self, forKey: .serviceRequestId)
    }
    if container.contains(.error) {
        self.error = try container.decode(ErrorResponseData?.self, forKey: .error)
    }
    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.startTime != nil {
        try container.encode(DateConverter.toString(date: self.startTime!, format: .dateTime), forKey: .startTime)
    }
    if self.endTime != nil {
        try container.encode(DateConverter.toString(date: self.endTime!, format: .dateTime), forKey: .endTime)
    }
    if self.code != nil {try container.encode(self.code, forKey: .code)}
    if self.clientRequestId != nil {try container.encode(self.clientRequestId, forKey: .clientRequestId)}
    if self.serviceRequestId != nil {try container.encode(self.serviceRequestId, forKey: .serviceRequestId)}
    if self.error != nil {try container.encode(self.error as! ErrorResponseData?, forKey: .error)}
  }
}

extension DataFactory {
  public static func createRetryHistoryProtocol() -> RetryHistoryProtocol {
    return RetryHistoryData()
  }
}


// SchemaType enumerates the values for schema type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum SchemaTypeEnum: String, Codable
{
// SchemaTypeNotSpecified specifies the schema type not specified state for schema type.
    case SchemaTypeNotSpecified = "NotSpecified"
// SchemaTypeXml specifies the schema type xml state for schema type.
    case SchemaTypeXml = "Xml"
}


// SegmentTerminatorSuffix enumerates the values for segment terminator suffix.

// 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 SegmentTerminatorSuffixEnum: String, Codable
{
// SegmentTerminatorSuffixCR specifies the segment terminator suffix cr state for segment terminator suffix.
    case SegmentTerminatorSuffixCR = "CR"
// SegmentTerminatorSuffixCRLF specifies the segment terminator suffix crlf state for segment terminator suffix.
    case SegmentTerminatorSuffixCRLF = "CRLF"
// SegmentTerminatorSuffixLF specifies the segment terminator suffix lf state for segment terminator suffix.
    case SegmentTerminatorSuffixLF = "LF"
// SegmentTerminatorSuffixNone specifies the segment terminator suffix none state for segment terminator suffix.
    case SegmentTerminatorSuffixNone = "None"
// SegmentTerminatorSuffixNotSpecified specifies the segment terminator suffix not specified state for segment
// terminator suffix.
    case SegmentTerminatorSuffixNotSpecified = "NotSpecified"
}


// SigningAlgorithm enumerates the values for signing algorithm.

// 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 SigningAlgorithmEnum: String, Codable
{
// SigningAlgorithmDefault specifies the signing algorithm default state for signing algorithm.
    case SigningAlgorithmDefault = "Default"
// SigningAlgorithmNotSpecified specifies the signing algorithm not specified state for signing algorithm.
    case SigningAlgorithmNotSpecified = "NotSpecified"
// SigningAlgorithmSHA1 specifies the signing algorithm sha1 state for signing algorithm.
    case SigningAlgorithmSHA1 = "SHA1"
// SigningAlgorithmSHA2256 specifies the signing algorithm sha2256 state for signing algorithm.
    case SigningAlgorithmSHA2256 = "SHA2256"
// SigningAlgorithmSHA2384 specifies the signing algorithm sha2384 state for signing algorithm.
    case SigningAlgorithmSHA2384 = "SHA2384"
// SigningAlgorithmSHA2512 specifies the signing algorithm sha2512 state for signing algorithm.
    case SigningAlgorithmSHA2512 = "SHA2512"
}


// 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 SkuData : SkuProtocol {
    public var name: SkuNameEnum
    public var plan: ResourceReferenceProtocol?

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

  public init(name: SkuNameEnum)  {
    self.name = name
  }

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

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

extension DataFactory {
  public static func createSkuProtocol(name: SkuNameEnum) -> SkuProtocol {
    return SkuData(name: name)
  }
}


// SkuName enumerates the values for sku name.

// 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 SkuNameEnum: String, Codable
{
// SkuNameBasic specifies the sku name basic state for sku name.
    case SkuNameBasic = "Basic"
// SkuNameFree specifies the sku name free state for sku name.
    case SkuNameFree = "Free"
// SkuNameNotSpecified specifies the sku name not specified state for sku name.
    case SkuNameNotSpecified = "NotSpecified"
// SkuNamePremium specifies the sku name premium state for sku name.
    case SkuNamePremium = "Premium"
// SkuNameShared specifies the sku name shared state for sku name.
    case SkuNameShared = "Shared"
// SkuNameStandard specifies the sku name standard state for sku name.
    case SkuNameStandard = "Standard"
}


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

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

  public init()  {
  }

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

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

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


// TrailingSeparatorPolicy enumerates the values for trailing separator policy.

// 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 TrailingSeparatorPolicyEnum: String, Codable
{
// TrailingSeparatorPolicyMandatory specifies the trailing separator policy mandatory state for trailing separator
// policy.
    case TrailingSeparatorPolicyMandatory = "Mandatory"
// TrailingSeparatorPolicyNotAllowed specifies the trailing separator policy not allowed state for trailing separator
// policy.
    case TrailingSeparatorPolicyNotAllowed = "NotAllowed"
// TrailingSeparatorPolicyNotSpecified specifies the trailing separator policy not specified state for trailing
// separator policy.
    case TrailingSeparatorPolicyNotSpecified = "NotSpecified"
// TrailingSeparatorPolicyOptional specifies the trailing separator policy optional state for trailing separator
// policy.
    case TrailingSeparatorPolicyOptional = "Optional"
}


// UsageIndicator enumerates the values for usage indicator.

// 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 UsageIndicatorEnum: String, Codable
{
// UsageIndicatorInformation specifies the usage indicator information state for usage indicator.
    case UsageIndicatorInformation = "Information"
// UsageIndicatorNotSpecified specifies the usage indicator not specified state for usage indicator.
    case UsageIndicatorNotSpecified = "NotSpecified"
// UsageIndicatorProduction specifies the usage indicator production state for usage indicator.
    case UsageIndicatorProduction = "Production"
// UsageIndicatorTest specifies the usage indicator test state for usage indicator.
    case UsageIndicatorTest = "Test"
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createWorkflowProtocol() -> WorkflowProtocol {
    return WorkflowData()
  }
}


// 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 WorkflowFilterData : WorkflowFilterProtocol {
    public var state: WorkflowStateEnum?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createWorkflowFilterProtocol() -> WorkflowFilterProtocol {
    return WorkflowFilterData()
  }
}


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

extension DataFactory {
  public static func createWorkflowListResultProtocol() -> WorkflowListResultProtocol {
    return WorkflowListResultData()
  }
}


// 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 WorkflowOutputParameterData : WorkflowOutputParameterProtocol, WorkflowParameterProtocol {
    public var type: ParameterTypeEnum?
    public var value: [String: String?]?
    public var metadata: [String: String?]?
    public var description: String?
    public var error: [String: String?]?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createWorkflowOutputParameterProtocol() -> WorkflowOutputParameterProtocol {
    return WorkflowOutputParameterData()
  }
}


// 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 WorkflowParameterData : WorkflowParameterProtocol {
    public var type: ParameterTypeEnum?
    public var value: [String: String?]?
    public var metadata: [String: String?]?
    public var description: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createWorkflowParameterProtocol() -> WorkflowParameterProtocol {
    return WorkflowParameterData()
  }
}