// 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 ActivityLogAlertResourceData : ActivityLogAlertResourceProtocol, 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: ActivityLogAlertProtocol?

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

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

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

extension DataFactory {
  public static func createActivityLogAlertResourceProtocol(location: String) -> ActivityLogAlertResourceProtocol {
    return ActivityLogAlertResourceData(location: location)
  }
}


// AggregationType enumerates the values for aggregation 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 AggregationTypeEnum: String, Codable
{
// Average specifies the average state for aggregation type.
    case Average = "Average"
// Count specifies the count state for aggregation type.
    case Count = "Count"
// Maximum specifies the maximum state for aggregation type.
    case Maximum = "Maximum"
// Minimum specifies the minimum state for aggregation type.
    case Minimum = "Minimum"
// None specifies the none state for aggregation type.
    case None = "None"
// Total specifies the total state for aggregation type.
    case Total = "Total"
}


// 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 AlertRuleData : AlertRuleProtocol {
    public var name: String
    public var description: String?
    public var isEnabled: Bool
    public var condition: RuleConditionProtocol
    public var actions: [RuleActionProtocol?]?
    public var lastUpdatedTime: Date?

        enum CodingKeys: String, CodingKey {case name = "name"
        case description = "description"
        case isEnabled = "isEnabled"
        case condition = "condition"
        case actions = "actions"
        case lastUpdatedTime = "lastUpdatedTime"
        }

  public init(name: String, isEnabled: Bool, condition: RuleConditionProtocol)  {
    self.name = name
    self.isEnabled = isEnabled
    self.condition = condition
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.name = try container.decode(String.self, forKey: .name)
    if container.contains(.description) {
        self.description = try container.decode(String?.self, forKey: .description)
    }
    self.isEnabled = try container.decode(Bool.self, forKey: .isEnabled)
    self.condition = try container.decode(RuleConditionData.self, forKey: .condition)
    if container.contains(.actions) {
        self.actions = try container.decode([RuleActionData?]?.self, forKey: .actions)
    }
    if container.contains(.lastUpdatedTime) {
        self.lastUpdatedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastUpdatedTime)), 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(self.name, forKey: .name)
    if self.description != nil {try container.encode(self.description, forKey: .description)}
    try container.encode(self.isEnabled, forKey: .isEnabled)
    try container.encode(self.condition as! RuleConditionData, forKey: .condition)
    if self.actions != nil {try container.encode(self.actions as! [RuleActionData?]?, forKey: .actions)}
    if self.lastUpdatedTime != nil {
        try container.encode(DateConverter.toString(date: self.lastUpdatedTime!, format: .dateTime), forKey: .lastUpdatedTime)
    }
  }
}

extension DataFactory {
  public static func createAlertRuleProtocol(name: String, isEnabled: Bool, condition: RuleConditionProtocol) -> AlertRuleProtocol {
    return AlertRuleData(name: name, isEnabled: isEnabled, condition: condition)
  }
}


// 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 AlertRuleResourceCollectionData : AlertRuleResourceCollectionProtocol {
    public var value: [AlertRuleResourceProtocol?]?

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

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

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

extension DataFactory {
  public static func createAlertRuleResourceCollectionProtocol() -> AlertRuleResourceCollectionProtocol {
    return AlertRuleResourceCollectionData()
  }
}


// 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 AlertRuleResourceData : AlertRuleResourceProtocol, 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: AlertRuleProtocol

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

  public init(location: String, properties: AlertRuleProtocol)  {
    self.location = location
    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)
    }
    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(AlertRuleData.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)}
    try container.encode(self.location, forKey: .location)
    if self.tags != nil {try container.encode(self.tags, forKey: .tags)}
    try container.encode(self.properties as! AlertRuleData, forKey: .properties)
  }
}

extension DataFactory {
  public static func createAlertRuleResourceProtocol(location: String, properties: AlertRuleProtocol) -> AlertRuleResourceProtocol {
    return AlertRuleResourceData(location: location, 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 AlertRuleResourcePatchData : AlertRuleResourcePatchProtocol {
    public var tags: [String:String]?
    public var properties: AlertRuleProtocol?

        enum CodingKeys: String, CodingKey {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(.tags) {
        self.tags = try container.decode([String:String]?.self, forKey: .tags)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(AlertRuleData?.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.tags != nil {try container.encode(self.tags, forKey: .tags)}
    if self.properties != nil {try container.encode(self.properties as! AlertRuleData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createAlertRuleResourcePatchProtocol() -> AlertRuleResourcePatchProtocol {
    return AlertRuleResourcePatchData()
  }
}


// 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 AutomationRunbookReceiverData : AutomationRunbookReceiverProtocol {
    public var automationAccountId: String
    public var runbookName: String
    public var webhookResourceId: String
    public var isGlobalRunbook: Bool
    public var name: String?
    public var serviceUri: String?

        enum CodingKeys: String, CodingKey {case automationAccountId = "automationAccountId"
        case runbookName = "runbookName"
        case webhookResourceId = "webhookResourceId"
        case isGlobalRunbook = "isGlobalRunbook"
        case name = "name"
        case serviceUri = "serviceUri"
        }

  public init(automationAccountId: String, runbookName: String, webhookResourceId: String, isGlobalRunbook: Bool)  {
    self.automationAccountId = automationAccountId
    self.runbookName = runbookName
    self.webhookResourceId = webhookResourceId
    self.isGlobalRunbook = isGlobalRunbook
  }

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

extension DataFactory {
  public static func createAutomationRunbookReceiverProtocol(automationAccountId: String, runbookName: String, webhookResourceId: String, isGlobalRunbook: Bool) -> AutomationRunbookReceiverProtocol {
    return AutomationRunbookReceiverData(automationAccountId: automationAccountId, runbookName: runbookName, webhookResourceId: webhookResourceId, isGlobalRunbook: isGlobalRunbook)
  }
}


// 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 AutoscaleNotificationData : AutoscaleNotificationProtocol {
    public var operation: String
    public var email: EmailNotificationProtocol?
    public var webhooks: [WebhookNotificationProtocol?]?

        enum CodingKeys: String, CodingKey {case operation = "operation"
        case email = "email"
        case webhooks = "webhooks"
        }

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

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

extension DataFactory {
  public static func createAutoscaleNotificationProtocol(operation: String) -> AutoscaleNotificationProtocol {
    return AutoscaleNotificationData(operation: operation)
  }
}


// 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 AutoscaleProfileData : AutoscaleProfileProtocol {
    public var name: String
    public var capacity: ScaleCapacityProtocol
    public var rules: [ScaleRuleProtocol]
    public var fixedDate: TimeWindowProtocol?
    public var recurrence: RecurrenceProtocol?

        enum CodingKeys: String, CodingKey {case name = "name"
        case capacity = "capacity"
        case rules = "rules"
        case fixedDate = "fixedDate"
        case recurrence = "recurrence"
        }

  public init(name: String, capacity: ScaleCapacityProtocol, rules: [ScaleRuleProtocol])  {
    self.name = name
    self.capacity = capacity
    self.rules = rules
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.name = try container.decode(String.self, forKey: .name)
    self.capacity = try container.decode(ScaleCapacityData.self, forKey: .capacity)
    self.rules = try container.decode([ScaleRuleData].self, forKey: .rules)
    if container.contains(.fixedDate) {
        self.fixedDate = try container.decode(TimeWindowData?.self, forKey: .fixedDate)
    }
    if container.contains(.recurrence) {
        self.recurrence = try container.decode(RecurrenceData?.self, forKey: .recurrence)
    }
    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)
    try container.encode(self.capacity as! ScaleCapacityData, forKey: .capacity)
    try container.encode(self.rules as! [ScaleRuleData], forKey: .rules)
    if self.fixedDate != nil {try container.encode(self.fixedDate as! TimeWindowData?, forKey: .fixedDate)}
    if self.recurrence != nil {try container.encode(self.recurrence as! RecurrenceData?, forKey: .recurrence)}
  }
}

extension DataFactory {
  public static func createAutoscaleProfileProtocol(name: String, capacity: ScaleCapacityProtocol, rules: [ScaleRuleProtocol]) -> AutoscaleProfileProtocol {
    return AutoscaleProfileData(name: name, capacity: capacity, rules: rules)
  }
}


// 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 AutoscaleSettingData : AutoscaleSettingProtocol {
    public var profiles: [AutoscaleProfileProtocol]
    public var notifications: [AutoscaleNotificationProtocol?]?
    public var enabled: Bool?
    public var name: String?
    public var targetResourceUri: String?

        enum CodingKeys: String, CodingKey {case profiles = "profiles"
        case notifications = "notifications"
        case enabled = "enabled"
        case name = "name"
        case targetResourceUri = "targetResourceUri"
        }

  public init(profiles: [AutoscaleProfileProtocol])  {
    self.profiles = profiles
  }

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

extension DataFactory {
  public static func createAutoscaleSettingProtocol(profiles: [AutoscaleProfileProtocol]) -> AutoscaleSettingProtocol {
    return AutoscaleSettingData(profiles: profiles)
  }
}


// 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 AutoscaleSettingResourceCollectionData : AutoscaleSettingResourceCollectionProtocol {
    public var value: [AutoscaleSettingResourceProtocol]
    public var _nextLink: String?

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

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

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

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

extension DataFactory {
  public static func createAutoscaleSettingResourceCollectionProtocol(value: [AutoscaleSettingResourceProtocol]) -> AutoscaleSettingResourceCollectionProtocol {
    return AutoscaleSettingResourceCollectionData(value: value)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct AutoscaleSettingResourceData : AutoscaleSettingResourceProtocol, 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: AutoscaleSettingProtocol

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

  public init(location: String, properties: AutoscaleSettingProtocol)  {
    self.location = location
    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)
    }
    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(AutoscaleSettingData.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)}
    try container.encode(self.location, forKey: .location)
    if self.tags != nil {try container.encode(self.tags, forKey: .tags)}
    try container.encode(self.properties as! AutoscaleSettingData, forKey: .properties)
  }
}

extension DataFactory {
  public static func createAutoscaleSettingResourceProtocol(location: String, properties: AutoscaleSettingProtocol) -> AutoscaleSettingResourceProtocol {
    return AutoscaleSettingResourceData(location: location, 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 AutoscaleSettingResourcePatchData : AutoscaleSettingResourcePatchProtocol {
    public var tags: [String:String]?
    public var properties: AutoscaleSettingProtocol?

        enum CodingKeys: String, CodingKey {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(.tags) {
        self.tags = try container.decode([String:String]?.self, forKey: .tags)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(AutoscaleSettingData?.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.tags != nil {try container.encode(self.tags, forKey: .tags)}
    if self.properties != nil {try container.encode(self.properties as! AutoscaleSettingData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createAutoscaleSettingResourcePatchProtocol() -> AutoscaleSettingResourcePatchProtocol {
    return AutoscaleSettingResourcePatchData()
  }
}


// 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 AzureAppPushReceiverData : AzureAppPushReceiverProtocol {
    public var name: String
    public var emailAddress: String

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

  public init(name: String, emailAddress: String)  {
    self.name = name
    self.emailAddress = emailAddress
  }

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

extension DataFactory {
  public static func createAzureAppPushReceiverProtocol(name: String, emailAddress: String) -> AzureAppPushReceiverProtocol {
    return AzureAppPushReceiverData(name: name, emailAddress: emailAddress)
  }
}


// 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 BaselineData : BaselineProtocol {
    public var sensitivity: SensitivityEnum
    public var lowThresholds: [Double]
    public var highThresholds: [Double]

        enum CodingKeys: String, CodingKey {case sensitivity = "sensitivity"
        case lowThresholds = "lowThresholds"
        case highThresholds = "highThresholds"
        }

  public init(sensitivity: SensitivityEnum, lowThresholds: [Double], highThresholds: [Double])  {
    self.sensitivity = sensitivity
    self.lowThresholds = lowThresholds
    self.highThresholds = highThresholds
  }

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

extension DataFactory {
  public static func createBaselineProtocol(sensitivity: SensitivityEnum, lowThresholds: [Double], highThresholds: [Double]) -> BaselineProtocol {
    return BaselineData(sensitivity: sensitivity, lowThresholds: lowThresholds, highThresholds: highThresholds)
  }
}


// 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 BaselineMetadataValueData : BaselineMetadataValueProtocol {
    public var name: LocalizableStringProtocol?
    public var value: String?

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

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

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

extension DataFactory {
  public static func createBaselineMetadataValueProtocol() -> BaselineMetadataValueProtocol {
    return BaselineMetadataValueData()
  }
}


// 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 BaselinePropertiesData : BaselinePropertiesProtocol {
    public var timespan: String?
    public var interval: String?
    public var aggregation: String?
    public var timestamps: [Date]?
    public var baseline: [BaselineProtocol?]?
    public var metadata: [BaselineMetadataValueProtocol?]?

        enum CodingKeys: String, CodingKey {case timespan = "timespan"
        case interval = "interval"
        case aggregation = "aggregation"
        case timestamps = "timestamps"
        case baseline = "baseline"
        case metadata = "metadata"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.timespan) {
        self.timespan = try container.decode(String?.self, forKey: .timespan)
    }
    if container.contains(.interval) {
        self.interval = try container.decode(String?.self, forKey: .interval)
    }
    if container.contains(.aggregation) {
        self.aggregation = try container.decode(String?.self, forKey: .aggregation)
    }
    if container.contains(.timestamps) {
        self.timestamps = try container.decode([Date]?.self, forKey: .timestamps)
    }
    if container.contains(.baseline) {
        self.baseline = try container.decode([BaselineData?]?.self, forKey: .baseline)
    }
    if container.contains(.metadata) {
        self.metadata = try container.decode([BaselineMetadataValueData?]?.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)
    if self.timespan != nil {try container.encode(self.timespan, forKey: .timespan)}
    if self.interval != nil {try container.encode(self.interval, forKey: .interval)}
    if self.aggregation != nil {try container.encode(self.aggregation, forKey: .aggregation)}
    if self.timestamps != nil {try container.encode(self.timestamps as! [Date]?, forKey: .timestamps)}
    if self.baseline != nil {try container.encode(self.baseline as! [BaselineData?]?, forKey: .baseline)}
    if self.metadata != nil {try container.encode(self.metadata as! [BaselineMetadataValueData?]?, forKey: .metadata)}
  }
}

extension DataFactory {
  public static func createBaselinePropertiesProtocol() -> BaselinePropertiesProtocol {
    return BaselinePropertiesData()
  }
}


// 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 BaselineResponseData : BaselineResponseProtocol {
    public var id: String?
    public var type: String?
    public var name: LocalizableStringProtocol?
    public var properties: BaselinePropertiesProtocol?

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

extension DataFactory {
  public static func createBaselineResponseProtocol() -> BaselineResponseProtocol {
    return BaselineResponseData()
  }
}


// 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 CalculateBaselineResponseData : CalculateBaselineResponseProtocol {
    public var type: String
    public var timestamps: [Date]?
    public var baseline: [BaselineProtocol]

        enum CodingKeys: String, CodingKey {case type = "type"
        case timestamps = "timestamps"
        case baseline = "baseline"
        }

  public init(type: String, baseline: [BaselineProtocol])  {
    self.type = type
    self.baseline = baseline
  }

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

extension DataFactory {
  public static func createCalculateBaselineResponseProtocol(type: String, baseline: [BaselineProtocol]) -> CalculateBaselineResponseProtocol {
    return CalculateBaselineResponseData(type: type, baseline: baseline)
  }
}


// CategoryType enumerates the values for category 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 CategoryTypeEnum: String, Codable
{
// Logs specifies the logs state for category type.
    case Logs = "Logs"
// Metrics specifies the metrics state for category type.
    case Metrics = "Metrics"
}


// ComparisonOperationType enumerates the values for comparison operation type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum ComparisonOperationTypeEnum: String, Codable
{
// Equals specifies the equals state for comparison operation type.
    case Equals = "Equals"
// GreaterThan specifies the greater than state for comparison operation type.
    case GreaterThan = "GreaterThan"
// GreaterThanOrEqual specifies the greater than or equal state for comparison operation type.
    case GreaterThanOrEqual = "GreaterThanOrEqual"
// LessThan specifies the less than state for comparison operation type.
    case LessThan = "LessThan"
// LessThanOrEqual specifies the less than or equal state for comparison operation type.
    case LessThanOrEqual = "LessThanOrEqual"
// NotEquals specifies the not equals state for comparison operation type.
    case NotEquals = "NotEquals"
}


// ConditionOperator enumerates the values for condition operator.

// 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 ConditionOperatorEnum: String, Codable
{
// ConditionOperatorGreaterThan specifies the condition operator greater than state for condition operator.
    case ConditionOperatorGreaterThan = "GreaterThan"
// ConditionOperatorGreaterThanOrEqual specifies the condition operator greater than or equal state for condition
// operator.
    case ConditionOperatorGreaterThanOrEqual = "GreaterThanOrEqual"
// ConditionOperatorLessThan specifies the condition operator less than state for condition operator.
    case ConditionOperatorLessThan = "LessThan"
// ConditionOperatorLessThanOrEqual specifies the condition operator less than or equal state for condition operator.
    case ConditionOperatorLessThanOrEqual = "LessThanOrEqual"
}


// 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 DiagnosticSettingsCategoryData : DiagnosticSettingsCategoryProtocol {
    public var categoryType: CategoryTypeEnum?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createDiagnosticSettingsCategoryProtocol() -> DiagnosticSettingsCategoryProtocol {
    return DiagnosticSettingsCategoryData()
  }
}


// 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 DiagnosticSettingsCategoryResourceCollectionData : DiagnosticSettingsCategoryResourceCollectionProtocol {
    public var value: [DiagnosticSettingsCategoryResourceProtocol?]?

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

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

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

extension DataFactory {
  public static func createDiagnosticSettingsCategoryResourceCollectionProtocol() -> DiagnosticSettingsCategoryResourceCollectionProtocol {
    return DiagnosticSettingsCategoryResourceCollectionData()
  }
}


// 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 DiagnosticSettingsCategoryResourceData : DiagnosticSettingsCategoryResourceProtocol, ProxyOnlyResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: DiagnosticSettingsCategoryProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createDiagnosticSettingsCategoryResourceProtocol() -> DiagnosticSettingsCategoryResourceProtocol {
    return DiagnosticSettingsCategoryResourceData()
  }
}


// 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 DiagnosticSettingsData : DiagnosticSettingsProtocol {
    public var storageAccountId: String?
    public var eventHubAuthorizationRuleId: String?
    public var eventHubName: String?
    public var metrics: [MetricSettingsProtocol?]?
    public var logs: [LogSettingsProtocol?]?
    public var workspaceId: String?

        enum CodingKeys: String, CodingKey {case storageAccountId = "storageAccountId"
        case eventHubAuthorizationRuleId = "eventHubAuthorizationRuleId"
        case eventHubName = "eventHubName"
        case metrics = "metrics"
        case logs = "logs"
        case workspaceId = "workspaceId"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createDiagnosticSettingsProtocol() -> DiagnosticSettingsProtocol {
    return DiagnosticSettingsData()
  }
}


// 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 DiagnosticSettingsResourceCollectionData : DiagnosticSettingsResourceCollectionProtocol {
    public var value: [DiagnosticSettingsResourceProtocol?]?

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

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

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

extension DataFactory {
  public static func createDiagnosticSettingsResourceCollectionProtocol() -> DiagnosticSettingsResourceCollectionProtocol {
    return DiagnosticSettingsResourceCollectionData()
  }
}


// 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 DiagnosticSettingsResourceData : DiagnosticSettingsResourceProtocol, ProxyOnlyResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: DiagnosticSettingsProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createDiagnosticSettingsResourceProtocol() -> DiagnosticSettingsResourceProtocol {
    return DiagnosticSettingsResourceData()
  }
}


// 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 EmailNotificationData : EmailNotificationProtocol {
    public var sendToSubscriptionAdministrator: Bool?
    public var sendToSubscriptionCoAdministrators: Bool?
    public var customEmails: [String]?

        enum CodingKeys: String, CodingKey {case sendToSubscriptionAdministrator = "sendToSubscriptionAdministrator"
        case sendToSubscriptionCoAdministrators = "sendToSubscriptionCoAdministrators"
        case customEmails = "customEmails"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createEmailNotificationProtocol() -> EmailNotificationProtocol {
    return EmailNotificationData()
  }
}


// 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 EmailReceiverData : EmailReceiverProtocol {
    public var name: String
    public var emailAddress: String
    public var status: ReceiverStatusEnum?

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

  public init(name: String, emailAddress: String)  {
    self.name = name
    self.emailAddress = emailAddress
  }

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

extension DataFactory {
  public static func createEmailReceiverProtocol(name: String, emailAddress: String) -> EmailReceiverProtocol {
    return EmailReceiverData(name: name, emailAddress: emailAddress)
  }
}


// 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 EnableRequestData : EnableRequestProtocol {
    public var receiverName: String

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

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

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

extension DataFactory {
  public static func createEnableRequestProtocol(receiverName: String) -> EnableRequestProtocol {
    return EnableRequestData(receiverName: receiverName)
  }
}


// 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 ErrorResponseData : ErrorResponseProtocol {
    public var code: String?
    public var message: String?

        enum CodingKeys: String, CodingKey {case code = "code"
        case message = "message"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createErrorResponseProtocol() -> ErrorResponseProtocol {
    return ErrorResponseData()
  }
}


// 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 EventCategoryCollectionData : EventCategoryCollectionProtocol {
    public var value: [LocalizableStringProtocol]

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

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

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

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

extension DataFactory {
  public static func createEventCategoryCollectionProtocol(value: [LocalizableStringProtocol]) -> EventCategoryCollectionProtocol {
    return EventCategoryCollectionData(value: value)
  }
}


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

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

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

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

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

extension DataFactory {
  public static func createEventDataCollectionProtocol(value: [EventDataProtocol]) -> EventDataCollectionProtocol {
    return EventDataCollectionData(value: value)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct EventDataData : EventDataProtocol {
    public var authorization: SenderAuthorizationProtocol?
    public var claims: [String:String]?
    public var caller: String?
    public var description: String?
    public var id: String?
    public var eventDataId: String?
    public var correlationId: String?
    public var eventName: LocalizableStringProtocol?
    public var category: LocalizableStringProtocol?
    public var httpRequest: HttpRequestInfoProtocol?
    public var level: EventLevelEnum?
    public var resourceGroupName: String?
    public var resourceProviderName: LocalizableStringProtocol?
    public var resourceId: String?
    public var resourceType: LocalizableStringProtocol?
    public var operationId: String?
    public var operationName: LocalizableStringProtocol?
    public var properties: [String:String]?
    public var status: LocalizableStringProtocol?
    public var subStatus: LocalizableStringProtocol?
    public var eventTimestamp: Date?
    public var submissionTimestamp: Date?
    public var subscriptionId: String?
    public var tenantId: String?

        enum CodingKeys: String, CodingKey {case authorization = "authorization"
        case claims = "claims"
        case caller = "caller"
        case description = "description"
        case id = "id"
        case eventDataId = "eventDataId"
        case correlationId = "correlationId"
        case eventName = "eventName"
        case category = "category"
        case httpRequest = "httpRequest"
        case level = "level"
        case resourceGroupName = "resourceGroupName"
        case resourceProviderName = "resourceProviderName"
        case resourceId = "resourceId"
        case resourceType = "resourceType"
        case operationId = "operationId"
        case operationName = "operationName"
        case properties = "properties"
        case status = "status"
        case subStatus = "subStatus"
        case eventTimestamp = "eventTimestamp"
        case submissionTimestamp = "submissionTimestamp"
        case subscriptionId = "subscriptionId"
        case tenantId = "tenantId"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.authorization) {
        self.authorization = try container.decode(SenderAuthorizationData?.self, forKey: .authorization)
    }
    if container.contains(.claims) {
        self.claims = try container.decode([String:String]?.self, forKey: .claims)
    }
    if container.contains(.caller) {
        self.caller = try container.decode(String?.self, forKey: .caller)
    }
    if container.contains(.description) {
        self.description = try container.decode(String?.self, forKey: .description)
    }
    if container.contains(.id) {
        self.id = try container.decode(String?.self, forKey: .id)
    }
    if container.contains(.eventDataId) {
        self.eventDataId = try container.decode(String?.self, forKey: .eventDataId)
    }
    if container.contains(.correlationId) {
        self.correlationId = try container.decode(String?.self, forKey: .correlationId)
    }
    if container.contains(.eventName) {
        self.eventName = try container.decode(LocalizableStringData?.self, forKey: .eventName)
    }
    if container.contains(.category) {
        self.category = try container.decode(LocalizableStringData?.self, forKey: .category)
    }
    if container.contains(.httpRequest) {
        self.httpRequest = try container.decode(HttpRequestInfoData?.self, forKey: .httpRequest)
    }
    if container.contains(.level) {
        self.level = try container.decode(EventLevelEnum?.self, forKey: .level)
    }
    if container.contains(.resourceGroupName) {
        self.resourceGroupName = try container.decode(String?.self, forKey: .resourceGroupName)
    }
    if container.contains(.resourceProviderName) {
        self.resourceProviderName = try container.decode(LocalizableStringData?.self, forKey: .resourceProviderName)
    }
    if container.contains(.resourceId) {
        self.resourceId = try container.decode(String?.self, forKey: .resourceId)
    }
    if container.contains(.resourceType) {
        self.resourceType = try container.decode(LocalizableStringData?.self, forKey: .resourceType)
    }
    if container.contains(.operationId) {
        self.operationId = try container.decode(String?.self, forKey: .operationId)
    }
    if container.contains(.operationName) {
        self.operationName = try container.decode(LocalizableStringData?.self, forKey: .operationName)
    }
    if container.contains(.properties) {
        self.properties = try container.decode([String:String]?.self, forKey: .properties)
    }
    if container.contains(.status) {
        self.status = try container.decode(LocalizableStringData?.self, forKey: .status)
    }
    if container.contains(.subStatus) {
        self.subStatus = try container.decode(LocalizableStringData?.self, forKey: .subStatus)
    }
    if container.contains(.eventTimestamp) {
        self.eventTimestamp = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .eventTimestamp)), format: .dateTime)
    }
    if container.contains(.submissionTimestamp) {
        self.submissionTimestamp = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .submissionTimestamp)), format: .dateTime)
    }
    if container.contains(.subscriptionId) {
        self.subscriptionId = try container.decode(String?.self, forKey: .subscriptionId)
    }
    if container.contains(.tenantId) {
        self.tenantId = try container.decode(String?.self, forKey: .tenantId)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.authorization != nil {try container.encode(self.authorization as! SenderAuthorizationData?, forKey: .authorization)}
    if self.claims != nil {try container.encode(self.claims, forKey: .claims)}
    if self.caller != nil {try container.encode(self.caller, forKey: .caller)}
    if self.description != nil {try container.encode(self.description, forKey: .description)}
    if self.id != nil {try container.encode(self.id, forKey: .id)}
    if self.eventDataId != nil {try container.encode(self.eventDataId, forKey: .eventDataId)}
    if self.correlationId != nil {try container.encode(self.correlationId, forKey: .correlationId)}
    if self.eventName != nil {try container.encode(self.eventName as! LocalizableStringData?, forKey: .eventName)}
    if self.category != nil {try container.encode(self.category as! LocalizableStringData?, forKey: .category)}
    if self.httpRequest != nil {try container.encode(self.httpRequest as! HttpRequestInfoData?, forKey: .httpRequest)}
    if self.level != nil {try container.encode(self.level, forKey: .level)}
    if self.resourceGroupName != nil {try container.encode(self.resourceGroupName, forKey: .resourceGroupName)}
    if self.resourceProviderName != nil {try container.encode(self.resourceProviderName as! LocalizableStringData?, forKey: .resourceProviderName)}
    if self.resourceId != nil {try container.encode(self.resourceId, forKey: .resourceId)}
    if self.resourceType != nil {try container.encode(self.resourceType as! LocalizableStringData?, forKey: .resourceType)}
    if self.operationId != nil {try container.encode(self.operationId, forKey: .operationId)}
    if self.operationName != nil {try container.encode(self.operationName as! LocalizableStringData?, forKey: .operationName)}
    if self.properties != nil {try container.encode(self.properties, forKey: .properties)}
    if self.status != nil {try container.encode(self.status as! LocalizableStringData?, forKey: .status)}
    if self.subStatus != nil {try container.encode(self.subStatus as! LocalizableStringData?, forKey: .subStatus)}
    if self.eventTimestamp != nil {
        try container.encode(DateConverter.toString(date: self.eventTimestamp!, format: .dateTime), forKey: .eventTimestamp)
    }
    if self.submissionTimestamp != nil {
        try container.encode(DateConverter.toString(date: self.submissionTimestamp!, format: .dateTime), forKey: .submissionTimestamp)
    }
    if self.subscriptionId != nil {try container.encode(self.subscriptionId, forKey: .subscriptionId)}
    if self.tenantId != nil {try container.encode(self.tenantId, forKey: .tenantId)}
  }
}

extension DataFactory {
  public static func createEventDataProtocol() -> EventDataProtocol {
    return EventDataData()
  }
}


// EventLevel enumerates the values for event level.

// 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 EventLevelEnum: String, Codable
{
// Critical specifies the critical state for event level.
    case Critical = "Critical"
// Error specifies the error state for event level.
    case Error = "Error"
// Informational specifies the informational state for event level.
    case Informational = "Informational"
// Verbose specifies the verbose state for event level.
    case Verbose = "Verbose"
// Warning specifies the warning state for event level.
    case Warning = "Warning"
}


// 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 HttpRequestInfoData : HttpRequestInfoProtocol {
    public var clientRequestId: String?
    public var clientIpAddress: String?
    public var method: String?
    public var uri: String?

        enum CodingKeys: String, CodingKey {case clientRequestId = "clientRequestId"
        case clientIpAddress = "clientIpAddress"
        case method = "method"
        case uri = "uri"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createHttpRequestInfoProtocol() -> HttpRequestInfoProtocol {
    return HttpRequestInfoData()
  }
}


// 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 IncidentData : IncidentProtocol {
    public var name: String?
    public var ruleName: String?
    public var isActive: Bool?
    public var activatedTime: Date?
    public var resolvedTime: Date?

        enum CodingKeys: String, CodingKey {case name = "name"
        case ruleName = "ruleName"
        case isActive = "isActive"
        case activatedTime = "activatedTime"
        case resolvedTime = "resolvedTime"
        }

  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(.ruleName) {
        self.ruleName = try container.decode(String?.self, forKey: .ruleName)
    }
    if container.contains(.isActive) {
        self.isActive = try container.decode(Bool?.self, forKey: .isActive)
    }
    if container.contains(.activatedTime) {
        self.activatedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .activatedTime)), format: .dateTime)
    }
    if container.contains(.resolvedTime) {
        self.resolvedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .resolvedTime)), format: .dateTime)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.ruleName != nil {try container.encode(self.ruleName, forKey: .ruleName)}
    if self.isActive != nil {try container.encode(self.isActive, forKey: .isActive)}
    if self.activatedTime != nil {
        try container.encode(DateConverter.toString(date: self.activatedTime!, format: .dateTime), forKey: .activatedTime)
    }
    if self.resolvedTime != nil {
        try container.encode(DateConverter.toString(date: self.resolvedTime!, format: .dateTime), forKey: .resolvedTime)
    }
  }
}

