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

com.azure.resourcemanager.security.implementation.AzureDevOpsProjectImpl 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.management.SystemData;
import com.azure.core.util.Context;
import com.azure.resourcemanager.security.fluent.models.AzureDevOpsProjectInner;
import com.azure.resourcemanager.security.models.AzureDevOpsProject;
import com.azure.resourcemanager.security.models.AzureDevOpsProjectProperties;

public final class AzureDevOpsProjectImpl
    implements AzureDevOpsProject, AzureDevOpsProject.Definition, AzureDevOpsProject.Update {
    private AzureDevOpsProjectInner innerObject;

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

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

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

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

    public SystemData systemData() {
        return this.innerModel().systemData();
    }

    public AzureDevOpsProjectProperties properties() {
        return this.innerModel().properties();
    }

    public String resourceGroupName() {
        return resourceGroupName;
    }

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

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

    private String resourceGroupName;

    private String securityConnectorName;

    private String orgName;

    private String projectName;

    public AzureDevOpsProjectImpl withExistingAzureDevOpsOrg(String resourceGroupName, String securityConnectorName,
        String orgName) {
        this.resourceGroupName = resourceGroupName;
        this.securityConnectorName = securityConnectorName;
        this.orgName = orgName;
        return this;
    }

    public AzureDevOpsProject create() {
        this.innerObject = serviceManager.serviceClient()
            .getAzureDevOpsProjects()
            .createOrUpdate(resourceGroupName, securityConnectorName, orgName, projectName, this.innerModel(),
                Context.NONE);
        return this;
    }

    public AzureDevOpsProject create(Context context) {
        this.innerObject = serviceManager.serviceClient()
            .getAzureDevOpsProjects()
            .createOrUpdate(resourceGroupName, securityConnectorName, orgName, projectName, this.innerModel(), context);
        return this;
    }

    AzureDevOpsProjectImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) {
        this.innerObject = new AzureDevOpsProjectInner();
        this.serviceManager = serviceManager;
        this.projectName = name;
    }

    public AzureDevOpsProjectImpl update() {
        return this;
    }

    public AzureDevOpsProject apply() {
        this.innerObject = serviceManager.serviceClient()
            .getAzureDevOpsProjects()
            .update(resourceGroupName, securityConnectorName, orgName, projectName, this.innerModel(), Context.NONE);
        return this;
    }

    public AzureDevOpsProject apply(Context context) {
        this.innerObject = serviceManager.serviceClient()
            .getAzureDevOpsProjects()
            .update(resourceGroupName, securityConnectorName, orgName, projectName, this.innerModel(), context);
        return this;
    }

    AzureDevOpsProjectImpl(AzureDevOpsProjectInner innerObject,
        com.azure.resourcemanager.security.SecurityManager serviceManager) {
        this.innerObject = innerObject;
        this.serviceManager = serviceManager;
        this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups");
        this.securityConnectorName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "securityConnectors");
        this.orgName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "azureDevOpsOrgs");
        this.projectName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "projects");
    }

    public AzureDevOpsProject refresh() {
        this.innerObject = serviceManager.serviceClient()
            .getAzureDevOpsProjects()
            .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, Context.NONE)
            .getValue();
        return this;
    }

    public AzureDevOpsProject refresh(Context context) {
        this.innerObject = serviceManager.serviceClient()
            .getAzureDevOpsProjects()
            .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, context)
            .getValue();
        return this;
    }

    public AzureDevOpsProjectImpl withProperties(AzureDevOpsProjectProperties properties) {
        this.innerModel().withProperties(properties);
        return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy