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

com.azure.resourcemanager.securityinsights.models.AzureDevOpsResourceInfo 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.models;

import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * Resources created in Azure DevOps repository.
 */
@Fluent
public final class AzureDevOpsResourceInfo implements JsonSerializable {
    /*
     * Id of the pipeline created for the source-control.
     */
    private String pipelineId;

    /*
     * Id of the service-connection created for the source-control.
     */
    private String serviceConnectionId;

    /**
     * Creates an instance of AzureDevOpsResourceInfo class.
     */
    public AzureDevOpsResourceInfo() {
    }

    /**
     * Get the pipelineId property: Id of the pipeline created for the source-control.
     * 
     * @return the pipelineId value.
     */
    public String pipelineId() {
        return this.pipelineId;
    }

    /**
     * Set the pipelineId property: Id of the pipeline created for the source-control.
     * 
     * @param pipelineId the pipelineId value to set.
     * @return the AzureDevOpsResourceInfo object itself.
     */
    public AzureDevOpsResourceInfo withPipelineId(String pipelineId) {
        this.pipelineId = pipelineId;
        return this;
    }

    /**
     * Get the serviceConnectionId property: Id of the service-connection created for the source-control.
     * 
     * @return the serviceConnectionId value.
     */
    public String serviceConnectionId() {
        return this.serviceConnectionId;
    }

    /**
     * Set the serviceConnectionId property: Id of the service-connection created for the source-control.
     * 
     * @param serviceConnectionId the serviceConnectionId value to set.
     * @return the AzureDevOpsResourceInfo object itself.
     */
    public AzureDevOpsResourceInfo withServiceConnectionId(String serviceConnectionId) {
        this.serviceConnectionId = serviceConnectionId;
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("pipelineId", this.pipelineId);
        jsonWriter.writeStringField("serviceConnectionId", this.serviceConnectionId);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of AzureDevOpsResourceInfo from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of AzureDevOpsResourceInfo if the JsonReader was pointing to an instance of it, or null if it
     * was pointing to JSON null.
     * @throws IOException If an error occurs while reading the AzureDevOpsResourceInfo.
     */
    public static AzureDevOpsResourceInfo fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            AzureDevOpsResourceInfo deserializedAzureDevOpsResourceInfo = new AzureDevOpsResourceInfo();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("pipelineId".equals(fieldName)) {
                    deserializedAzureDevOpsResourceInfo.pipelineId = reader.getString();
                } else if ("serviceConnectionId".equals(fieldName)) {
                    deserializedAzureDevOpsResourceInfo.serviceConnectionId = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedAzureDevOpsResourceInfo;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy