com.azure.ai.metricsadvisor.implementation.models.DataLakeGen2SharedKeyCredential Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-ai-metricsadvisor Show documentation
Show all versions of azure-ai-metricsadvisor Show documentation
This package contains the Microsoft Azure Cognitive Services Metrics Advisor SDK.
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.ai.metricsadvisor.implementation.models;
import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.util.UUID;
/**
* The DataLakeGen2SharedKeyCredential model.
*/
@Fluent
public final class DataLakeGen2SharedKeyCredential extends DataSourceCredential {
/*
* The parameters property.
*/
private DataLakeGen2SharedKeyParam parameters;
/**
* Creates an instance of DataLakeGen2SharedKeyCredential class.
*/
public DataLakeGen2SharedKeyCredential() {
}
/**
* Get the parameters property: The parameters property.
*
* @return the parameters value.
*/
public DataLakeGen2SharedKeyParam getParameters() {
return this.parameters;
}
/**
* Set the parameters property: The parameters property.
*
* @param parameters the parameters value to set.
* @return the DataLakeGen2SharedKeyCredential object itself.
*/
public DataLakeGen2SharedKeyCredential setParameters(DataLakeGen2SharedKeyParam parameters) {
this.parameters = parameters;
return this;
}
/**
* {@inheritDoc}
*/
@Override
public DataLakeGen2SharedKeyCredential setDataSourceCredentialName(String dataSourceCredentialName) {
super.setDataSourceCredentialName(dataSourceCredentialName);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public DataLakeGen2SharedKeyCredential setDataSourceCredentialDescription(String dataSourceCredentialDescription) {
super.setDataSourceCredentialDescription(dataSourceCredentialDescription);
return this;
}
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("dataSourceCredentialType",
DataSourceCredentialType.DATA_LAKE_GEN2SHARED_KEY == null
? null
: DataSourceCredentialType.DATA_LAKE_GEN2SHARED_KEY.toString());
jsonWriter.writeStringField("dataSourceCredentialName", getDataSourceCredentialName());
jsonWriter.writeStringField("dataSourceCredentialDescription", getDataSourceCredentialDescription());
jsonWriter.writeJsonField("parameters", this.parameters);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of DataLakeGen2SharedKeyCredential from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of DataLakeGen2SharedKeyCredential if the JsonReader was pointing to an instance of it, or
* null if it was pointing to JSON null.
* @throws IllegalStateException If the deserialized JSON object was missing any required properties or the
* polymorphic discriminator.
* @throws IOException If an error occurs while reading the DataLakeGen2SharedKeyCredential.
*/
public static DataLakeGen2SharedKeyCredential fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
DataLakeGen2SharedKeyCredential deserializedDataLakeGen2SharedKeyCredential
= new DataLakeGen2SharedKeyCredential();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("dataSourceCredentialType".equals(fieldName)) {
String dataSourceCredentialType = reader.getString();
if (!"DataLakeGen2SharedKey".equals(dataSourceCredentialType)) {
throw new IllegalStateException(
"'dataSourceCredentialType' was expected to be non-null and equal to 'DataLakeGen2SharedKey'. The found 'dataSourceCredentialType' was '"
+ dataSourceCredentialType + "'.");
}
} else if ("dataSourceCredentialName".equals(fieldName)) {
deserializedDataLakeGen2SharedKeyCredential.setDataSourceCredentialName(reader.getString());
} else if ("dataSourceCredentialId".equals(fieldName)) {
deserializedDataLakeGen2SharedKeyCredential.setDataSourceCredentialId(
reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())));
} else if ("dataSourceCredentialDescription".equals(fieldName)) {
deserializedDataLakeGen2SharedKeyCredential.setDataSourceCredentialDescription(reader.getString());
} else if ("parameters".equals(fieldName)) {
deserializedDataLakeGen2SharedKeyCredential.parameters
= DataLakeGen2SharedKeyParam.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedDataLakeGen2SharedKeyCredential;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy