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

com.azure.resourcemanager.securityinsights.implementation.AlertRuleTemplatesImpl 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-2021-09.

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.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.AlertRuleTemplatesClient;
import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner;
import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplate;
import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplates;

public final class AlertRuleTemplatesImpl implements AlertRuleTemplates {
    private static final ClientLogger LOGGER = new ClientLogger(AlertRuleTemplatesImpl.class);

    private final AlertRuleTemplatesClient innerClient;

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

    public AlertRuleTemplatesImpl(AlertRuleTemplatesClient 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 AlertRuleTemplateImpl(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 AlertRuleTemplateImpl(inner1, this.manager()));
    }

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

    public AlertRuleTemplate get(String resourceGroupName, String workspaceName, String alertRuleTemplateId) {
        AlertRuleTemplateInner inner = this.serviceClient().get(resourceGroupName, workspaceName, alertRuleTemplateId);
        if (inner != null) {
            return new AlertRuleTemplateImpl(inner, this.manager());
        } else {
            return null;
        }
    }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy