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

com.azure.resourcemanager.applicationinsights.models.ApplicationInsightsComponentAnalyticsItemProperties 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.applicationinsights.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;

/**
 * A set of properties that can be defined in the context of a specific item type. Each type may have its own
 * properties.
 */
@Fluent
public final class ApplicationInsightsComponentAnalyticsItemProperties
    implements JsonSerializable {
    /*
     * A function alias, used when the type of the item is Function
     */
    private String functionAlias;

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

    /**
     * Get the functionAlias property: A function alias, used when the type of the item is Function.
     * 
     * @return the functionAlias value.
     */
    public String functionAlias() {
        return this.functionAlias;
    }

    /**
     * Set the functionAlias property: A function alias, used when the type of the item is Function.
     * 
     * @param functionAlias the functionAlias value to set.
     * @return the ApplicationInsightsComponentAnalyticsItemProperties object itself.
     */
    public ApplicationInsightsComponentAnalyticsItemProperties withFunctionAlias(String functionAlias) {
        this.functionAlias = functionAlias;
        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("functionAlias", this.functionAlias);
        return jsonWriter.writeEndObject();
    }

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

                if ("functionAlias".equals(fieldName)) {
                    deserializedApplicationInsightsComponentAnalyticsItemProperties.functionAlias = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedApplicationInsightsComponentAnalyticsItemProperties;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy