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

com.azure.resourcemanager.security.models.DevOpsConfigurationProperties 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;
import java.util.List;

/**
 * DevOps Configuration properties.
 */
@Fluent
public final class DevOpsConfigurationProperties 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;

    /*
     * Authorization payload.
     */
    private Authorization authorization;

    /*
     * AutoDiscovery states.
     */
    private AutoDiscovery autoDiscovery;

    /*
     * List of top-level inventory to select when AutoDiscovery is disabled.
     * This field is ignored when AutoDiscovery is enabled.
     */
    private List topLevelInventoryList;

    /*
     * List of capabilities assigned to the DevOps configuration during the discovery process.
     */
    private List capabilities;

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

    /**
     * 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 authorization property: Authorization payload.
     * 
     * @return the authorization value.
     */
    public Authorization authorization() {
        return this.authorization;
    }

    /**
     * Set the authorization property: Authorization payload.
     * 
     * @param authorization the authorization value to set.
     * @return the DevOpsConfigurationProperties object itself.
     */
    public DevOpsConfigurationProperties withAuthorization(Authorization authorization) {
        this.authorization = authorization;
        return this;
    }

    /**
     * Get the autoDiscovery property: AutoDiscovery states.
     * 
     * @return the autoDiscovery value.
     */
    public AutoDiscovery autoDiscovery() {
        return this.autoDiscovery;
    }

    /**
     * Set the autoDiscovery property: AutoDiscovery states.
     * 
     * @param autoDiscovery the autoDiscovery value to set.
     * @return the DevOpsConfigurationProperties object itself.
     */
    public DevOpsConfigurationProperties withAutoDiscovery(AutoDiscovery autoDiscovery) {
        this.autoDiscovery = autoDiscovery;
        return this;
    }

    /**
     * Get the topLevelInventoryList property: List of top-level inventory to select when AutoDiscovery is disabled.
     * This field is ignored when AutoDiscovery is enabled.
     * 
     * @return the topLevelInventoryList value.
     */
    public List topLevelInventoryList() {
        return this.topLevelInventoryList;
    }

    /**
     * Set the topLevelInventoryList property: List of top-level inventory to select when AutoDiscovery is disabled.
     * This field is ignored when AutoDiscovery is enabled.
     * 
     * @param topLevelInventoryList the topLevelInventoryList value to set.
     * @return the DevOpsConfigurationProperties object itself.
     */
    public DevOpsConfigurationProperties withTopLevelInventoryList(List topLevelInventoryList) {
        this.topLevelInventoryList = topLevelInventoryList;
        return this;
    }

    /**
     * Get the capabilities property: List of capabilities assigned to the DevOps configuration during the discovery
     * process.
     * 
     * @return the capabilities value.
     */
    public List capabilities() {
        return this.capabilities;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (authorization() != null) {
            authorization().validate();
        }
        if (capabilities() != null) {
            capabilities().forEach(e -> e.validate());
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeJsonField("authorization", this.authorization);
        jsonWriter.writeStringField("autoDiscovery", this.autoDiscovery == null ? null : this.autoDiscovery.toString());
        jsonWriter.writeArrayField("topLevelInventoryList", this.topLevelInventoryList,
            (writer, element) -> writer.writeString(element));
        return jsonWriter.writeEndObject();
    }

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

                if ("provisioningStatusMessage".equals(fieldName)) {
                    deserializedDevOpsConfigurationProperties.provisioningStatusMessage = reader.getString();
                } else if ("provisioningStatusUpdateTimeUtc".equals(fieldName)) {
                    deserializedDevOpsConfigurationProperties.provisioningStatusUpdateTimeUtc = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("provisioningState".equals(fieldName)) {
                    deserializedDevOpsConfigurationProperties.provisioningState
                        = DevOpsProvisioningState.fromString(reader.getString());
                } else if ("authorization".equals(fieldName)) {
                    deserializedDevOpsConfigurationProperties.authorization = Authorization.fromJson(reader);
                } else if ("autoDiscovery".equals(fieldName)) {
                    deserializedDevOpsConfigurationProperties.autoDiscovery
                        = AutoDiscovery.fromString(reader.getString());
                } else if ("topLevelInventoryList".equals(fieldName)) {
                    List topLevelInventoryList = reader.readArray(reader1 -> reader1.getString());
                    deserializedDevOpsConfigurationProperties.topLevelInventoryList = topLevelInventoryList;
                } else if ("capabilities".equals(fieldName)) {
                    List capabilities
                        = reader.readArray(reader1 -> DevOpsCapability.fromJson(reader1));
                    deserializedDevOpsConfigurationProperties.capabilities = capabilities;
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedDevOpsConfigurationProperties;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy