// 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 ApplicationSecurityGroupPropertiesFormatData : ApplicationSecurityGroupPropertiesFormatProtocol {
    public var resourceGuid: String?
    public var provisioningState: String?

        enum CodingKeys: String, CodingKey {case resourceGuid = "resourceGuid"
        case provisioningState = "provisioningState"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createApplicationSecurityGroupPropertiesFormatProtocol() -> ApplicationSecurityGroupPropertiesFormatProtocol {
    return ApplicationSecurityGroupPropertiesFormatData()
  }
}
