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

package com.azure.resourcemanager.workloads.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.workloads.fluent.ResourceProvidersClient;
import com.azure.resourcemanager.workloads.fluent.models.SapAvailabilityZoneDetailsResultInner;
import com.azure.resourcemanager.workloads.fluent.models.SapDiskConfigurationsResultInner;
import com.azure.resourcemanager.workloads.fluent.models.SapSizingRecommendationResultInner;
import com.azure.resourcemanager.workloads.fluent.models.SapSupportedResourceSkusResultInner;
import com.azure.resourcemanager.workloads.models.ResourceProviders;
import com.azure.resourcemanager.workloads.models.SapAvailabilityZoneDetailsRequest;
import com.azure.resourcemanager.workloads.models.SapAvailabilityZoneDetailsResult;
import com.azure.resourcemanager.workloads.models.SapDiskConfigurationsRequest;
import com.azure.resourcemanager.workloads.models.SapDiskConfigurationsResult;
import com.azure.resourcemanager.workloads.models.SapSizingRecommendationRequest;
import com.azure.resourcemanager.workloads.models.SapSizingRecommendationResult;
import com.azure.resourcemanager.workloads.models.SapSupportedResourceSkusResult;
import com.azure.resourcemanager.workloads.models.SapSupportedSkusRequest;

public final class ResourceProvidersImpl implements ResourceProviders {
    private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class);

    private final ResourceProvidersClient innerClient;

    private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager;

    public ResourceProvidersImpl(
        ResourceProvidersClient innerClient, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public Response<SapSizingRecommendationResult> sapSizingRecommendationsWithResponse(
        String location, SapSizingRecommendationRequest sapSizingRecommendation, Context context) {
        Response<SapSizingRecommendationResultInner> inner =
            this.serviceClient().sapSizingRecommendationsWithResponse(location, sapSizingRecommendation, context);
        if (inner != null) {
            return new SimpleResponse<>(
                inner.getRequest(),
                inner.getStatusCode(),
                inner.getHeaders(),
                new SapSizingRecommendationResultImpl(inner.getValue(), this.manager()));
        } else {
            return null;
        }
    }

    public SapSizingRecommendationResult sapSizingRecommendations(String location) {
        SapSizingRecommendationResultInner inner = this.serviceClient().sapSizingRecommendations(location);
        if (inner != null) {
            return new SapSizingRecommendationResultImpl(inner, this.manager());
        } else {
            return null;
        }
    }

    public Response<SapSupportedResourceSkusResult> sapSupportedSkuWithResponse(
        String location, SapSupportedSkusRequest sapSupportedSku, Context context) {
        Response<SapSupportedResourceSkusResultInner> inner =
            this.serviceClient().sapSupportedSkuWithResponse(location, sapSupportedSku, context);
        if (inner != null) {
            return new SimpleResponse<>(
                inner.getRequest(),
                inner.getStatusCode(),
                inner.getHeaders(),
                new SapSupportedResourceSkusResultImpl(inner.getValue(), this.manager()));
        } else {
            return null;
        }
    }

    public SapSupportedResourceSkusResult sapSupportedSku(String location) {
        SapSupportedResourceSkusResultInner inner = this.serviceClient().sapSupportedSku(location);
        if (inner != null) {
            return new SapSupportedResourceSkusResultImpl(inner, this.manager());
        } else {
            return null;
        }
    }

    public Response<SapDiskConfigurationsResult> sapDiskConfigurationsWithResponse(
        String location, SapDiskConfigurationsRequest sapDiskConfigurations, Context context) {
        Response<SapDiskConfigurationsResultInner> inner =
            this.serviceClient().sapDiskConfigurationsWithResponse(location, sapDiskConfigurations, context);
        if (inner != null) {
            return new SimpleResponse<>(
                inner.getRequest(),
                inner.getStatusCode(),
                inner.getHeaders(),
                new SapDiskConfigurationsResultImpl(inner.getValue(), this.manager()));
        } else {
            return null;
        }
    }

    public SapDiskConfigurationsResult sapDiskConfigurations(String location) {
        SapDiskConfigurationsResultInner inner = this.serviceClient().sapDiskConfigurations(location);
        if (inner != null) {
            return new SapDiskConfigurationsResultImpl(inner, this.manager());
        } else {
            return null;
        }
    }

    public Response<SapAvailabilityZoneDetailsResult> sapAvailabilityZoneDetailsWithResponse(
        String location, SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails, Context context) {
        Response<SapAvailabilityZoneDetailsResultInner> inner =
            this.serviceClient().sapAvailabilityZoneDetailsWithResponse(location, sapAvailabilityZoneDetails, context);
        if (inner != null) {
            return new SimpleResponse<>(
                inner.getRequest(),
                inner.getStatusCode(),
                inner.getHeaders(),
                new SapAvailabilityZoneDetailsResultImpl(inner.getValue(), this.manager()));
        } else {
            return null;
        }
    }

    public SapAvailabilityZoneDetailsResult sapAvailabilityZoneDetails(String location) {
        SapAvailabilityZoneDetailsResultInner inner = this.serviceClient().sapAvailabilityZoneDetails(location);
        if (inner != null) {
            return new SapAvailabilityZoneDetailsResultImpl(inner, this.manager());
        } else {
            return null;
        }
    }

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

    private com.azure.resourcemanager.workloads.WorkloadsManager manager() {
        return this.serviceManager;
    }
}
