import Foundation
import azureSwiftRuntime
public protocol ContainerGetMetadata  {
    var headerParameters: [String: String] { get set }
    var accountName : String { get set }
    var container : String { get set }
    var timeout : Int32? { get set }
    var restype : String { get set }
    var comp : String { get set }
    var leaseId : String?  { get set }
    var version : String?  { get set }
    var requestId : String?  { get set }
    func execute(client: RuntimeClient,
        completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.Container {
// GetMetadata returns all user-defined metadata for the container
internal class GetMetadataCommand : BaseCommand, ContainerGetMetadata {
    public var accountName : String
    public var container : String
    public var timeout : Int32?
    public var restype : String
    public var comp : String

    public var leaseId : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-lease-id"] = newValue!
            }else {
                headerParameters["x-ms-lease-id"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-lease-id" }) {
                return headerParameters["x-ms-lease-id"]
            }else {
                return nil
            }
        }
    }

    public var version : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-version"] = newValue!
            }else {
                headerParameters["x-ms-version"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-version" }) {
                return headerParameters["x-ms-version"]
            }else {
                return nil
            }
        }
    }

    public var requestId : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-client-request-id"] = newValue!
            }else {
                headerParameters["x-ms-client-request-id"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-client-request-id" }) {
                return headerParameters["x-ms-client-request-id"]
            }else {
                return nil
            }
        }
    }

    public init(accountName: String, container: String, restype: String, comp: String) {
        self.accountName = accountName
        self.container = container
        self.restype = restype
        self.comp = comp
        super.init()
        self.baseUrl = "https://{accountName}.blob.core.windows.net"
        self.method = "Get"
        self.isLongRunningOperation = false
        self.path = "/{container}"
        self.headerParameters = ["Content-Type":"application/xml; charset=utf-8"]
    }

    public override func preCall()  {
        self.pathParameters["{accountName}"] = String(describing: self.accountName)
        self.pathParameters["{container}"] = String(describing: self.container)
        if self.timeout != nil { queryParameters["{timeout}"] = String(describing: self.timeout!) }
        self.queryParameters["{restype}"] = String(describing: self.restype)
        self.queryParameters["{comp}"] = String(describing: self.comp)
}

    public func execute(client: RuntimeClient,
        completionHandler: @escaping (Error?) -> Void) -> Void {
        client.executeAsync(command: self) {
            (error) in
            completionHandler(error)
        }
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol ContainerGetProperties  {
    var headerParameters: [String: String] { get set }
    var accountName : String { get set }
    var container : String { get set }
    var timeout : Int32? { get set }
    var restype : String { get set }
    var leaseId : String?  { get set }
    var version : String?  { get set }
    var requestId : String?  { get set }
    func execute(client: RuntimeClient,
        completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.Container {
// GetProperties returns all user-defined metadata and system properties for the specified container. The data returned
// does not include the container's list of blobs
internal class GetPropertiesCommand : BaseCommand, ContainerGetProperties {
    public var accountName : String
    public var container : String
    public var timeout : Int32?
    public var restype : String

    public var leaseId : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-lease-id"] = newValue!
            }else {
                headerParameters["x-ms-lease-id"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-lease-id" }) {
                return headerParameters["x-ms-lease-id"]
            }else {
                return nil
            }
        }
    }

    public var version : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-version"] = newValue!
            }else {
                headerParameters["x-ms-version"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-version" }) {
                return headerParameters["x-ms-version"]
            }else {
                return nil
            }
        }
    }

    public var requestId : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-client-request-id"] = newValue!
            }else {
                headerParameters["x-ms-client-request-id"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-client-request-id" }) {
                return headerParameters["x-ms-client-request-id"]
            }else {
                return nil
            }
        }
    }

    let azureStorageKey: String

    public init(azureStorageKey: String, accountName: String, container: String, restype: String) {
        self.azureStorageKey = azureStorageKey
        self.accountName = accountName
        self.container = container
        self.restype = restype
        super.init()
        self.baseUrl = "https://{accountName}.blob.core.windows.net"
        self.method = "Get"
        self.isLongRunningOperation = false
        self.path = "/{container}"
        self.headerParameters = ["Content-Type":"application/xml; charset=utf-8"]
    }

    public override func preCall()  {
        self.pathParameters["{accountName}"] = String(describing: self.accountName)
        self.pathParameters["{container}"] = String(describing: self.container)
        if self.timeout != nil { queryParameters["{timeout}"] = String(describing: self.timeout!) }
        self.queryParameters["restype"] = String(describing: self.restype)
        self.signRequest(azureStorageKey: self.azureStorageKey, storageAccountName: self.accountName)
    }

    public func execute(client: RuntimeClient,
        completionHandler: @escaping (Error?) -> Void) -> Void {
        client.executeAsync(command: self) {
            (error) in
            completionHandler(error)
        }
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol ContainerLease  {
    var headerParameters: [String: String] { get set }
    var accountName : String { get set }
    var container : String { get set }
    var timeout : Int32? { get set }
    var comp : String { get set }
    var restype : String { get set }
    var leaseId : String?  { get set }
    var action : String?  { get set }
    var breakPeriod : String?  { get set }
    var duration : String?  { get set }
    var proposedLeaseId : String?  { get set }
    var ifModifiedSince : String?  { get set }
    var ifUnmodifiedSince : String?  { get set }
    var version : String?  { get set }
    var requestId : String?  { get set }
    func execute(client: RuntimeClient,
        completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.Container {
// Lease establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60
// seconds, or can be infinite
internal class LeaseCommand : BaseCommand, ContainerLease {
    public var accountName : String
    public var container : String
    public var timeout : Int32?
    public var comp : String
    public var restype : String

    public var leaseId : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-lease-id"] = newValue!
            }else {
                headerParameters["x-ms-lease-id"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-lease-id" }) {
                return headerParameters["x-ms-lease-id"]
            }else {
                return nil
            }
        }
    }

    public var action : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-lease-action"] = newValue!
            }else {
                headerParameters["x-ms-lease-action"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-lease-action" }) {
                return headerParameters["x-ms-lease-action"]
            }else {
                return nil
            }
        }
    }

    public var breakPeriod : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-lease-break-period"] = newValue!
            }else {
                headerParameters["x-ms-lease-break-period"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-lease-break-period" }) {
                return headerParameters["x-ms-lease-break-period"]
            }else {
                return nil
            }
        }
    }

    public var duration : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-lease-duration"] = newValue!
            }else {
                headerParameters["x-ms-lease-duration"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-lease-duration" }) {
                return headerParameters["x-ms-lease-duration"]
            }else {
                return nil
            }
        }
    }

    public var proposedLeaseId : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-proposed-lease-id"] = newValue!
            }else {
                headerParameters["x-ms-proposed-lease-id"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-proposed-lease-id" }) {
                return headerParameters["x-ms-proposed-lease-id"]
            }else {
                return nil
            }
        }
    }

    public var ifModifiedSince : String? {
        set {
            if newValue != nil {
                headerParameters["If-Modified-Since"] = newValue!
            }else {
                headerParameters["If-Modified-Since"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "If-Modified-Since" }) {
                return headerParameters["If-Modified-Since"]
            }else {
                return nil
            }
        }
    }

    public var ifUnmodifiedSince : String? {
        set {
            if newValue != nil {
                headerParameters["If-Unmodified-Since"] = newValue!
            }else {
                headerParameters["If-Unmodified-Since"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "If-Unmodified-Since" }) {
                return headerParameters["If-Unmodified-Since"]
            }else {
                return nil
            }
        }
    }

    public var version : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-version"] = newValue!
            }else {
                headerParameters["x-ms-version"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-version" }) {
                return headerParameters["x-ms-version"]
            }else {
                return nil
            }
        }
    }

    public var requestId : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-client-request-id"] = newValue!
            }else {
                headerParameters["x-ms-client-request-id"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-client-request-id" }) {
                return headerParameters["x-ms-client-request-id"]
            }else {
                return nil
            }
        }
    }

    public init(accountName: String, container: String, comp: String, restype: String) {
        self.accountName = accountName
        self.container = container
        self.comp = comp
        self.restype = restype
        super.init()
        self.baseUrl = "https://{accountName}.blob.core.windows.net"
        self.method = "Put"
        self.isLongRunningOperation = false
        self.path = "/{container}"
        self.headerParameters = ["Content-Type":"application/xml; charset=utf-8"]
    }

    public override func preCall()  {
        self.pathParameters["{accountName}"] = String(describing: self.accountName)
        self.pathParameters["{container}"] = String(describing: self.container)
        if self.timeout != nil { queryParameters["{timeout}"] = String(describing: self.timeout!) }
        self.queryParameters["{comp}"] = String(describing: self.comp)
        self.queryParameters["{restype}"] = String(describing: self.restype)
}

    public func execute(client: RuntimeClient,
        completionHandler: @escaping (Error?) -> Void) -> Void {
        client.executeAsync(command: self) {
            (error) in
            completionHandler(error)
        }
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol ContainerListBlobs  {
    var headerParameters: [String: String] { get set }
    var accountName : String { get set }
    var container : String { get set }
    var prefix : String? { get set }
    var delimiter : String? { get set }
    var marker : String? { get set }
    var maxresults : Int32? { get set }
    var include : ListBlobsInclude? { get set }
    var timeout : Int32? { get set }
    var restype : String { get set }
    var comp : String { get set }
    var version : String?  { get set }
    var requestId : String?  { get set }
    func execute(client: RuntimeClient,
        completionHandler: @escaping (BlobEnumerationResultsProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Container {
// ListBlobs the List Blobs operation returns a list of the blobs under the specified container
internal class ListBlobsCommand : BaseCommand, ContainerListBlobs {
    public var accountName : String
    public var container : String
    public var prefix : String?
    public var delimiter : String?
    public var marker : String?
    public var maxresults : Int32?
    public var include : ListBlobsInclude?
    public var timeout : Int32?
    public var restype : String
    public var comp : String

    public var version : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-version"] = newValue!
            }else {
                headerParameters["x-ms-version"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-version" }) {
                return headerParameters["x-ms-version"]
            }else {
                return nil
            }
        }
    }

    public var requestId : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-client-request-id"] = newValue!
            }else {
                headerParameters["x-ms-client-request-id"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-client-request-id" }) {
                return headerParameters["x-ms-client-request-id"]
            }else {
                return nil
            }
        }
    }

    let azureStorageKey: String

    public init(azureStorageKey: String, accountName: String, container: String, restype: String, comp: String) {
        self.azureStorageKey = azureStorageKey
        self.accountName = accountName
        self.container = container
        self.restype = restype
        self.comp = comp
        super.init()
        self.baseUrl = "https://{accountName}.blob.core.windows.net"
        self.method = "Get"
        self.isLongRunningOperation = false
        self.path = "/{container}"
        self.headerParameters = ["Content-Type":"application/xml; charset=utf-8"]
    }

    public override func preCall()  {
        self.pathParameters["{accountName}"] = String(describing: self.accountName)
        self.pathParameters["{container}"] = String(describing: self.container)
        if self.prefix != nil { queryParameters["prefix"] = String(describing: self.prefix!) }
        if self.delimiter != nil { queryParameters["delimiter"] = String(describing: self.delimiter!) }
        if self.marker != nil { queryParameters["marker"] = String(describing: self.marker!) }
        if self.maxresults != nil { queryParameters["maxresults"] = String(describing: self.maxresults!) }
        if self.include != nil { queryParameters["include"] = String(describing: self.include!) }
        if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
        self.queryParameters["restype"] = String(describing: self.restype)
        self.queryParameters["comp"] = String(describing: self.comp)
        self.signRequest(azureStorageKey: self.azureStorageKey, storageAccountName: self.accountName)
    }

    public override func returnFunc(data: Data) throws -> Decodable? {
        let contentType = "application/xml"
        if let mimeType = MimeType.getType(forStr: contentType) {
            let decoder = try CoderFactory.decoder(for: mimeType)
//            return try decoder.decode(BlobEnumerationResultsData?.self, from: data)
            do {
                let res = try decoder.decode(BlobEnumerationResultsData?.self, from: data)
                return res

            } catch {
                print("=== returnFunc error:", error)
            }
        }

        throw DecodeError.unknownMimeType
    }
    public func execute(client: RuntimeClient,
        completionHandler: @escaping (BlobEnumerationResultsProtocol?, Error?) -> Void) -> Void {
        client.executeAsync(command: self) {
            (result: BlobEnumerationResultsData?, error: Error?) in
            completionHandler(result, error)
        }
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol ContainerSetAcl  {
    var headerParameters: [String: String] { get set }
    var accountName : String { get set }
    var container : String { get set }
    var timeout : Int32? { get set }
    var restype : String { get set }
    var comp : String { get set }
    var leaseId : String?  { get set }
    var access : String?  { get set }
    var ifModifiedSince : String?  { get set }
    var ifUnmodifiedSince : String?  { get set }
    var ifMatches : String?  { get set }
    var ifNoneMatch : String?  { get set }
    var version : String?  { get set }
    var requestId : String?  { get set }
    var containerAcl :  [SignedIdentifierProtocol?]?  { get set }
    func execute(client: RuntimeClient,
        completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.Container {
// SetAcl sends the set acl request.
internal class SetAclCommand : BaseCommand, ContainerSetAcl {
    public var accountName : String
    public var container : String
    public var timeout : Int32?
    public var restype : String
    public var comp : String

    public var leaseId : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-lease-id"] = newValue!
            }else {
                headerParameters["x-ms-lease-id"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-lease-id" }) {
                return headerParameters["x-ms-lease-id"]
            }else {
                return nil
            }
        }
    }

    public var access : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-blob-public-access"] = newValue!
            }else {
                headerParameters["x-ms-blob-public-access"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-blob-public-access" }) {
                return headerParameters["x-ms-blob-public-access"]
            }else {
                return nil
            }
        }
    }

    public var ifModifiedSince : String? {
        set {
            if newValue != nil {
                headerParameters["If-Modified-Since"] = newValue!
            }else {
                headerParameters["If-Modified-Since"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "If-Modified-Since" }) {
                return headerParameters["If-Modified-Since"]
            }else {
                return nil
            }
        }
    }

    public var ifUnmodifiedSince : String? {
        set {
            if newValue != nil {
                headerParameters["If-Unmodified-Since"] = newValue!
            }else {
                headerParameters["If-Unmodified-Since"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "If-Unmodified-Since" }) {
                return headerParameters["If-Unmodified-Since"]
            }else {
                return nil
            }
        }
    }

    public var ifMatches : String? {
        set {
            if newValue != nil {
                headerParameters["If-Match"] = newValue!
            }else {
                headerParameters["If-Match"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "If-Match" }) {
                return headerParameters["If-Match"]
            }else {
                return nil
            }
        }
    }

    public var ifNoneMatch : String? {
        set {
            if newValue != nil {
                headerParameters["If-None-Match"] = newValue!
            }else {
                headerParameters["If-None-Match"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "If-None-Match" }) {
                return headerParameters["If-None-Match"]
            }else {
                return nil
            }
        }
    }

    public var version : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-version"] = newValue!
            }else {
                headerParameters["x-ms-version"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-version" }) {
                return headerParameters["x-ms-version"]
            }else {
                return nil
            }
        }
    }

    public var requestId : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-client-request-id"] = newValue!
            }else {
                headerParameters["x-ms-client-request-id"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-client-request-id" }) {
                return headerParameters["x-ms-client-request-id"]
            }else {
                return nil
            }
        }
    }
    public var containerAcl :  [SignedIdentifierProtocol?]?

    let azureStorageKey: String

    public init(azureStorageKey: String, accountName: String, container: String, restype: String, comp: String) {
        self.azureStorageKey = azureStorageKey
        self.accountName = accountName
        self.container = container
        self.restype = restype
        self.comp = comp
        super.init()
        self.baseUrl = "https://{accountName}.blob.core.windows.net"
        self.method = "Put"
        self.isLongRunningOperation = false
        self.path = "/{container}"
        self.headerParameters = ["Content-Type":"application/xml; charset=utf-8"]
    }

    public override func preCall()  {
        self.pathParameters["{accountName}"] = String(describing: self.accountName)
        self.pathParameters["{container}"] = String(describing: self.container)
        if self.timeout != nil { queryParameters["{timeout}"] = String(describing: self.timeout!) }
        self.queryParameters["restype"] = String(describing: self.restype)
        self.queryParameters["comp"] = String(describing: self.comp)
        self.body = containerAcl
        self.signRequest(azureStorageKey: self.azureStorageKey, storageAccountName: self.accountName)
    }

    public override func encodeBody() throws -> Data? {
        let contentType = "application/xml"
        if let mimeType = MimeType.getType(forStr: contentType) {
            let encoder = try CoderFactory.encoder(for: mimeType)
            let encodedValue = try encoder.encode(containerAcl)
            return encodedValue
        }

        throw DecodeError.unknownMimeType
    }

    public func execute(client: RuntimeClient,
        completionHandler: @escaping (Error?) -> Void) -> Void {
        client.executeAsync(command: self) {
            (error) in
            completionHandler(error)
        }
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol ContainerSetMetadata  {
    var headerParameters: [String: String] { get set }
    var accountName : String { get set }
    var container : String { get set }
    var timeout : Int32? { get set }
    var restype : String { get set }
    var comp : String { get set }
    var leaseId : String?  { get set }
    var xMsMeta : String?  { get set }
    var ifModifiedSince : String?  { get set }
    var version : String?  { get set }
    var requestId : String?  { get set }
    func execute(client: RuntimeClient,
        completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.Container {
// SetMetadata operation sets one or more user-defined name-value pairs for the specified container.
internal class SetMetadataCommand : BaseCommand, ContainerSetMetadata {
    public var accountName : String
    public var container : String
    public var timeout : Int32?
    public var restype : String
    public var comp : String

    public var leaseId : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-lease-id"] = newValue!
            }else {
                headerParameters["x-ms-lease-id"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-lease-id" }) {
                return headerParameters["x-ms-lease-id"]
            }else {
                return nil
            }
        }
    }

    public var xMsMeta : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-meta"] = newValue!
            }else {
                headerParameters["x-ms-meta"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-meta" }) {
                return headerParameters["x-ms-meta"]
            }else {
                return nil
            }
        }
    }

    public var ifModifiedSince : String? {
        set {
            if newValue != nil {
                headerParameters["If-Modified-Since"] = newValue!
            }else {
                headerParameters["If-Modified-Since"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "If-Modified-Since" }) {
                return headerParameters["If-Modified-Since"]
            }else {
                return nil
            }
        }
    }

    public var version : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-version"] = newValue!
            }else {
                headerParameters["x-ms-version"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-version" }) {
                return headerParameters["x-ms-version"]
            }else {
                return nil
            }
        }
    }

    public var requestId : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-client-request-id"] = newValue!
            }else {
                headerParameters["x-ms-client-request-id"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-client-request-id" }) {
                return headerParameters["x-ms-client-request-id"]
            }else {
                return nil
            }
        }
    }

    public init(accountName: String, container: String, restype: String, comp: String) {
        self.accountName = accountName
        self.container = container
        self.restype = restype
        self.comp = comp
        super.init()
        self.baseUrl = "https://{accountName}.blob.core.windows.net"
        self.method = "Put"
        self.isLongRunningOperation = false
        self.path = "/{container}"
        self.headerParameters = ["Content-Type":"application/xml; charset=utf-8"]
    }

    public override func preCall()  {
        self.pathParameters["{accountName}"] = String(describing: self.accountName)
        self.pathParameters["{container}"] = String(describing: self.container)
        if self.timeout != nil { queryParameters["{timeout}"] = String(describing: self.timeout!) }
        self.queryParameters["{restype}"] = String(describing: self.restype)
        self.queryParameters["{comp}"] = String(describing: self.comp)
}

    public func execute(client: RuntimeClient,
        completionHandler: @escaping (Error?) -> Void) -> Void {
        client.executeAsync(command: self) {
            (error) in
            completionHandler(error)
        }
    }
}
}


// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
public class DataFactory {
}
public class Commands {
}


// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

// PageBlobs is the client for the PageBlobs methods of the AzureBlobStorage service.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct PageBlobs {
    public static func GetPageRanges(accountName: String, container: String, blob: String, comp: String) -> PageBlobsGetPageRanges {
        return GetPageRangesCommand(accountName: accountName, container: container, blob: blob, comp: comp)
    }
    public static func IncrementalCopy(accountName: String, container: String, blob: String, comp: String) -> PageBlobsIncrementalCopy {
        return IncrementalCopyCommand(accountName: accountName, container: container, blob: blob, comp: comp)
    }
    public static func PutPage(accountName: String, container: String, blob: String, comp: String, _body: Data) -> PageBlobsPutPage {
        return PutPageCommand(accountName: accountName, container: container, blob: blob, comp: comp, _body: _body)
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol PageBlobsGetPageRanges  {
    var headerParameters: [String: String] { get set }
    var accountName : String { get set }
    var container : String { get set }
    var blob : String { get set }
    var snapshot : Date? { get set }
    var timeout : Int32? { get set }
    var prevsnapshot : Date? { get set }
    var comp : String { get set }
    var range : String?  { get set }
    var leaseId : String?  { get set }
    var ifModifiedSince : String?  { get set }
    var ifUnmodifiedSince : String?  { get set }
    var ifMatches : String?  { get set }
    var ifNoneMatch : String?  { get set }
    var version : String?  { get set }
    var requestId : String?  { get set }
    func execute(client: RuntimeClient,
        completionHandler: @escaping ([String: String?]?, Error?) -> Void) -> Void ;
}

extension Commands.PageBlobs {
// GetPageRanges the Get Page Ranges operation returns the list of valid page ranges for a page blob or snapshot of a
// page blob
internal class GetPageRangesCommand : BaseCommand, PageBlobsGetPageRanges {
    public var accountName : String
    public var container : String
    public var blob : String
    public var snapshot : Date?
    public var timeout : Int32?
    public var prevsnapshot : Date?
    public var comp : String

    public var range : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-range"] = newValue!
            }else {
                headerParameters["x-ms-range"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-range" }) {
                return headerParameters["x-ms-range"]
            }else {
                return nil
            }
        }
    }

    public var leaseId : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-lease-id"] = newValue!
            }else {
                headerParameters["x-ms-lease-id"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-lease-id" }) {
                return headerParameters["x-ms-lease-id"]
            }else {
                return nil
            }
        }
    }

    public var ifModifiedSince : String? {
        set {
            if newValue != nil {
                headerParameters["If-Modified-Since"] = newValue!
            }else {
                headerParameters["If-Modified-Since"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "If-Modified-Since" }) {
                return headerParameters["If-Modified-Since"]
            }else {
                return nil
            }
        }
    }

    public var ifUnmodifiedSince : String? {
        set {
            if newValue != nil {
                headerParameters["If-Unmodified-Since"] = newValue!
            }else {
                headerParameters["If-Unmodified-Since"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "If-Unmodified-Since" }) {
                return headerParameters["If-Unmodified-Since"]
            }else {
                return nil
            }
        }
    }

    public var ifMatches : String? {
        set {
            if newValue != nil {
                headerParameters["If-Match"] = newValue!
            }else {
                headerParameters["If-Match"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "If-Match" }) {
                return headerParameters["If-Match"]
            }else {
                return nil
            }
        }
    }

    public var ifNoneMatch : String? {
        set {
            if newValue != nil {
                headerParameters["If-None-Match"] = newValue!
            }else {
                headerParameters["If-None-Match"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "If-None-Match" }) {
                return headerParameters["If-None-Match"]
            }else {
                return nil
            }
        }
    }

    public var version : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-version"] = newValue!
            }else {
                headerParameters["x-ms-version"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-version" }) {
                return headerParameters["x-ms-version"]
            }else {
                return nil
            }
        }
    }

    public var requestId : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-client-request-id"] = newValue!
            }else {
                headerParameters["x-ms-client-request-id"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-client-request-id" }) {
                return headerParameters["x-ms-client-request-id"]
            }else {
                return nil
            }
        }
    }

    public init(accountName: String, container: String, blob: String, comp: String) {
        self.accountName = accountName
        self.container = container
        self.blob = blob
        self.comp = comp
        super.init()
        self.baseUrl = "https://{accountName}.blob.core.windows.net"
        self.method = "Get"
        self.isLongRunningOperation = false
        self.path = "/{container}/{blob}"
        self.headerParameters = ["Content-Type":"application/xml; charset=utf-8"]
    }

    public override func preCall()  {
        self.pathParameters["{accountName}"] = String(describing: self.accountName)
        self.pathParameters["{container}"] = String(describing: self.container)
        self.pathParameters["{blob}"] = String(describing: self.blob)
        if self.snapshot != nil { queryParameters["{snapshot}"] = String(describing: self.snapshot!) }
        if self.timeout != nil { queryParameters["{timeout}"] = String(describing: self.timeout!) }
        if self.prevsnapshot != nil { queryParameters["{prevsnapshot}"] = String(describing: self.prevsnapshot!) }
        self.queryParameters["{comp}"] = String(describing: self.comp)
}

    public override func returnFunc(data: Data) throws -> Decodable? {
        let contentType = "application/xml"
        if let mimeType = MimeType.getType(forStr: contentType) {
            let decoder = try CoderFactory.decoder(for: mimeType)
            return try decoder.decode([String: String?]?.self, from: data)
        }
        throw DecodeError.unknownMimeType
    }
    public func execute(client: RuntimeClient,
        completionHandler: @escaping ([String: String?]?, Error?) -> Void) -> Void {
        client.executeAsync(command: self) {
            (result: [String: String?]?, error: Error?) in
            completionHandler(result, error)
        }
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol PageBlobsIncrementalCopy  {
    var headerParameters: [String: String] { get set }
    var accountName : String { get set }
    var container : String { get set }
    var blob : String { get set }
    var timeout : Int32? { get set }
    var comp : String { get set }
    var xMsMeta : String?  { get set }
    var ifModifiedSince : String?  { get set }
    var ifUnmodifiedSince : String?  { get set }
    var ifMatches : String?  { get set }
    var ifNoneMatch : String?  { get set }
    var copySource : String?  { get set }
    var version : String?  { get set }
    var requestId : String?  { get set }
    func execute(client: RuntimeClient,
        completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.PageBlobs {
// IncrementalCopy the Incremental Copy Blob operation copies a snapshot of the source page blob to a destination page
// blob. The snapshot is copied such that only the differential changes between the previously copied snapshot are
// transferred to the destination. The copied snapshots are complete copies of the original snapshot and can be read or
// copied from as usual. This API is supported since REST version 2016-05-31.
internal class IncrementalCopyCommand : BaseCommand, PageBlobsIncrementalCopy {
    public var accountName : String
    public var container : String
    public var blob : String
    public var timeout : Int32?
    public var comp : String

    public var xMsMeta : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-meta"] = newValue!
            }else {
                headerParameters["x-ms-meta"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-meta" }) {
                return headerParameters["x-ms-meta"]
            }else {
                return nil
            }
        }
    }

    public var ifModifiedSince : String? {
        set {
            if newValue != nil {
                headerParameters["If-Modified-Since"] = newValue!
            }else {
                headerParameters["If-Modified-Since"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "If-Modified-Since" }) {
                return headerParameters["If-Modified-Since"]
            }else {
                return nil
            }
        }
    }

    public var ifUnmodifiedSince : String? {
        set {
            if newValue != nil {
                headerParameters["If-Unmodified-Since"] = newValue!
            }else {
                headerParameters["If-Unmodified-Since"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "If-Unmodified-Since" }) {
                return headerParameters["If-Unmodified-Since"]
            }else {
                return nil
            }
        }
    }

    public var ifMatches : String? {
        set {
            if newValue != nil {
                headerParameters["If-Match"] = newValue!
            }else {
                headerParameters["If-Match"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "If-Match" }) {
                return headerParameters["If-Match"]
            }else {
                return nil
            }
        }
    }

    public var ifNoneMatch : String? {
        set {
            if newValue != nil {
                headerParameters["If-None-Match"] = newValue!
            }else {
                headerParameters["If-None-Match"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "If-None-Match" }) {
                return headerParameters["If-None-Match"]
            }else {
                return nil
            }
        }
    }

    public var copySource : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-copy-source"] = newValue!
            }else {
                headerParameters["x-ms-copy-source"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-copy-source" }) {
                return headerParameters["x-ms-copy-source"]
            }else {
                return nil
            }
        }
    }

    public var version : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-version"] = newValue!
            }else {
                headerParameters["x-ms-version"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-version" }) {
                return headerParameters["x-ms-version"]
            }else {
                return nil
            }
        }
    }

    public var requestId : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-client-request-id"] = newValue!
            }else {
                headerParameters["x-ms-client-request-id"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-client-request-id" }) {
                return headerParameters["x-ms-client-request-id"]
            }else {
                return nil
            }
        }
    }

    public init(accountName: String, container: String, blob: String, comp: String) {
        self.accountName = accountName
        self.container = container
        self.blob = blob
        self.comp = comp
        super.init()
        self.baseUrl = "https://{accountName}.blob.core.windows.net"
        self.method = "Put"
        self.isLongRunningOperation = false
        self.path = "/{container}/{blob}"
        self.headerParameters = ["Content-Type":"application/xml; charset=utf-8"]
    }

    public override func preCall()  {
        self.pathParameters["{accountName}"] = String(describing: self.accountName)
        self.pathParameters["{container}"] = String(describing: self.container)
        self.pathParameters["{blob}"] = String(describing: self.blob)
        if self.timeout != nil { queryParameters["{timeout}"] = String(describing: self.timeout!) }
        self.queryParameters["{comp}"] = String(describing: self.comp)
}

    public func execute(client: RuntimeClient,
        completionHandler: @escaping (Error?) -> Void) -> Void {
        client.executeAsync(command: self) {
            (error) in
            completionHandler(error)
        }
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol PageBlobsPutPage  {
    var headerParameters: [String: String] { get set }
    var accountName : String { get set }
    var container : String { get set }
    var blob : String { get set }
    var timeout : Int32? { get set }
    var comp : String { get set }
    var range : String?  { get set }
    var pageWrite : String?  { get set }
    var leaseId : String?  { get set }
    var ifSequenceNumberLessThanOrEqualTo : String?  { get set }
    var ifSequenceNumberLessThan : String?  { get set }
    var ifSequenceNumberEqualTo : String?  { get set }
    var ifModifiedSince : String?  { get set }
    var ifUnmodifiedSince : String?  { get set }
    var ifMatches : String?  { get set }
    var ifNoneMatch : String?  { get set }
    var version : String?  { get set }
    var requestId : String?  { get set }
    var _body :  Data?  { get set }
    func execute(client: RuntimeClient,
        completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.PageBlobs {
// PutPage the Put Page operation writes a range of pages to a page blob
internal class PutPageCommand : BaseCommand, PageBlobsPutPage {
    public var accountName : String
    public var container : String
    public var blob : String
    public var timeout : Int32?
    public var comp : String

    public var range : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-range"] = newValue!
            }else {
                headerParameters["x-ms-range"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-range" }) {
                return headerParameters["x-ms-range"]
            }else {
                return nil
            }
        }
    }

    public var pageWrite : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-page-write"] = newValue!
            }else {
                headerParameters["x-ms-page-write"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-page-write" }) {
                return headerParameters["x-ms-page-write"]
            }else {
                return nil
            }
        }
    }

    public var leaseId : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-lease-id"] = newValue!
            }else {
                headerParameters["x-ms-lease-id"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-lease-id" }) {
                return headerParameters["x-ms-lease-id"]
            }else {
                return nil
            }
        }
    }

    public var ifSequenceNumberLessThanOrEqualTo : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-if-sequence-number-le"] = newValue!
            }else {
                headerParameters["x-ms-if-sequence-number-le"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-if-sequence-number-le" }) {
                return headerParameters["x-ms-if-sequence-number-le"]
            }else {
                return nil
            }
        }
    }

    public var ifSequenceNumberLessThan : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-if-sequence-number-lt"] = newValue!
            }else {
                headerParameters["x-ms-if-sequence-number-lt"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-if-sequence-number-lt" }) {
                return headerParameters["x-ms-if-sequence-number-lt"]
            }else {
                return nil
            }
        }
    }

    public var ifSequenceNumberEqualTo : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-if-sequence-number-eq"] = newValue!
            }else {
                headerParameters["x-ms-if-sequence-number-eq"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-if-sequence-number-eq" }) {
                return headerParameters["x-ms-if-sequence-number-eq"]
            }else {
                return nil
            }
        }
    }

    public var ifModifiedSince : String? {
        set {
            if newValue != nil {
                headerParameters["If-Modified-Since"] = newValue!
            }else {
                headerParameters["If-Modified-Since"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "If-Modified-Since" }) {
                return headerParameters["If-Modified-Since"]
            }else {
                return nil
            }
        }
    }

    public var ifUnmodifiedSince : String? {
        set {
            if newValue != nil {
                headerParameters["If-Unmodified-Since"] = newValue!
            }else {
                headerParameters["If-Unmodified-Since"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "If-Unmodified-Since" }) {
                return headerParameters["If-Unmodified-Since"]
            }else {
                return nil
            }
        }
    }

    public var ifMatches : String? {
        set {
            if newValue != nil {
                headerParameters["If-Match"] = newValue!
            }else {
                headerParameters["If-Match"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "If-Match" }) {
                return headerParameters["If-Match"]
            }else {
                return nil
            }
        }
    }

    public var ifNoneMatch : String? {
        set {
            if newValue != nil {
                headerParameters["If-None-Match"] = newValue!
            }else {
                headerParameters["If-None-Match"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "If-None-Match" }) {
                return headerParameters["If-None-Match"]
            }else {
                return nil
            }
        }
    }

    public var version : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-version"] = newValue!
            }else {
                headerParameters["x-ms-version"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-version" }) {
                return headerParameters["x-ms-version"]
            }else {
                return nil
            }
        }
    }

    public var requestId : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-client-request-id"] = newValue!
            }else {
                headerParameters["x-ms-client-request-id"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-client-request-id" }) {
                return headerParameters["x-ms-client-request-id"]
            }else {
                return nil
            }
        }
    }
    public var _body :  Data?

    public init(accountName: String, container: String, blob: String, comp: String, _body: Data) {
        self.accountName = accountName
        self.container = container
        self.blob = blob
        self.comp = comp
        self._body = _body
        super.init()
        self.baseUrl = "https://{accountName}.blob.core.windows.net"
        self.method = "Put"
        self.isLongRunningOperation = false
        self.path = "/{container}/{blob}"
        self.headerParameters = ["Content-Type":"application/xml; charset=utf-8"]
    }

    public override func preCall()  {
        self.pathParameters["{accountName}"] = String(describing: self.accountName)
        self.pathParameters["{container}"] = String(describing: self.container)
        self.pathParameters["{blob}"] = String(describing: self.blob)
        if self.timeout != nil { queryParameters["{timeout}"] = String(describing: self.timeout!) }
        self.queryParameters["{comp}"] = String(describing: self.comp)
    self.body = _body
}

    public override func encodeBody() throws -> Data? {
        return self._body
    }

    public func execute(client: RuntimeClient,
        completionHandler: @escaping (Error?) -> Void) -> Void {
        client.executeAsync(command: self) {
            (error) in
            completionHandler(error)
        }
    }
}
}


// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

// Service is the client for the Service methods of the AzureBlobStorage service.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Service {
    public static func GetProperties(accountName: String, restype: String = "service", comp: String = "properties") -> ServiceGetProperties {
        return GetPropertiesCommand(accountName: accountName, restype: restype, comp: comp)
    }
    public static func GetStats(accountName: String, restype: String = "service", comp: String = "stats") -> ServiceGetStats {
        return GetStatsCommand(accountName: accountName, restype: restype, comp: comp)
    }
    public static func ListContainers(azureStorageKey: String, accountName: String, comp: String = "list") -> ServiceListContainers {
        return ListContainersCommand(azureStorageKey: azureStorageKey, accountName: accountName, comp: comp)
    }
    public static func SetProperties(accountName: String, restype: String  = "service", comp: String = "properties", storageServiceProperties: StorageServicePropertiesProtocol) -> ServiceSetProperties {
        return SetPropertiesCommand(accountName: accountName, restype: restype, comp: comp, storageServiceProperties: storageServiceProperties)
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol ServiceGetProperties  {
    var headerParameters: [String: String] { get set }
    var accountName : String { get set }
    var timeout : Int32? { get set }
    var restype : String { get set }
    var comp : String { get set }
    var version : String?  { get set }
    var requestId : String?  { get set }
    func execute(client: RuntimeClient,
        completionHandler: @escaping (StorageServicePropertiesProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Service {
// GetProperties gets the properties of a storage account's Blob service, including properties for Storage Analytics
// and CORS (Cross-Origin Resource Sharing) rules.
internal class GetPropertiesCommand : BaseCommand, ServiceGetProperties {
    public var accountName : String
    public var timeout : Int32?
    public var restype : String
    public var comp : String

    public var version : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-version"] = newValue!
            }else {
                headerParameters["x-ms-version"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-version" }) {
                return headerParameters["x-ms-version"]
            }else {
                return nil
            }
        }
    }

    public var requestId : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-client-request-id"] = newValue!
            }else {
                headerParameters["x-ms-client-request-id"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-client-request-id" }) {
                return headerParameters["x-ms-client-request-id"]
            }else {
                return nil
            }
        }
    }

    public init(accountName: String, restype: String, comp: String) {
        self.accountName = accountName
        self.restype = restype
        self.comp = comp
        super.init()
        self.baseUrl = "https://{accountName}.blob.core.windows.net"
        self.method = "Get"
        self.isLongRunningOperation = false
        self.path = "/"
        self.headerParameters = ["Content-Type":"application/xml; charset=utf-8"]
    }

    public override func preCall()  {
        self.pathParameters["{accountName}"] = String(describing: self.accountName)
        if self.timeout != nil { queryParameters["{timeout}"] = String(describing: self.timeout!) }
        self.queryParameters["{restype}"] = String(describing: self.restype)
        self.queryParameters["{comp}"] = String(describing: self.comp)
}

    public override func returnFunc(data: Data) throws -> Decodable? {
        let contentType = "application/xml"
        if let mimeType = MimeType.getType(forStr: contentType) {
            let decoder = try CoderFactory.decoder(for: mimeType)
            return try decoder.decode(StorageServicePropertiesData?.self, from: data)
        }
        throw DecodeError.unknownMimeType
    }
    public func execute(client: RuntimeClient,
        completionHandler: @escaping (StorageServicePropertiesProtocol?, Error?) -> Void) -> Void {
        client.executeAsync(command: self) {
            (result: StorageServicePropertiesData?, error: Error?) in
            completionHandler(result, error)
        }
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol ServiceGetStats  {
    var headerParameters: [String: String] { get set }
    var accountName : String { get set }
    var timeout : Int32? { get set }
    var restype : String { get set }
    var comp : String { get set }
    var version : String?  { get set }
    var requestId : String?  { get set }
    func execute(client: RuntimeClient,
        completionHandler: @escaping (StorageServiceStatsProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Service {
// GetStats retrieves statistics related to replication for the Blob service. It is only available on the secondary
// location endpoint when read-access geo-redundant replication is enabled for the storage account.
internal class GetStatsCommand : BaseCommand, ServiceGetStats {
    public var accountName : String
    public var timeout : Int32?
    public var restype : String
    public var comp : String

    public var version : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-version"] = newValue!
            }else {
                headerParameters["x-ms-version"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-version" }) {
                return headerParameters["x-ms-version"]
            }else {
                return nil
            }
        }
    }

    public var requestId : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-client-request-id"] = newValue!
            }else {
                headerParameters["x-ms-client-request-id"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-client-request-id" }) {
                return headerParameters["x-ms-client-request-id"]
            }else {
                return nil
            }
        }
    }

    public init(accountName: String, restype: String, comp: String) {
        self.accountName = accountName
        self.restype = restype
        self.comp = comp
        super.init()
        self.baseUrl = "https://{accountName}.blob.core.windows.net"
        self.method = "Get"
        self.isLongRunningOperation = false
        self.path = "/"
        self.headerParameters = ["Content-Type":"application/xml; charset=utf-8"]
    }

    public override func preCall()  {
        self.pathParameters["{accountName}"] = String(describing: self.accountName)
        if self.timeout != nil { queryParameters["{timeout}"] = String(describing: self.timeout!) }
        self.queryParameters["{restype}"] = String(describing: self.restype)
        self.queryParameters["{comp}"] = String(describing: self.comp)
}

    public override func returnFunc(data: Data) throws -> Decodable? {
        let contentType = "application/xml"
        if let mimeType = MimeType.getType(forStr: contentType) {
            let decoder = try CoderFactory.decoder(for: mimeType)
            return try decoder.decode(StorageServiceStatsData?.self, from: data)
        }
        throw DecodeError.unknownMimeType
    }
    public func execute(client: RuntimeClient,
        completionHandler: @escaping (StorageServiceStatsProtocol?, Error?) -> Void) -> Void {
        client.executeAsync(command: self) {
            (result: StorageServiceStatsData?, error: Error?) in
            completionHandler(result, error)
        }
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol ServiceListContainers  {
    var headerParameters: [String: String] { get set }
    var accountName : String { get set }
    var prefix : String? { get set }
    var marker : String? { get set }
    var maxresults : Int32? { get set }
    var include : ListContainersInclude? { get set }
    var timeout : Int32? { get set }
    var comp : String { get set }
    var version : String?  { get set }
    var requestId : String?  { get set }
    func execute(client: RuntimeClient,
        completionHandler: @escaping (ContainerEnumerationResultsProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Service {
// ListContainers the List Containers operation returns a list of the containers under the specified account
internal class ListContainersCommand : BaseCommand, ServiceListContainers {
    public var accountName : String
    public var prefix : String?
    public var marker : String?
    public var maxresults : Int32?
    public var include : ListContainersInclude?
    public var timeout : Int32?
    public var comp : String

    public var version : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-version"] = newValue!
            }else {
                headerParameters["x-ms-version"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-version" }) {
                return headerParameters["x-ms-version"]
            }else {
                return nil
            }
        }
    }

    public var requestId : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-client-request-id"] = newValue!
            }else {
                headerParameters["x-ms-client-request-id"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-client-request-id" }) {
                return headerParameters["x-ms-client-request-id"]
            }else {
                return nil
            }
        }
    }

    let azureStorageKey: String

    public init(azureStorageKey: String, accountName: String, comp: String) {
        self.accountName = accountName
        self.azureStorageKey = azureStorageKey
        self.comp = comp
        super.init()
        self.baseUrl = "https://{accountName}.blob.core.windows.net"
        self.method = "Get"
        self.isLongRunningOperation = false
        self.path = "/"
        self.headerParameters = ["Content-Type":"application/xml; charset=utf-8"]
    }

    public override func preCall()  {
        self.pathParameters["{accountName}"] = String(describing: self.accountName)
        if self.prefix != nil { queryParameters["{prefix}"] = String(describing: self.prefix!) }
        if self.marker != nil { queryParameters["{marker}"] = String(describing: self.marker!) }
        if self.maxresults != nil { queryParameters["{maxresults}"] = String(describing: self.maxresults!) }
        if self.include != nil { queryParameters["{include}"] = String(describing: self.include!) }
        if self.timeout != nil { queryParameters["{timeout}"] = String(describing: self.timeout!) }
        self.queryParameters["comp"] = String(describing: self.comp)
        self.signRequest(azureStorageKey: self.azureStorageKey, storageAccountName: self.accountName)
    }

    public override func returnFunc(data: Data) throws -> Decodable? {
        let contentType = "application/xml"
        if let mimeType = MimeType.getType(forStr: contentType) {
            let decoder = try CoderFactory.decoder(for: mimeType)
            return try decoder.decode(ContainerEnumerationResultsData?.self, from: data)
        }
        throw DecodeError.unknownMimeType
    }
    public func execute(client: RuntimeClient,
        completionHandler: @escaping (ContainerEnumerationResultsProtocol?, Error?) -> Void) -> Void {
        client.executeAsync(command: self) {
            (result: ContainerEnumerationResultsData?, error: Error?) in
            completionHandler(result, error)
        }
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol ServiceSetProperties  {
    var headerParameters: [String: String] { get set }
    var accountName : String { get set }
    var timeout : Int32? { get set }
    var restype : String { get set }
    var comp : String { get set }
    var version : String?  { get set }
    var requestId : String?  { get set }
    var storageServiceProperties :  StorageServicePropertiesProtocol?  { get set }
    func execute(client: RuntimeClient,
        completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.Service {
// SetProperties sets properties for a storage account's Blob service endpoint, including properties for Storage
// Analytics and CORS (Cross-Origin Resource Sharing) rules
internal class SetPropertiesCommand : BaseCommand, ServiceSetProperties {
    public var accountName : String
    public var timeout : Int32?
    public var restype : String
    public var comp : String

    public var version : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-version"] = newValue!
            }else {
                headerParameters["x-ms-version"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-version" }) {
                return headerParameters["x-ms-version"]
            }else {
                return nil
            }
        }
    }

    public var requestId : String? {
        set {
            if newValue != nil {
                headerParameters["x-ms-client-request-id"] = newValue!
            }else {
                headerParameters["x-ms-client-request-id"] = nil
            }
        }
        get {
            if headerParameters.contains(where: { $0.key == "x-ms-client-request-id" }) {
                return headerParameters["x-ms-client-request-id"]
            }else {
                return nil
            }
        }
    }
    public var storageServiceProperties :  StorageServicePropertiesProtocol?

    public init(accountName: String, restype: String, comp: String, storageServiceProperties: StorageServicePropertiesProtocol) {
        self.accountName = accountName
        self.restype = restype
        self.comp = comp
        self.storageServiceProperties = storageServiceProperties
        super.init()
        self.baseUrl = "https://{accountName}.blob.core.windows.net"
        self.method = "Put"
        self.isLongRunningOperation = false
        self.path = "/"
        self.headerParameters = ["Content-Type":"application/xml; charset=utf-8"]
    }

    public override func preCall()  {
        self.pathParameters["{accountName}"] = String(describing: self.accountName)
        if self.timeout != nil { queryParameters["{timeout}"] = String(describing: self.timeout!) }
        self.queryParameters["{restype}"] = String(describing: self.restype)
        self.queryParameters["{comp}"] = String(describing: self.comp)
    self.body = storageServiceProperties
}

    public override func encodeBody() throws -> Data? {
        let contentType = "application/xml"
        if let mimeType = MimeType.getType(forStr: contentType) {
            let encoder = try CoderFactory.encoder(for: mimeType)
            let encodedValue = try encoder.encode(storageServiceProperties)
            return encodedValue
        }
        throw DecodeError.unknownMimeType
    }

    public func execute(client: RuntimeClient,
        completionHandler: @escaping (Error?) -> Void) -> Void {
        client.executeAsync(command: self) {
            (error) in
            completionHandler(error)
        }
    }
}
}


// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import Foundation
public  struct AccessPolicyData : AccessPolicyProtocol {
    public var start: Date?
    public var expiry: Date?
    public var permission: String?

    enum CodingKeys: String, CodingKey {
        case start = "Start"
        case expiry = "Expiry"
        case permission = "Permission"
    }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
    if container.contains(.start) {
        start = try container.decode(Date?.self, forKey: .start)
    }
    if container.contains(.expiry) {
        expiry = try container.decode(Date?.self, forKey: .expiry)
    }
    if container.contains(.permission) {
        permission = try container.decode(String?.self, forKey: .permission)
    }
  }

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

extension DataFactory {
  public static func createAccessPolicyProtocol() -> AccessPolicyProtocol {
    return AccessPolicyData()
  }
}


// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import Foundation
internal struct BlobData : BlobProtocol {
    public var name: String?
    public var snapshot: Date?
    public var properties: BlobPropertiesProtocol?
    public var metadata: [String:String]?

    enum CodingKeys: String, CodingKey {
        case name = "Name"
        case snapshot = "Snapshot"
        case properties = "Properties"
        case metadata = "Metadata"
    }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
    if container.contains(.name) {
        name = try container.decode(String.self, forKey: .name)
    }
    if container.contains(.snapshot) {
        snapshot = try container.decode(Date.self, forKey: .snapshot)
    }
    if container.contains(.properties) {
        properties = try container.decode(BlobPropertiesData?.self, forKey: .properties)
    }
    if container.contains(.metadata) {
        metadata = try container.decode([String:String]?.self, forKey: .metadata)
    }
  }

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

extension DataFactory {
  public static func createBlobProtocol() -> BlobProtocol {
    return BlobData()
  }
}


// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import Foundation
internal struct BlobEnumerationResultsData : BlobEnumerationResultsProtocol {
    public var serviceEndpoint: String?
    public var containerName: String?
    public var prefix: String?
    public var marker: String?
    public var maxResults: Int32?
    public var delimiter: String?
    public var blobs: [BlobProtocol?]?
    public var nextMarker: String?

    enum CodingKeys: String, CodingKey {
        case serviceEndpoint = "ServiceEndpoint"
        case containerName = "ContainerName"
        case prefix = "Prefix"
        case marker = "Marker"
        case maxResults = "MaxResults"
        case delimiter = "Delimiter"
        case blobs = "Blobs"
        case nextMarker = "NextMarker"
    }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
    if container.contains(.serviceEndpoint) {
        serviceEndpoint = try container.decode(String?.self, forKey: .serviceEndpoint)
    }
    if container.contains(.containerName) {
        containerName = try container.decode(String?.self, forKey: .containerName)
    }
    if container.contains(.prefix) {
        prefix = try container.decode(String?.self, forKey: .prefix)
    }
    if container.contains(.marker) {
        marker = try container.decode(String?.self, forKey: .marker)
    }
    if container.contains(.maxResults) {
        maxResults = try container.decode(Int32?.self, forKey: .maxResults)
    }
    if container.contains(.delimiter) {
        delimiter = try container.decode(String?.self, forKey: .delimiter)
    }
    if container.contains(.blobs) {
        blobs = try container.decode([BlobData?]?.self, forKey: .blobs)
    }
    if container.contains(.nextMarker) {
        nextMarker = try container.decode(String?.self, forKey: .nextMarker)
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.serviceEndpoint != nil {try container.encode(serviceEndpoint, forKey: .serviceEndpoint)}
    if self.containerName != nil {try container.encode(containerName, forKey: .containerName)}
    if self.prefix != nil {try container.encode(prefix, forKey: .prefix)}
    if self.marker != nil {try container.encode(marker, forKey: .marker)}
    if self.maxResults != nil {try container.encode(maxResults, forKey: .maxResults)}
    if self.delimiter != nil {try container.encode(delimiter, forKey: .delimiter)}
    if self.blobs != nil {try container.encode(blobs as! [BlobData?]?, forKey: .blobs)}
    if self.nextMarker != nil {try container.encode(nextMarker, forKey: .nextMarker)}
  }
}

extension DataFactory {
  public static func createBlobEnumerationResultsProtocol() -> BlobEnumerationResultsProtocol {
    return BlobEnumerationResultsData()
  }
}


// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import Foundation
internal struct BlobPropertiesData : BlobPropertiesProtocol {
    public var lastModified: Date?
    public var etag: String?
    public var contentLength: Int32?
    public var contentType: String?
    public var contentEncoding: String?
    public var contentLanguage: String?
    public var contentMD5: String?
    public var contentDisposition: String?
    public var cacheControl: String?
    public var xMsBlobSequenceNumber: String?
    public var blobType: String?
    public var leaseStatus: LeaseStatusType?
    public var leaseState: LeaseStateType?
    public var leaseDuration: LeaseDurationType?
    public var copyId: String?
    public var copyStatus: CopyStatusType?
    public var copySource: String?
    public var copyProgress: String?
    public var copyCompletionTime: Date?
    public var copyStatusDescription: String?
    public var serverEncrypted: Bool?
    public var incrementalCopy: Bool?

    enum CodingKeys: String, CodingKey {
        case lastModified = "Last-Modified"
        case etag = "Etag"
        case contentLength = "Content-Length"
        case contentType = "Content-Type"
        case contentEncoding = "Content-Encoding"
        case contentLanguage = "Content-Language"
        case contentMD5 = "Content-MD5"
        case contentDisposition = "Content-Disposition"
        case cacheControl = "Cache-Control"
        case xMsBlobSequenceNumber = "x-ms-blob-sequence-number"
        case blobType = "BlobType"
        case leaseStatus = "LeaseStatus"
        case leaseState = "LeaseState"
        case leaseDuration = "LeaseDuration"
        case copyId = "CopyId"
        case copyStatus = "CopyStatus"
        case copySource = "CopySource"
        case copyProgress = "CopyProgress"
        case copyCompletionTime = "CopyCompletionTime"
        case copyStatusDescription = "CopyStatusDescription"
        case serverEncrypted = "ServerEncrypted"
        case incrementalCopy = "IncrementalCopy"
    }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
    if container.contains(.lastModified) {
        lastModified = try container.decode(Date?.self, forKey: .lastModified)
    }
    if container.contains(.etag) {
        etag = try container.decode(String?.self, forKey: .etag)
    }
    if container.contains(.contentLength) {
        contentLength = try container.decode(Int32?.self, forKey: .contentLength)
    }
    if container.contains(.contentType) {
        contentType = try container.decode(String?.self, forKey: .contentType)
    }
    if container.contains(.contentEncoding) {
        contentEncoding = try container.decode(String?.self, forKey: .contentEncoding)
    }
    if container.contains(.contentLanguage) {
        contentLanguage = try container.decode(String?.self, forKey: .contentLanguage)
    }
    if container.contains(.contentMD5) {
        contentMD5 = try container.decode(String?.self, forKey: .contentMD5)
    }
    if container.contains(.contentDisposition) {
        contentDisposition = try container.decode(String?.self, forKey: .contentDisposition)
    }
    if container.contains(.cacheControl) {
        cacheControl = try container.decode(String?.self, forKey: .cacheControl)
    }
    if container.contains(.xMsBlobSequenceNumber) {
        xMsBlobSequenceNumber = try container.decode(String?.self, forKey: .xMsBlobSequenceNumber)
    }
    if container.contains(.blobType) {
        blobType = try container.decode(String?.self, forKey: .blobType)
    }
    if container.contains(.leaseStatus) {
        leaseStatus = try container.decode(LeaseStatusType?.self, forKey: .leaseStatus)
    }
    if container.contains(.leaseState) {
        leaseState = try container.decode(LeaseStateType?.self, forKey: .leaseState)
    }
    if container.contains(.leaseDuration) {
        leaseDuration = try container.decode(LeaseDurationType?.self, forKey: .leaseDuration)
    }
    if container.contains(.copyId) {
        copyId = try container.decode(String?.self, forKey: .copyId)
    }
    if container.contains(.copyStatus) {
        copyStatus = try container.decode(CopyStatusType?.self, forKey: .copyStatus)
    }
    if container.contains(.copySource) {
        copySource = try container.decode(String?.self, forKey: .copySource)
    }
    if container.contains(.copyProgress) {
        copyProgress = try container.decode(String?.self, forKey: .copyProgress)
    }
    if container.contains(.copyCompletionTime) {
        copyCompletionTime = try container.decode(Date?.self, forKey: .copyCompletionTime)
    }
    if container.contains(.copyStatusDescription) {
        copyStatusDescription = try container.decode(String?.self, forKey: .copyStatusDescription)
    }
    if container.contains(.serverEncrypted) {
        serverEncrypted = try container.decode(Bool?.self, forKey: .serverEncrypted)
    }
    if container.contains(.incrementalCopy) {
        incrementalCopy = try container.decode(Bool?.self, forKey: .incrementalCopy)
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.lastModified != nil {try container.encode(lastModified, forKey: .lastModified)}
    if self.etag != nil {try container.encode(etag, forKey: .etag)}
    if self.contentLength != nil {try container.encode(contentLength, forKey: .contentLength)}
    if self.contentType != nil {try container.encode(contentType, forKey: .contentType)}
    if self.contentEncoding != nil {try container.encode(contentEncoding, forKey: .contentEncoding)}
    if self.contentLanguage != nil {try container.encode(contentLanguage, forKey: .contentLanguage)}
    if self.contentMD5 != nil {try container.encode(contentMD5, forKey: .contentMD5)}
    if self.contentDisposition != nil {try container.encode(contentDisposition, forKey: .contentDisposition)}
    if self.cacheControl != nil {try container.encode(cacheControl, forKey: .cacheControl)}
    if self.xMsBlobSequenceNumber != nil {try container.encode(xMsBlobSequenceNumber, forKey: .xMsBlobSequenceNumber)}
    if self.blobType != nil {try container.encode(blobType, forKey: .blobType)}
    if self.leaseStatus != nil {try container.encode(leaseStatus, forKey: .leaseStatus)}
    if self.leaseState != nil {try container.encode(leaseState, forKey: .leaseState)}
    if self.leaseDuration != nil {try container.encode(leaseDuration, forKey: .leaseDuration)}
    if self.copyId != nil {try container.encode(copyId, forKey: .copyId)}
    if self.copyStatus != nil {try container.encode(copyStatus, forKey: .copyStatus)}
    if self.copySource != nil {try container.encode(copySource, forKey: .copySource)}
    if self.copyProgress != nil {try container.encode(copyProgress, forKey: .copyProgress)}
    if self.copyCompletionTime != nil {try container.encode(copyCompletionTime, forKey: .copyCompletionTime)}
    if self.copyStatusDescription != nil {try container.encode(copyStatusDescription, forKey: .copyStatusDescription)}
    if self.serverEncrypted != nil {try container.encode(serverEncrypted, forKey: .serverEncrypted)}
    if self.incrementalCopy != nil {try container.encode(incrementalCopy, forKey: .incrementalCopy)}
  }
}

extension DataFactory {
  public static func createBlobPropertiesProtocol() -> BlobPropertiesProtocol {
    return BlobPropertiesData()
  }
}


// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import Foundation
internal struct BlobsAbortCopyHeadersData : BlobsAbortCopyHeadersProtocol {
    public var requestId: String?
    public var version: String?
    public var date: Date?

    enum CodingKeys: String, CodingKey {
        case requestId = "x-ms-request-id"
        case version = "x-ms-version"
        case date = "Date"
    }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
    if container.contains(.requestId) {
        requestId = try container.decode(String.self, forKey: .requestId)
    }
    if container.contains(.version) {
        version = try container.decode(String.self, forKey: .version)
    }
    if container.contains(.date) {
        date = try container.decode(Date.self, forKey: .date)
    }
  }

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

extension DataFactory {
  public static func createBlobsAbortCopyHeadersProtocol() -> BlobsAbortCopyHeadersProtocol {
    return BlobsAbortCopyHeadersData()
  }
}


// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import Foundation
internal struct BlobsAppendBlockHeadersData : BlobsAppendBlockHeadersProtocol {
    public var eTag: String?
    public var lastModified: String?
    public var contentMD5: String?
    public var requestId: String?
    public var version: String?
    public var date: Date?
    public var blobAppendOffset: String?
    public var blobCommittedBlockCount: String?

    enum CodingKeys: String, CodingKey {
        case eTag = "ETag"
        case lastModified = "Last-Modified"
        case contentMD5 = "Content-MD5"
        case requestId = "x-ms-request-id"
        case version = "x-ms-version"
        case date = "Date"
        case blobAppendOffset = "x-ms-blob-append-offset"
        case blobCommittedBlockCount = "x-ms-blob-committed-block-count"
    }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
    if container.contains(.eTag) {
        eTag = try container.decode(String.self, forKey: .eTag)
    }
    if container.contains(.lastModified) {
        lastModified = try container.decode(String.self, forKey: .lastModified)
    }
    if container.contains(.contentMD5) {
        contentMD5 = try container.decode(String.self, forKey: .contentMD5)
    }
    if container.contains(.requestId) {
        requestId = try container.decode(String.self, forKey: .requestId)
    }
    if container.contains(.version) {
        version = try container.decode(String.self, forKey: .version)
    }
    if container.contains(.date) {
        date = try container.decode(Date.self, forKey: .date)
    }
    if container.contains(.blobAppendOffset) {
        blobAppendOffset = try container.decode(String.self, forKey: .blobAppendOffset)
    }
    if container.contains(.blobCommittedBlockCount) {
        blobCommittedBlockCount = try container.decode(String.self, forKey: .blobCommittedBlockCount)
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.eTag != nil {try container.encode(eTag, forKey: .eTag)}
    if self.lastModified != nil {try container.encode(lastModified, forKey: .lastModified)}
    if self.contentMD5 != nil {try container.encode(contentMD5, forKey: .contentMD5)}
    if self.requestId != nil {try container.encode(requestId, forKey: .requestId)}
    if self.version != nil {try container.encode(version, forKey: .version)}
    if self.date != nil {try container.encode(date, forKey: .date)}
    if self.blobAppendOffset != nil {try container.encode(blobAppendOffset, forKey: .blobAppendOffset)}
    if self.blobCommittedBlockCount != nil {try container.encode(blobCommittedBlockCount, forKey: .blobCommittedBlockCount)}
  }
}

extension DataFactory {
  public static func createBlobsAppendBlockHeadersProtocol() -> BlobsAppendBlockHeadersProtocol {
    return BlobsAppendBlockHeadersData()
  }
}


// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import Foundation
internal struct BlobsCopyHeadersData : BlobsCopyHeadersProtocol {
    public var eTag: String?
    public var lastModified: String?
    public var requestId: String?
    public var version: String?
    public var date: Date?
    public var copyId: String?
    public var copyStatus: CopyStatusType?

    enum CodingKeys: String, CodingKey {
        case eTag = "ETag"
        case lastModified = "Last-Modified"
        case requestId = "x-ms-request-id"
        case version = "x-ms-version"
        case date = "Date"
        case copyId = "x-ms-copy-id"
        case copyStatus = "x-ms-copy-status"
    }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
    if container.contains(.eTag) {
        eTag = try container.decode(String.self, forKey: .eTag)
    }
    if container.contains(.lastModified) {
        lastModified = try container.decode(String.self, forKey: .lastModified)
    }
    if container.contains(.requestId) {
        requestId = try container.decode(String.self, forKey: .requestId)
    }
    if container.contains(.version) {
        version = try container.decode(String.self, forKey: .version)
    }
    if container.contains(.date) {
        date = try container.decode(Date.self, forKey: .date)
    }
    if container.contains(.copyId) {
        copyId = try container.decode(String.self, forKey: .copyId)
    }
    if container.contains(.copyStatus) {
        copyStatus = try container.decode(CopyStatusType?.self, forKey: .copyStatus)
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.eTag != nil {try container.encode(eTag, forKey: .eTag)}
    if self.lastModified != nil {try container.encode(lastModified, forKey: .lastModified)}
    if self.requestId != nil {try container.encode(requestId, forKey: .requestId)}
    if self.version != nil {try container.encode(version, forKey: .version)}
    if self.date != nil {try container.encode(date, forKey: .date)}
    if self.copyId != nil {try container.encode(copyId, forKey: .copyId)}
    if self.copyStatus != nil {try container.encode(copyStatus, forKey: .copyStatus)}
  }
}

extension DataFactory {
  public static func createBlobsCopyHeadersProtocol() -> BlobsCopyHeadersProtocol {
    return BlobsCopyHeadersData()
  }
}


// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import Foundation
internal struct BlobsDeleteHeadersData : BlobsDeleteHeadersProtocol {
    public var requestId: String?
    public var version: String?
    public var date: Date?

    enum CodingKeys: String, CodingKey {
        case requestId = "x-ms-request-id"
        case version = "x-ms-version"
        case date = "Date"
    }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
    if container.contains(.requestId) {
        requestId = try container.decode(String.self, forKey: .requestId)
    }
    if container.contains(.version) {
        version = try container.decode(String.self, forKey: .version)
    }
    if container.contains(.date) {
        date = try container.decode(Date.self, forKey: .date)
    }
  }

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

extension DataFactory {
  public static func createBlobsDeleteHeadersProtocol() -> BlobsDeleteHeadersProtocol {
    return BlobsDeleteHeadersData()
  }
}