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

com.azure.resourcemanager.securityinsights.implementation.DataConnectorsImpl Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for SecurityInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2022-09.

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

package com.azure.resourcemanager.securityinsights.implementation;

import com.azure.core.http.rest.PagedIterable;
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.securityinsights.fluent.DataConnectorsClient;
import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner;
import com.azure.resourcemanager.securityinsights.models.DataConnector;
import com.azure.resourcemanager.securityinsights.models.DataConnectorConnectBody;
import com.azure.resourcemanager.securityinsights.models.DataConnectors;

public final class DataConnectorsImpl implements DataConnectors {
    private static final ClientLogger LOGGER = new ClientLogger(DataConnectorsImpl.class);

    private final DataConnectorsClient innerClient;

    private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager;

    public DataConnectorsImpl(DataConnectorsClient innerClient,
        com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public PagedIterable list(String resourceGroupName, String workspaceName) {
        PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName);
        return ResourceManagerUtils.mapPage(inner, inner1 -> new DataConnectorImpl(inner1, this.manager()));
    }

    public PagedIterable list(String resourceGroupName, String workspaceName, Context context) {
        PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, context);
        return ResourceManagerUtils.mapPage(inner, inner1 -> new DataConnectorImpl(inner1, this.manager()));
    }

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

    public DataConnector get(String resourceGroupName, String workspaceName, String dataConnectorId) {
        DataConnectorInner inner = this.serviceClient().get(resourceGroupName, workspaceName, dataConnectorId);
        if (inner != null) {
            return new DataConnectorImpl(inner, this.manager());
        } else {
            return null;
        }
    }

    public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName,
        String dataConnectorId, DataConnectorInner dataConnector, Context context) {
        Response inner = this.serviceClient()
            .createOrUpdateWithResponse(resourceGroupName, workspaceName, dataConnectorId, dataConnector, context);
        if (inner != null) {
            return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
                new DataConnectorImpl(inner.getValue(), this.manager()));
        } else {
            return null;
        }
    }

    public DataConnector createOrUpdate(String resourceGroupName, String workspaceName, String dataConnectorId,
        DataConnectorInner dataConnector) {
        DataConnectorInner inner
            = this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, dataConnectorId, dataConnector);
        if (inner != null) {
            return new DataConnectorImpl(inner, this.manager());
        } else {
            return null;
        }
    }

    public Response deleteWithResponse(String resourceGroupName, String workspaceName, String dataConnectorId,
        Context context) {
        return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, dataConnectorId, context);
    }

    public void delete(String resourceGroupName, String workspaceName, String dataConnectorId) {
        this.serviceClient().delete(resourceGroupName, workspaceName, dataConnectorId);
    }

    public Response connectWithResponse(String resourceGroupName, String workspaceName, String dataConnectorId,
        DataConnectorConnectBody connectBody, Context context) {
        return this.serviceClient()
            .connectWithResponse(resourceGroupName, workspaceName, dataConnectorId, connectBody, context);
    }

    public void connect(String resourceGroupName, String workspaceName, String dataConnectorId,
        DataConnectorConnectBody connectBody) {
        this.serviceClient().connect(resourceGroupName, workspaceName, dataConnectorId, connectBody);
    }

    public Response disconnectWithResponse(String resourceGroupName, String workspaceName, String dataConnectorId,
        Context context) {
        return this.serviceClient().disconnectWithResponse(resourceGroupName, workspaceName, dataConnectorId, context);
    }

    public void disconnect(String resourceGroupName, String workspaceName, String dataConnectorId) {
        this.serviceClient().disconnect(resourceGroupName, workspaceName, dataConnectorId);
    }

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

    private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() {
        return this.serviceManager;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy