// 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 ClientCertificateThumbprintData : ClientCertificateThumbprintProtocol {
    public var isAdmin: Bool
    public var certificateThumbprint: String

        enum CodingKeys: String, CodingKey {case isAdmin = "isAdmin"
        case certificateThumbprint = "certificateThumbprint"
        }

  public init(isAdmin: Bool, certificateThumbprint: String)  {
    self.isAdmin = isAdmin
    self.certificateThumbprint = certificateThumbprint
  }

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

extension DataFactory {
  public static func createClientCertificateThumbprintProtocol(isAdmin: Bool, certificateThumbprint: String) -> ClientCertificateThumbprintProtocol {
    return ClientCertificateThumbprintData(isAdmin: isAdmin, certificateThumbprint: certificateThumbprint)
  }
}
