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

com.azure.resourcemanager.security.models.AzureDevOpsRepositoryProperties Maven / Gradle / Ivy

// 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.models;

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

/**
 * Azure DevOps Repository properties.
 */
@Fluent
public final class AzureDevOpsRepositoryProperties implements JsonSerializable {
    /*
     * Gets the resource status message.
     */
    private String provisioningStatusMessage;

    /*
     * Gets the time when resource was last checked.
     */
    private OffsetDateTime provisioningStatusUpdateTimeUtc;

    /*
     * The provisioning state of the resource.
     * 
     * Pending - Provisioning pending.
     * Failed - Provisioning failed.
     * Succeeded - Successful provisioning.
     * Canceled - Provisioning canceled.
     * PendingDeletion - Deletion pending.
     * DeletionSuccess - Deletion successful.
     * DeletionFailure - Deletion failure.
     */
    private DevOpsProvisioningState provisioningState;

    /*
     * Gets or sets parent Azure DevOps Organization name.
     */
    private String parentOrgName;

    /*
     * Gets or sets parent Azure DevOps Project name.
     */
    private String parentProjectName;

    /*
     * Gets or sets Azure DevOps Repository id.
     */
    private String repoId;

    /*
     * Gets or sets Azure DevOps Repository url.
     */
    private String repoUrl;

    /*
     * Gets or sets Azure DevOps repository visibility, whether it is public or private etc.
     */
    private String visibility;

    /*
     * Details about resource onboarding status across all connectors.
     * 
     * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only
     * applicable to top-level resources.
     * Onboarded - this resource has already been onboarded by the specified connector.
     * NotOnboarded - this resource has not been onboarded to any connector.
     * NotApplicable - the onboarding state is not applicable to the current endpoint.
     */
    private OnboardingState onboardingState;

    /*
     * Configuration payload for PR Annotations.
     */
    private ActionableRemediation actionableRemediation;

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

    /**
     * Get the provisioningStatusMessage property: Gets the resource status message.
     * 
     * @return the provisioningStatusMessage value.
     */
    public String provisioningStatusMessage() {
        return this.provisioningStatusMessage;
    }

    /**
     * Get the provisioningStatusUpdateTimeUtc property: Gets the time when resource was last checked.
     * 
     * @return the provisioningStatusUpdateTimeUtc value.
     */
    public OffsetDateTime provisioningStatusUpdateTimeUtc() {
        return this.provisioningStatusUpdateTimeUtc;
    }

    /**
     * Get the provisioningState property: The provisioning state of the resource.
     * 
     * Pending - Provisioning pending.
     * Failed - Provisioning failed.
     * Succeeded - Successful provisioning.
     * Canceled - Provisioning canceled.
     * PendingDeletion - Deletion pending.
     * DeletionSuccess - Deletion successful.
     * DeletionFailure - Deletion failure.
     * 
     * @return the provisioningState value.
     */
    public DevOpsProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the parentOrgName property: Gets or sets parent Azure DevOps Organization name.
     * 
     * @return the parentOrgName value.
     */
    public String parentOrgName() {
        return this.parentOrgName;
    }

    /**
     * Set the parentOrgName property: Gets or sets parent Azure DevOps Organization name.
     * 
     * @param parentOrgName the parentOrgName value to set.
     * @return the AzureDevOpsRepositoryProperties object itself.
     */
    public AzureDevOpsRepositoryProperties withParentOrgName(String parentOrgName) {
        this.parentOrgName = parentOrgName;
        return this;
    }

    /**
     * Get the parentProjectName property: Gets or sets parent Azure DevOps Project name.
     * 
     * @return the parentProjectName value.
     */
    public String parentProjectName() {
        return this.parentProjectName;
    }

    /**
     * Set the parentProjectName property: Gets or sets parent Azure DevOps Project name.
     * 
     * @param parentProjectName the parentProjectName value to set.
     * @return the AzureDevOpsRepositoryProperties object itself.
     */
    public AzureDevOpsRepositoryProperties withParentProjectName(String parentProjectName) {
        this.parentProjectName = parentProjectName;
        return this;
    }

    /**
     * Get the repoId property: Gets or sets Azure DevOps Repository id.
     * 
     * @return the repoId value.
     */
    public String repoId() {
        return this.repoId;
    }

    /**
     * Get the repoUrl property: Gets or sets Azure DevOps Repository url.
     * 
     * @return the repoUrl value.
     */
    public String repoUrl() {
        return this.repoUrl;
    }

    /**
     * Get the visibility property: Gets or sets Azure DevOps repository visibility, whether it is public or private
     * etc.
     * 
     * @return the visibility value.
     */
    public String visibility() {
        return this.visibility;
    }

    /**
     * Get the onboardingState property: Details about resource onboarding status across all connectors.
     * 
     * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only
     * applicable to top-level resources.
     * Onboarded - this resource has already been onboarded by the specified connector.
     * NotOnboarded - this resource has not been onboarded to any connector.
     * NotApplicable - the onboarding state is not applicable to the current endpoint.
     * 
     * @return the onboardingState value.
     */
    public OnboardingState onboardingState() {
        return this.onboardingState;
    }

    /**
     * Set the onboardingState property: Details about resource onboarding status across all connectors.
     * 
     * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only
     * applicable to top-level resources.
     * Onboarded - this resource has already been onboarded by the specified connector.
     * NotOnboarded - this resource has not been onboarded to any connector.
     * NotApplicable - the onboarding state is not applicable to the current endpoint.
     * 
     * @param onboardingState the onboardingState value to set.
     * @return the AzureDevOpsRepositoryProperties object itself.
     */
    public AzureDevOpsRepositoryProperties withOnboardingState(OnboardingState onboardingState) {
        this.onboardingState = onboardingState;
        return this;
    }

    /**
     * Get the actionableRemediation property: Configuration payload for PR Annotations.
     * 
     * @return the actionableRemediation value.
     */
    public ActionableRemediation actionableRemediation() {
        return this.actionableRemediation;
    }

    /**
     * Set the actionableRemediation property: Configuration payload for PR Annotations.
     * 
     * @param actionableRemediation the actionableRemediation value to set.
     * @return the AzureDevOpsRepositoryProperties object itself.
     */
    public AzureDevOpsRepositoryProperties withActionableRemediation(ActionableRemediation actionableRemediation) {
        this.actionableRemediation = actionableRemediation;
        return this;
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("parentOrgName", this.parentOrgName);
        jsonWriter.writeStringField("parentProjectName", this.parentProjectName);
        jsonWriter.writeStringField("onboardingState",
            this.onboardingState == null ? null : this.onboardingState.toString());
        jsonWriter.writeJsonField("actionableRemediation", this.actionableRemediation);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of AzureDevOpsRepositoryProperties from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of AzureDevOpsRepositoryProperties 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 AzureDevOpsRepositoryProperties.
     */
    public static AzureDevOpsRepositoryProperties fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            AzureDevOpsRepositoryProperties deserializedAzureDevOpsRepositoryProperties
                = new AzureDevOpsRepositoryProperties();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("provisioningStatusMessage".equals(fieldName)) {
                    deserializedAzureDevOpsRepositoryProperties.provisioningStatusMessage = reader.getString();
                } else if ("provisioningStatusUpdateTimeUtc".equals(fieldName)) {
                    deserializedAzureDevOpsRepositoryProperties.provisioningStatusUpdateTimeUtc = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("provisioningState".equals(fieldName)) {
                    deserializedAzureDevOpsRepositoryProperties.provisioningState
                        = DevOpsProvisioningState.fromString(reader.getString());
                } else if ("parentOrgName".equals(fieldName)) {
                    deserializedAzureDevOpsRepositoryProperties.parentOrgName = reader.getString();
                } else if ("parentProjectName".equals(fieldName)) {
                    deserializedAzureDevOpsRepositoryProperties.parentProjectName = reader.getString();
                } else if ("repoId".equals(fieldName)) {
                    deserializedAzureDevOpsRepositoryProperties.repoId = reader.getString();
                } else if ("repoUrl".equals(fieldName)) {
                    deserializedAzureDevOpsRepositoryProperties.repoUrl = reader.getString();
                } else if ("visibility".equals(fieldName)) {
                    deserializedAzureDevOpsRepositoryProperties.visibility = reader.getString();
                } else if ("onboardingState".equals(fieldName)) {
                    deserializedAzureDevOpsRepositoryProperties.onboardingState
                        = OnboardingState.fromString(reader.getString());
                } else if ("actionableRemediation".equals(fieldName)) {
                    deserializedAzureDevOpsRepositoryProperties.actionableRemediation
                        = ActionableRemediation.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedAzureDevOpsRepositoryProperties;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy