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

com.azure.resourcemanager.security.implementation.StandardAssignmentImpl 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.util.Context;
import com.azure.resourcemanager.security.fluent.models.StandardAssignmentInner;
import com.azure.resourcemanager.security.models.AssignedStandardItem;
import com.azure.resourcemanager.security.models.Effect;
import com.azure.resourcemanager.security.models.StandardAssignment;
import com.azure.resourcemanager.security.models.StandardAssignmentMetadata;
import com.azure.resourcemanager.security.models.StandardAssignmentPropertiesAttestationData;
import com.azure.resourcemanager.security.models.StandardAssignmentPropertiesExemptionData;
import java.time.OffsetDateTime;
import java.util.Collections;
import java.util.List;

public final class StandardAssignmentImpl implements StandardAssignment, StandardAssignment.Definition {
    private StandardAssignmentInner innerObject;

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

    StandardAssignmentImpl(StandardAssignmentInner innerObject,
        com.azure.resourcemanager.security.SecurityManager serviceManager) {
        this.innerObject = innerObject;
        this.serviceManager = serviceManager;
    }

    public String id() {
        return this.innerModel().id();
    }

    public String name() {
        return this.innerModel().name();
    }

    public String type() {
        return this.innerModel().type();
    }

    public String displayName() {
        return this.innerModel().displayName();
    }

    public String description() {
        return this.innerModel().description();
    }

    public AssignedStandardItem assignedStandard() {
        return this.innerModel().assignedStandard();
    }

    public Effect effect() {
        return this.innerModel().effect();
    }

    public List excludedScopes() {
        List inner = this.innerModel().excludedScopes();
        if (inner != null) {
            return Collections.unmodifiableList(inner);
        } else {
            return Collections.emptyList();
        }
    }

    public OffsetDateTime expiresOn() {
        return this.innerModel().expiresOn();
    }

    public StandardAssignmentPropertiesExemptionData exemptionData() {
        return this.innerModel().exemptionData();
    }

    public StandardAssignmentPropertiesAttestationData attestationData() {
        return this.innerModel().attestationData();
    }

    public StandardAssignmentMetadata metadata() {
        return this.innerModel().metadata();
    }

    public StandardAssignmentInner innerModel() {
        return this.innerObject;
    }

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

    private String resourceId;

    private String standardAssignmentName;

    public StandardAssignmentImpl withExistingResourceId(String resourceId) {
        this.resourceId = resourceId;
        return this;
    }

    public StandardAssignment create() {
        this.innerObject = serviceManager.serviceClient()
            .getStandardAssignments()
            .createWithResponse(resourceId, standardAssignmentName, this.innerModel(), Context.NONE)
            .getValue();
        return this;
    }

    public StandardAssignment create(Context context) {
        this.innerObject = serviceManager.serviceClient()
            .getStandardAssignments()
            .createWithResponse(resourceId, standardAssignmentName, this.innerModel(), context)
            .getValue();
        return this;
    }

    StandardAssignmentImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) {
        this.innerObject = new StandardAssignmentInner();
        this.serviceManager = serviceManager;
        this.standardAssignmentName = name;
    }

    public StandardAssignment refresh() {
        this.innerObject = serviceManager.serviceClient()
            .getStandardAssignments()
            .getWithResponse(resourceId, standardAssignmentName, Context.NONE)
            .getValue();
        return this;
    }

    public StandardAssignment refresh(Context context) {
        this.innerObject = serviceManager.serviceClient()
            .getStandardAssignments()
            .getWithResponse(resourceId, standardAssignmentName, context)
            .getValue();
        return this;
    }

    public StandardAssignmentImpl withDisplayName(String displayName) {
        this.innerModel().withDisplayName(displayName);
        return this;
    }

    public StandardAssignmentImpl withDescription(String description) {
        this.innerModel().withDescription(description);
        return this;
    }

    public StandardAssignmentImpl withAssignedStandard(AssignedStandardItem assignedStandard) {
        this.innerModel().withAssignedStandard(assignedStandard);
        return this;
    }

    public StandardAssignmentImpl withEffect(Effect effect) {
        this.innerModel().withEffect(effect);
        return this;
    }

    public StandardAssignmentImpl withExcludedScopes(List excludedScopes) {
        this.innerModel().withExcludedScopes(excludedScopes);
        return this;
    }

    public StandardAssignmentImpl withExpiresOn(OffsetDateTime expiresOn) {
        this.innerModel().withExpiresOn(expiresOn);
        return this;
    }

    public StandardAssignmentImpl withExemptionData(StandardAssignmentPropertiesExemptionData exemptionData) {
        this.innerModel().withExemptionData(exemptionData);
        return this;
    }

    public StandardAssignmentImpl withAttestationData(StandardAssignmentPropertiesAttestationData attestationData) {
        this.innerModel().withAttestationData(attestationData);
        return this;
    }

    public StandardAssignmentImpl withMetadata(StandardAssignmentMetadata metadata) {
        this.innerModel().withMetadata(metadata);
        return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy