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

package com.azure.resourcemanager.mysqlflexibleserver.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.mysqlflexibleserver.fluent.GetPrivateDnsZoneSuffixesClient;
import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.GetPrivateDnsZoneSuffixResponseInner;
import com.azure.resourcemanager.mysqlflexibleserver.models.GetPrivateDnsZoneSuffixResponse;
import com.azure.resourcemanager.mysqlflexibleserver.models.GetPrivateDnsZoneSuffixes;

public final class GetPrivateDnsZoneSuffixesImpl implements GetPrivateDnsZoneSuffixes {
    private static final ClientLogger LOGGER = new ClientLogger(GetPrivateDnsZoneSuffixesImpl.class);

    private final GetPrivateDnsZoneSuffixesClient innerClient;

    private final com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager;

    public GetPrivateDnsZoneSuffixesImpl(
        GetPrivateDnsZoneSuffixesClient innerClient,
        com.azure.resourcemanager.mysqlflexibleserver.MySqlManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public Response<GetPrivateDnsZoneSuffixResponse> executeWithResponse(Context context) {
        Response<GetPrivateDnsZoneSuffixResponseInner> inner = this.serviceClient().executeWithResponse(context);
        if (inner != null) {
            return new SimpleResponse<>(
                inner.getRequest(),
                inner.getStatusCode(),
                inner.getHeaders(),
                new GetPrivateDnsZoneSuffixResponseImpl(inner.getValue(), this.manager()));
        } else {
            return null;
        }
    }

    public GetPrivateDnsZoneSuffixResponse execute() {
        GetPrivateDnsZoneSuffixResponseInner inner = this.serviceClient().execute();
        if (inner != null) {
            return new GetPrivateDnsZoneSuffixResponseImpl(inner, this.manager());
        } else {
            return null;
        }
    }

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

    private com.azure.resourcemanager.mysqlflexibleserver.MySqlManager manager() {
        return this.serviceManager;
    }
}