extension DataFactory {
  public static func createIncidentProtocol() -> IncidentProtocol {
    return IncidentData()
  }
}


// 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 IncidentListResultData : IncidentListResultProtocol {
    public var value: [IncidentProtocol?]?

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

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

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

extension DataFactory {
  public static func createIncidentListResultProtocol() -> IncidentListResultProtocol {
    return IncidentListResultData()
  }
}


// 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 ItsmReceiverData : ItsmReceiverProtocol {
    public var name: String
    public var workspaceId: String
    public var connectionId: String
    public var ticketConfiguration: String
    public var region: String

        enum CodingKeys: String, CodingKey {case name = "name"
        case workspaceId = "workspaceId"
        case connectionId = "connectionId"
        case ticketConfiguration = "ticketConfiguration"
        case region = "region"
        }

  public init(name: String, workspaceId: String, connectionId: String, ticketConfiguration: String, region: String)  {
    self.name = name
    self.workspaceId = workspaceId
    self.connectionId = connectionId
    self.ticketConfiguration = ticketConfiguration
    self.region = region
  }

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

extension DataFactory {
  public static func createItsmReceiverProtocol(name: String, workspaceId: String, connectionId: String, ticketConfiguration: String, region: String) -> ItsmReceiverProtocol {
    return ItsmReceiverData(name: name, workspaceId: workspaceId, connectionId: connectionId, ticketConfiguration: ticketConfiguration, region: region)
  }
}


