com.azure.resourcemanager.servicelinker.fluent.models.ConfigurationNameItemInner 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.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.servicelinker.models.AuthType;
import com.azure.resourcemanager.servicelinker.models.ClientType;
import com.azure.resourcemanager.servicelinker.models.ConfigurationName;
import com.azure.resourcemanager.servicelinker.models.DaprProperties;
import com.azure.resourcemanager.servicelinker.models.SecretSourceType;
import java.io.IOException;
import java.util.List;
/**
* The ConfigurationNameItem model.
*/
@Fluent
public final class ConfigurationNameItemInner implements JsonSerializable {
/*
* The result detail.
*/
private ConfigurationNames innerProperties;
/**
* Creates an instance of ConfigurationNameItemInner class.
*/
public ConfigurationNameItemInner() {
}
/**
* Get the innerProperties property: The result detail.
*
* @return the innerProperties value.
*/
private ConfigurationNames innerProperties() {
return this.innerProperties;
}
/**
* Get the targetService property: The target service provider name and resource name.
*
* @return the targetService value.
*/
public String targetService() {
return this.innerProperties() == null ? null : this.innerProperties().targetService();
}
/**
* Set the targetService property: The target service provider name and resource name.
*
* @param targetService the targetService value to set.
* @return the ConfigurationNameItemInner object itself.
*/
public ConfigurationNameItemInner withTargetService(String targetService) {
if (this.innerProperties() == null) {
this.innerProperties = new ConfigurationNames();
}
this.innerProperties().withTargetService(targetService);
return this;
}
/**
* Get the clientType property: The client type for configuration names.
*
* @return the clientType value.
*/
public ClientType clientType() {
return this.innerProperties() == null ? null : this.innerProperties().clientType();
}
/**
* Set the clientType property: The client type for configuration names.
*
* @param clientType the clientType value to set.
* @return the ConfigurationNameItemInner object itself.
*/
public ConfigurationNameItemInner withClientType(ClientType clientType) {
if (this.innerProperties() == null) {
this.innerProperties = new ConfigurationNames();
}
this.innerProperties().withClientType(clientType);
return this;
}
/**
* Get the authType property: The auth type.
*
* @return the authType value.
*/
public AuthType authType() {
return this.innerProperties() == null ? null : this.innerProperties().authType();
}
/**
* Set the authType property: The auth type.
*
* @param authType the authType value to set.
* @return the ConfigurationNameItemInner object itself.
*/
public ConfigurationNameItemInner withAuthType(AuthType authType) {
if (this.innerProperties() == null) {
this.innerProperties = new ConfigurationNames();
}
this.innerProperties().withAuthType(authType);
return this;
}
/**
* Get the secretType property: Indicates where the secrets in configuration from. Used when secrets are from
* Keyvault.
*
* @return the secretType value.
*/
public SecretSourceType secretType() {
return this.innerProperties() == null ? null : this.innerProperties().secretType();
}
/**
* Set the secretType property: Indicates where the secrets in configuration from. Used when secrets are from
* Keyvault.
*
* @param secretType the secretType value to set.
* @return the ConfigurationNameItemInner object itself.
*/
public ConfigurationNameItemInner withSecretType(SecretSourceType secretType) {
if (this.innerProperties() == null) {
this.innerProperties = new ConfigurationNames();
}
this.innerProperties().withSecretType(secretType);
return this;
}
/**
* Get the daprProperties property: Deprecated, please use #/definitions/DaprConfigurationList instead.
*
* @return the daprProperties value.
*/
public DaprProperties daprProperties() {
return this.innerProperties() == null ? null : this.innerProperties().daprProperties();
}
/**
* Set the daprProperties property: Deprecated, please use #/definitions/DaprConfigurationList instead.
*
* @param daprProperties the daprProperties value to set.
* @return the ConfigurationNameItemInner object itself.
*/
public ConfigurationNameItemInner withDaprProperties(DaprProperties daprProperties) {
if (this.innerProperties() == null) {
this.innerProperties = new ConfigurationNames();
}
this.innerProperties().withDaprProperties(daprProperties);
return this;
}
/**
* Get the names property: The configuration names to be set in compute service environment.
*
* @return the names value.
*/
public List names() {
return this.innerProperties() == null ? null : this.innerProperties().names();
}
/**
* Set the names property: The configuration names to be set in compute service environment.
*
* @param names the names value to set.
* @return the ConfigurationNameItemInner object itself.
*/
public ConfigurationNameItemInner withNames(List names) {
if (this.innerProperties() == null) {
this.innerProperties = new ConfigurationNames();
}
this.innerProperties().withNames(names);
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (innerProperties() != null) {
innerProperties().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("properties", this.innerProperties);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of ConfigurationNameItemInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ConfigurationNameItemInner 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 ConfigurationNameItemInner.
*/
public static ConfigurationNameItemInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ConfigurationNameItemInner deserializedConfigurationNameItemInner = new ConfigurationNameItemInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("properties".equals(fieldName)) {
deserializedConfigurationNameItemInner.innerProperties = ConfigurationNames.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedConfigurationNameItemInner;
});
}
}