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

package com.azure.resourcemanager.orbital.implementation;

import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.orbital.fluent.OperationsResultsClient;
import com.azure.resourcemanager.orbital.fluent.models.OperationResultInner;
import com.azure.resourcemanager.orbital.models.OperationResult;
import com.azure.resourcemanager.orbital.models.OperationsResults;

public final class OperationsResultsImpl implements OperationsResults {
    private static final ClientLogger LOGGER = new ClientLogger(OperationsResultsImpl.class);

    private final OperationsResultsClient innerClient;

    private final com.azure.resourcemanager.orbital.OrbitalManager serviceManager;

    public OperationsResultsImpl(
        OperationsResultsClient innerClient, com.azure.resourcemanager.orbital.OrbitalManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public OperationResult get(String location, String operationId) {
        OperationResultInner inner = this.serviceClient().get(location, operationId);
        if (inner != null) {
            return new OperationResultImpl(inner, this.manager());
        } else {
            return null;
        }
    }

    public OperationResult get(String location, String operationId, Context context) {
        OperationResultInner inner = this.serviceClient().get(location, operationId, context);
        if (inner != null) {
            return new OperationResultImpl(inner, this.manager());
        } else {
            return null;
        }
    }

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

    private com.azure.resourcemanager.orbital.OrbitalManager manager() {
        return this.serviceManager;
    }
}