// 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 LocalizableStringData : LocalizableStringProtocol {
    public var value: String
    public var localizedValue: String?

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

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

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

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

extension DataFactory {
  public static func createLocalizableStringProtocol(value: String) -> LocalizableStringProtocol {
    return LocalizableStringData(value: value)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct LocationThresholdRuleConditionData : LocationThresholdRuleConditionProtocol, RuleConditionProtocol {
    public var dataSource: RuleDataSourceProtocol?
    public var windowSize: String?
    public var failedLocationCount: Int32

        enum CodingKeys: String, CodingKey {case dataSource = "dataSource"
        case windowSize = "windowSize"
        case failedLocationCount = "failedLocationCount"
        }

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

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.dataSource != nil {try container.encode(self.dataSource as! RuleDataSourceData?, forKey: .dataSource)}
    if self.windowSize != nil {try container.encode(self.windowSize, forKey: .windowSize)}
    try container.encode(self.failedLocationCount, forKey: .failedLocationCount)
  }
}

extension DataFactory {
  public static func createLocationThresholdRuleConditionProtocol(failedLocationCount: Int32) -> LocationThresholdRuleConditionProtocol {
    return LocationThresholdRuleConditionData(failedLocationCount: failedLocationCount)
  }
}


// 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 LogProfileCollectionData : LogProfileCollectionProtocol {
    public var value: [LogProfileResourceProtocol]

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

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

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

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

extension DataFactory {
  public static func createLogProfileCollectionProtocol(value: [LogProfileResourceProtocol]) -> LogProfileCollectionProtocol {
    return LogProfileCollectionData(value: value)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct LogProfilePropertiesData : LogProfilePropertiesProtocol {
    public var storageAccountId: String?
    public var serviceBusRuleId: String?
    public var locations: [String]
    public var categories: [String]
    public var retentionPolicy: RetentionPolicyProtocol

        enum CodingKeys: String, CodingKey {case storageAccountId = "storageAccountId"
        case serviceBusRuleId = "serviceBusRuleId"
        case locations = "locations"
        case categories = "categories"
        case retentionPolicy = "retentionPolicy"
        }

  public init(locations: [String], categories: [String], retentionPolicy: RetentionPolicyProtocol)  {
    self.locations = locations
    self.categories = categories
    self.retentionPolicy = retentionPolicy
  }

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

extension DataFactory {
  public static func createLogProfilePropertiesProtocol(locations: [String], categories: [String], retentionPolicy: RetentionPolicyProtocol) -> LogProfilePropertiesProtocol {
    return LogProfilePropertiesData(locations: locations, categories: categories, retentionPolicy: retentionPolicy)
  }
}


// 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 LogProfileResourceData : LogProfileResourceProtocol, 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: LogProfilePropertiesProtocol

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

  public init(location: String, properties: LogProfilePropertiesProtocol)  {
    self.location = location
    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)
    }
    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(LogProfilePropertiesData.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)}
    try container.encode(self.location, forKey: .location)
    if self.tags != nil {try container.encode(self.tags, forKey: .tags)}
    try container.encode(self.properties as! LogProfilePropertiesData, forKey: .properties)
  }
}

extension DataFactory {
  public static func createLogProfileResourceProtocol(location: String, properties: LogProfilePropertiesProtocol) -> LogProfileResourceProtocol {
    return LogProfileResourceData(location: location, 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 LogProfileResourcePatchData : LogProfileResourcePatchProtocol {
    public var tags: [String:String]?
    public var properties: LogProfilePropertiesProtocol?

        enum CodingKeys: String, CodingKey {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(.tags) {
        self.tags = try container.decode([String:String]?.self, forKey: .tags)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(LogProfilePropertiesData?.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.tags != nil {try container.encode(self.tags, forKey: .tags)}
    if self.properties != nil {try container.encode(self.properties as! LogProfilePropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createLogProfileResourcePatchProtocol() -> LogProfileResourcePatchProtocol {
    return LogProfileResourcePatchData()
  }
}