com.azure.resourcemanager.servicelinker.models.ConfigurationStore 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.servicelinker.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;
/**
* An option to store configuration into different place.
*/
@Fluent
public final class ConfigurationStore implements JsonSerializable {
/*
* The app configuration id to store configuration
*/
private String appConfigurationId;
/**
* Creates an instance of ConfigurationStore class.
*/
public ConfigurationStore() {
}
/**
* Get the appConfigurationId property: The app configuration id to store configuration.
*
* @return the appConfigurationId value.
*/
public String appConfigurationId() {
return this.appConfigurationId;
}
/**
* Set the appConfigurationId property: The app configuration id to store configuration.
*
* @param appConfigurationId the appConfigurationId value to set.
* @return the ConfigurationStore object itself.
*/
public ConfigurationStore withAppConfigurationId(String appConfigurationId) {
this.appConfigurationId = appConfigurationId;
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("appConfigurationId", this.appConfigurationId);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of ConfigurationStore from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ConfigurationStore 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 ConfigurationStore.
*/
public static ConfigurationStore fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ConfigurationStore deserializedConfigurationStore = new ConfigurationStore();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("appConfigurationId".equals(fieldName)) {
deserializedConfigurationStore.appConfigurationId = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedConfigurationStore;
});
}
}