// 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 BEKDetailsData : BEKDetailsProtocol {
    public var secretUrl: String?
    public var secretVaultId: String?
    public var secretData: String?

        enum CodingKeys: String, CodingKey {case secretUrl = "secretUrl"
        case secretVaultId = "secretVaultId"
        case secretData = "secretData"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createBEKDetailsProtocol() -> BEKDetailsProtocol {
    return BEKDetailsData()
  }
}
