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

com.azure.resourcemanager.appcontainers.models.AuthPlatform 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.appcontainers.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;

/**
 * The configuration settings of the platform of ContainerApp Service Authentication/Authorization.
 */
@Fluent
public final class AuthPlatform implements JsonSerializable {
    /*
     * true if the Authentication / Authorization feature is enabled for the current app; otherwise,
     * false.
     */
    private Boolean enabled;

    /*
     * The RuntimeVersion of the Authentication / Authorization feature in use for the current app.
     * The setting in this value can control the behavior of certain features in the Authentication / Authorization
     * module.
     */
    private String runtimeVersion;

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

    /**
     * Get the enabled property: <code>true</code> if the Authentication / Authorization feature is enabled
     * for the current app; otherwise, <code>false</code>.
     * 
     * @return the enabled value.
     */
    public Boolean enabled() {
        return this.enabled;
    }

    /**
     * Set the enabled property: <code>true</code> if the Authentication / Authorization feature is enabled
     * for the current app; otherwise, <code>false</code>.
     * 
     * @param enabled the enabled value to set.
     * @return the AuthPlatform object itself.
     */
    public AuthPlatform withEnabled(Boolean enabled) {
        this.enabled = enabled;
        return this;
    }

    /**
     * Get the runtimeVersion property: The RuntimeVersion of the Authentication / Authorization feature in use for the
     * current app.
     * The setting in this value can control the behavior of certain features in the Authentication / Authorization
     * module.
     * 
     * @return the runtimeVersion value.
     */
    public String runtimeVersion() {
        return this.runtimeVersion;
    }

    /**
     * Set the runtimeVersion property: The RuntimeVersion of the Authentication / Authorization feature in use for the
     * current app.
     * The setting in this value can control the behavior of certain features in the Authentication / Authorization
     * module.
     * 
     * @param runtimeVersion the runtimeVersion value to set.
     * @return the AuthPlatform object itself.
     */
    public AuthPlatform withRuntimeVersion(String runtimeVersion) {
        this.runtimeVersion = runtimeVersion;
        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.writeBooleanField("enabled", this.enabled);
        jsonWriter.writeStringField("runtimeVersion", this.runtimeVersion);
        return jsonWriter.writeEndObject();
    }

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

                if ("enabled".equals(fieldName)) {
                    deserializedAuthPlatform.enabled = reader.getNullable(JsonReader::getBoolean);
                } else if ("runtimeVersion".equals(fieldName)) {
                    deserializedAuthPlatform.runtimeVersion = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedAuthPlatform;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy