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

com.azure.resourcemanager.devcenter.fluent.models.ProjectUpdateProperties 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.devcenter.fluent.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 com.azure.resourcemanager.devcenter.models.ProjectCatalogSettings;
import java.io.IOException;

/**
 * Properties of a project. These properties can be updated after the resource has been created.
 */
@Fluent
public class ProjectUpdateProperties implements JsonSerializable {
    /*
     * Resource Id of an associated DevCenter
     */
    private String devCenterId;

    /*
     * Description of the project.
     */
    private String description;

    /*
     * When specified, limits the maximum number of Dev Boxes a single user can create across all pools in the project.
     * This will have no effect on existing Dev Boxes when reduced.
     */
    private Integer maxDevBoxesPerUser;

    /*
     * The display name of the project.
     */
    private String displayName;

    /*
     * Settings to be used when associating a project with a catalog.
     */
    private ProjectCatalogSettings catalogSettings;

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

    /**
     * Get the devCenterId property: Resource Id of an associated DevCenter.
     * 
     * @return the devCenterId value.
     */
    public String devCenterId() {
        return this.devCenterId;
    }

    /**
     * Set the devCenterId property: Resource Id of an associated DevCenter.
     * 
     * @param devCenterId the devCenterId value to set.
     * @return the ProjectUpdateProperties object itself.
     */
    public ProjectUpdateProperties withDevCenterId(String devCenterId) {
        this.devCenterId = devCenterId;
        return this;
    }

    /**
     * Get the description property: Description of the project.
     * 
     * @return the description value.
     */
    public String description() {
        return this.description;
    }

    /**
     * Set the description property: Description of the project.
     * 
     * @param description the description value to set.
     * @return the ProjectUpdateProperties object itself.
     */
    public ProjectUpdateProperties withDescription(String description) {
        this.description = description;
        return this;
    }

    /**
     * Get the maxDevBoxesPerUser property: When specified, limits the maximum number of Dev Boxes a single user can
     * create across all pools in the project. This will have no effect on existing Dev Boxes when reduced.
     * 
     * @return the maxDevBoxesPerUser value.
     */
    public Integer maxDevBoxesPerUser() {
        return this.maxDevBoxesPerUser;
    }

    /**
     * Set the maxDevBoxesPerUser property: When specified, limits the maximum number of Dev Boxes a single user can
     * create across all pools in the project. This will have no effect on existing Dev Boxes when reduced.
     * 
     * @param maxDevBoxesPerUser the maxDevBoxesPerUser value to set.
     * @return the ProjectUpdateProperties object itself.
     */
    public ProjectUpdateProperties withMaxDevBoxesPerUser(Integer maxDevBoxesPerUser) {
        this.maxDevBoxesPerUser = maxDevBoxesPerUser;
        return this;
    }

    /**
     * Get the displayName property: The display name of the project.
     * 
     * @return the displayName value.
     */
    public String displayName() {
        return this.displayName;
    }

    /**
     * Set the displayName property: The display name of the project.
     * 
     * @param displayName the displayName value to set.
     * @return the ProjectUpdateProperties object itself.
     */
    public ProjectUpdateProperties withDisplayName(String displayName) {
        this.displayName = displayName;
        return this;
    }

    /**
     * Get the catalogSettings property: Settings to be used when associating a project with a catalog.
     * 
     * @return the catalogSettings value.
     */
    public ProjectCatalogSettings catalogSettings() {
        return this.catalogSettings;
    }

    /**
     * Set the catalogSettings property: Settings to be used when associating a project with a catalog.
     * 
     * @param catalogSettings the catalogSettings value to set.
     * @return the ProjectUpdateProperties object itself.
     */
    public ProjectUpdateProperties withCatalogSettings(ProjectCatalogSettings catalogSettings) {
        this.catalogSettings = catalogSettings;
        return this;
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("devCenterId", this.devCenterId);
        jsonWriter.writeStringField("description", this.description);
        jsonWriter.writeNumberField("maxDevBoxesPerUser", this.maxDevBoxesPerUser);
        jsonWriter.writeStringField("displayName", this.displayName);
        jsonWriter.writeJsonField("catalogSettings", this.catalogSettings);
        return jsonWriter.writeEndObject();
    }

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

                if ("devCenterId".equals(fieldName)) {
                    deserializedProjectUpdateProperties.devCenterId = reader.getString();
                } else if ("description".equals(fieldName)) {
                    deserializedProjectUpdateProperties.description = reader.getString();
                } else if ("maxDevBoxesPerUser".equals(fieldName)) {
                    deserializedProjectUpdateProperties.maxDevBoxesPerUser = reader.getNullable(JsonReader::getInt);
                } else if ("displayName".equals(fieldName)) {
                    deserializedProjectUpdateProperties.displayName = reader.getString();
                } else if ("catalogSettings".equals(fieldName)) {
                    deserializedProjectUpdateProperties.catalogSettings = ProjectCatalogSettings.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedProjectUpdateProperties;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy