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

com.azure.resourcemanager.security.implementation.AlertsImpl Maven / Gradle / Ivy

Go to download

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

There is a newer version: 1.0.0
Show 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.security.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.security.fluent.AlertsClient;
import com.azure.resourcemanager.security.fluent.models.AlertInner;
import com.azure.resourcemanager.security.models.Alert;
import com.azure.resourcemanager.security.models.AlertSimulatorRequestBody;
import com.azure.resourcemanager.security.models.Alerts;

public final class AlertsImpl implements Alerts {
    private static final ClientLogger LOGGER = new ClientLogger(AlertsImpl.class);

    private final AlertsClient innerClient;

    private final com.azure.resourcemanager.security.SecurityManager serviceManager;

    public AlertsImpl(AlertsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

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

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

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

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

    public PagedIterable listSubscriptionLevelByRegion(String ascLocation) {
        PagedIterable inner = this.serviceClient().listSubscriptionLevelByRegion(ascLocation);
        return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager()));
    }

    public PagedIterable listSubscriptionLevelByRegion(String ascLocation, Context context) {
        PagedIterable inner = this.serviceClient().listSubscriptionLevelByRegion(ascLocation, context);
        return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager()));
    }

    public PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName) {
        PagedIterable inner
            = this.serviceClient().listResourceGroupLevelByRegion(ascLocation, resourceGroupName);
        return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager()));
    }

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

    public Response getSubscriptionLevelWithResponse(String ascLocation, String alertName, Context context) {
        Response inner
            = this.serviceClient().getSubscriptionLevelWithResponse(ascLocation, alertName, context);
        if (inner != null) {
            return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
                new AlertImpl(inner.getValue(), this.manager()));
        } else {
            return null;
        }
    }

    public Alert getSubscriptionLevel(String ascLocation, String alertName) {
        AlertInner inner = this.serviceClient().getSubscriptionLevel(ascLocation, alertName);
        if (inner != null) {
            return new AlertImpl(inner, this.manager());
        } else {
            return null;
        }
    }

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

    public Alert getResourceGroupLevel(String resourceGroupName, String ascLocation, String alertName) {
        AlertInner inner = this.serviceClient().getResourceGroupLevel(resourceGroupName, ascLocation, alertName);
        if (inner != null) {
            return new AlertImpl(inner, this.manager());
        } else {
            return null;
        }
    }

    public Response updateSubscriptionLevelStateToDismissWithResponse(String ascLocation, String alertName,
        Context context) {
        return this.serviceClient().updateSubscriptionLevelStateToDismissWithResponse(ascLocation, alertName, context);
    }

    public void updateSubscriptionLevelStateToDismiss(String ascLocation, String alertName) {
        this.serviceClient().updateSubscriptionLevelStateToDismiss(ascLocation, alertName);
    }

    public Response updateSubscriptionLevelStateToResolveWithResponse(String ascLocation, String alertName,
        Context context) {
        return this.serviceClient().updateSubscriptionLevelStateToResolveWithResponse(ascLocation, alertName, context);
    }

    public void updateSubscriptionLevelStateToResolve(String ascLocation, String alertName) {
        this.serviceClient().updateSubscriptionLevelStateToResolve(ascLocation, alertName);
    }

    public Response updateSubscriptionLevelStateToActivateWithResponse(String ascLocation, String alertName,
        Context context) {
        return this.serviceClient().updateSubscriptionLevelStateToActivateWithResponse(ascLocation, alertName, context);
    }

    public void updateSubscriptionLevelStateToActivate(String ascLocation, String alertName) {
        this.serviceClient().updateSubscriptionLevelStateToActivate(ascLocation, alertName);
    }

    public Response updateSubscriptionLevelStateToInProgressWithResponse(String ascLocation, String alertName,
        Context context) {
        return this.serviceClient()
            .updateSubscriptionLevelStateToInProgressWithResponse(ascLocation, alertName, context);
    }

    public void updateSubscriptionLevelStateToInProgress(String ascLocation, String alertName) {
        this.serviceClient().updateSubscriptionLevelStateToInProgress(ascLocation, alertName);
    }

    public Response updateResourceGroupLevelStateToResolveWithResponse(String resourceGroupName,
        String ascLocation, String alertName, Context context) {
        return this.serviceClient()
            .updateResourceGroupLevelStateToResolveWithResponse(resourceGroupName, ascLocation, alertName, context);
    }

    public void updateResourceGroupLevelStateToResolve(String resourceGroupName, String ascLocation, String alertName) {
        this.serviceClient().updateResourceGroupLevelStateToResolve(resourceGroupName, ascLocation, alertName);
    }

    public Response updateResourceGroupLevelStateToDismissWithResponse(String resourceGroupName,
        String ascLocation, String alertName, Context context) {
        return this.serviceClient()
            .updateResourceGroupLevelStateToDismissWithResponse(resourceGroupName, ascLocation, alertName, context);
    }

    public void updateResourceGroupLevelStateToDismiss(String resourceGroupName, String ascLocation, String alertName) {
        this.serviceClient().updateResourceGroupLevelStateToDismiss(resourceGroupName, ascLocation, alertName);
    }

    public Response updateResourceGroupLevelStateToActivateWithResponse(String resourceGroupName,
        String ascLocation, String alertName, Context context) {
        return this.serviceClient()
            .updateResourceGroupLevelStateToActivateWithResponse(resourceGroupName, ascLocation, alertName, context);
    }

    public void updateResourceGroupLevelStateToActivate(String resourceGroupName, String ascLocation,
        String alertName) {
        this.serviceClient().updateResourceGroupLevelStateToActivate(resourceGroupName, ascLocation, alertName);
    }

    public Response updateResourceGroupLevelStateToInProgressWithResponse(String resourceGroupName,
        String ascLocation, String alertName, Context context) {
        return this.serviceClient()
            .updateResourceGroupLevelStateToInProgressWithResponse(resourceGroupName, ascLocation, alertName, context);
    }

    public void updateResourceGroupLevelStateToInProgress(String resourceGroupName, String ascLocation,
        String alertName) {
        this.serviceClient().updateResourceGroupLevelStateToInProgress(resourceGroupName, ascLocation, alertName);
    }

    public void simulate(String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody) {
        this.serviceClient().simulate(ascLocation, alertSimulatorRequestBody);
    }

    public void simulate(String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody, Context context) {
        this.serviceClient().simulate(ascLocation, alertSimulatorRequestBody, context);
    }

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

    private com.azure.resourcemanager.security.SecurityManager manager() {
        return this.serviceManager;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy