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

package com.azure.resourcemanager.resourcemover.implementation;

import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.SimpleResponse;
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.resourcemover.fluent.OperationsDiscoveriesClient;
import com.azure.resourcemanager.resourcemover.fluent.models.OperationsDiscoveryCollectionInner;
import com.azure.resourcemanager.resourcemover.models.OperationsDiscoveries;
import com.azure.resourcemanager.resourcemover.models.OperationsDiscoveryCollection;

public final class OperationsDiscoveriesImpl implements OperationsDiscoveries {
    private static final ClientLogger LOGGER = new ClientLogger(OperationsDiscoveriesImpl.class);

    private final OperationsDiscoveriesClient innerClient;

    private final com.azure.resourcemanager.resourcemover.ResourceMoverManager serviceManager;

    public OperationsDiscoveriesImpl(
        OperationsDiscoveriesClient innerClient,
        com.azure.resourcemanager.resourcemover.ResourceMoverManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public Response<OperationsDiscoveryCollection> getWithResponse(Context context) {
        Response<OperationsDiscoveryCollectionInner> inner = this.serviceClient().getWithResponse(context);
        if (inner != null) {
            return new SimpleResponse<>(
                inner.getRequest(),
                inner.getStatusCode(),
                inner.getHeaders(),
                new OperationsDiscoveryCollectionImpl(inner.getValue(), this.manager()));
        } else {
            return null;
        }
    }

    public OperationsDiscoveryCollection get() {
        OperationsDiscoveryCollectionInner inner = this.serviceClient().get();
        if (inner != null) {
            return new OperationsDiscoveryCollectionImpl(inner, this.manager());
        } else {
            return null;
        }
    }

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

    private com.azure.resourcemanager.resourcemover.ResourceMoverManager manager() {
        return this.serviceManager;
    }
}
