// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.storageimportexport.implementation;

import com.azure.core.http.rest.PagedIterable;
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.storageimportexport.fluent.BitLockerKeysClient;
import com.azure.resourcemanager.storageimportexport.fluent.models.DriveBitLockerKeyInner;
import com.azure.resourcemanager.storageimportexport.models.BitLockerKeys;
import com.azure.resourcemanager.storageimportexport.models.DriveBitLockerKey;

public final class BitLockerKeysImpl implements BitLockerKeys {
    private static final ClientLogger LOGGER = new ClientLogger(BitLockerKeysImpl.class);

    private final BitLockerKeysClient innerClient;

    private final com.azure.resourcemanager.storageimportexport.StorageImportExportManager serviceManager;

    public BitLockerKeysImpl(
        BitLockerKeysClient innerClient,
        com.azure.resourcemanager.storageimportexport.StorageImportExportManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public PagedIterable<DriveBitLockerKey> list(String jobName, String resourceGroupName) {
        PagedIterable<DriveBitLockerKeyInner> inner = this.serviceClient().list(jobName, resourceGroupName);
        return Utils.mapPage(inner, inner1 -> new DriveBitLockerKeyImpl(inner1, this.manager()));
    }

    public PagedIterable<DriveBitLockerKey> list(String jobName, String resourceGroupName, Context context) {
        PagedIterable<DriveBitLockerKeyInner> inner = this.serviceClient().list(jobName, resourceGroupName, context);
        return Utils.mapPage(inner, inner1 -> new DriveBitLockerKeyImpl(inner1, this.manager()));
    }

    private BitLockerKeysClient serviceClient() {
        return this.innerClient;
    }

    private com.azure.resourcemanager.storageimportexport.StorageImportExportManager manager() {
        return this.serviceManager;
    }
}
