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

com.azure.resourcemanager.securityinsights.implementation.ThreatIntelligenceIndicatorsImpl 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.ThreatIntelligenceIndicatorsClient;
import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceInformationInner;
import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAppendTags;
import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceFilteringCriteria;
import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModel;
import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicators;
import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceInformation;

public final class ThreatIntelligenceIndicatorsImpl implements ThreatIntelligenceIndicators {
    private static final ClientLogger LOGGER = new ClientLogger(ThreatIntelligenceIndicatorsImpl.class);

    private final ThreatIntelligenceIndicatorsClient innerClient;

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

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

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

    public ThreatIntelligenceInformation createIndicator(String resourceGroupName, String workspaceName,
        ThreatIntelligenceIndicatorModel threatIntelligenceProperties) {
        ThreatIntelligenceInformationInner inner
            = this.serviceClient().createIndicator(resourceGroupName, workspaceName, threatIntelligenceProperties);
        if (inner != null) {
            return new ThreatIntelligenceInformationImpl(inner, this.manager());
        } else {
            return null;
        }
    }

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

    public ThreatIntelligenceInformation get(String resourceGroupName, String workspaceName, String name) {
        ThreatIntelligenceInformationInner inner = this.serviceClient().get(resourceGroupName, workspaceName, name);
        if (inner != null) {
            return new ThreatIntelligenceInformationImpl(inner, this.manager());
        } else {
            return null;
        }
    }

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

    public ThreatIntelligenceInformation create(String resourceGroupName, String workspaceName, String name,
        ThreatIntelligenceIndicatorModel threatIntelligenceProperties) {
        ThreatIntelligenceInformationInner inner
            = this.serviceClient().create(resourceGroupName, workspaceName, name, threatIntelligenceProperties);
        if (inner != null) {
            return new ThreatIntelligenceInformationImpl(inner, this.manager());
        } else {
            return null;
        }
    }

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

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

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

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

    public Response appendTagsWithResponse(String resourceGroupName, String workspaceName, String name,
        ThreatIntelligenceAppendTags threatIntelligenceAppendTags, Context context) {
        return this.serviceClient()
            .appendTagsWithResponse(resourceGroupName, workspaceName, name, threatIntelligenceAppendTags, context);
    }

    public void appendTags(String resourceGroupName, String workspaceName, String name,
        ThreatIntelligenceAppendTags threatIntelligenceAppendTags) {
        this.serviceClient().appendTags(resourceGroupName, workspaceName, name, threatIntelligenceAppendTags);
    }

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

    public ThreatIntelligenceInformation replaceTags(String resourceGroupName, String workspaceName, String name,
        ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags) {
        ThreatIntelligenceInformationInner inner
            = this.serviceClient().replaceTags(resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags);
        if (inner != null) {
            return new ThreatIntelligenceInformationImpl(inner, this.manager());
        } else {
            return null;
        }
    }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy