All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.elastic.implementation.VMIngestionsImpl Maven / Gradle / Ivy

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

package com.azure.resourcemanager.elastic.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.elastic.fluent.VMIngestionsClient;
import com.azure.resourcemanager.elastic.fluent.models.VMIngestionDetailsResponseInner;
import com.azure.resourcemanager.elastic.models.VMIngestionDetailsResponse;
import com.azure.resourcemanager.elastic.models.VMIngestions;

public final class VMIngestionsImpl implements VMIngestions {
    private static final ClientLogger LOGGER = new ClientLogger(VMIngestionsImpl.class);

    private final VMIngestionsClient innerClient;

    private final com.azure.resourcemanager.elastic.ElasticManager serviceManager;

    public VMIngestionsImpl(
        VMIngestionsClient innerClient, com.azure.resourcemanager.elastic.ElasticManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public Response detailsWithResponse(
        String resourceGroupName, String monitorName, Context context) {
        Response inner =
            this.serviceClient().detailsWithResponse(resourceGroupName, monitorName, context);
        if (inner != null) {
            return new SimpleResponse<>(
                inner.getRequest(),
                inner.getStatusCode(),
                inner.getHeaders(),
                new VMIngestionDetailsResponseImpl(inner.getValue(), this.manager()));
        } else {
            return null;
        }
    }

    public VMIngestionDetailsResponse details(String resourceGroupName, String monitorName) {
        VMIngestionDetailsResponseInner inner = this.serviceClient().details(resourceGroupName, monitorName);
        if (inner != null) {
            return new VMIngestionDetailsResponseImpl(inner, this.manager());
        } else {
            return null;
        }
    }

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

    private com.azure.resourcemanager.elastic.ElasticManager manager() {
        return this.serviceManager;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy