
com.azure.resourcemanager.datafactory.fluent.models.SapHanaLinkedServiceProperties 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.datafactory.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.datafactory.models.SapHanaAuthenticationType;
import com.azure.resourcemanager.datafactory.models.SecretBase;
import java.io.IOException;
/**
* Properties specific to this linked service type.
*/
@Fluent
public final class SapHanaLinkedServiceProperties implements JsonSerializable {
/*
* SAP HANA ODBC connection string. Type: string, SecureString or AzureKeyVaultSecretReference.
*/
private Object connectionString;
/*
* Host name of the SAP HANA server. Type: string (or Expression with resultType string).
*/
private Object server;
/*
* The authentication type to be used to connect to the SAP HANA server.
*/
private SapHanaAuthenticationType authenticationType;
/*
* Username to access the SAP HANA server. Type: string (or Expression with resultType string).
*/
private Object username;
/*
* Password to access the SAP HANA server.
*/
private SecretBase password;
/*
* The encrypted credential used for authentication. Credentials are encrypted using the integration runtime
* credential manager. Type: string.
*/
private String encryptedCredential;
/**
* Creates an instance of SapHanaLinkedServiceProperties class.
*/
public SapHanaLinkedServiceProperties() {
}
/**
* Get the connectionString property: SAP HANA ODBC connection string. Type: string, SecureString or
* AzureKeyVaultSecretReference.
*
* @return the connectionString value.
*/
public Object connectionString() {
return this.connectionString;
}
/**
* Set the connectionString property: SAP HANA ODBC connection string. Type: string, SecureString or
* AzureKeyVaultSecretReference.
*
* @param connectionString the connectionString value to set.
* @return the SapHanaLinkedServiceProperties object itself.
*/
public SapHanaLinkedServiceProperties withConnectionString(Object connectionString) {
this.connectionString = connectionString;
return this;
}
/**
* Get the server property: Host name of the SAP HANA server. Type: string (or Expression with resultType string).
*
* @return the server value.
*/
public Object server() {
return this.server;
}
/**
* Set the server property: Host name of the SAP HANA server. Type: string (or Expression with resultType string).
*
* @param server the server value to set.
* @return the SapHanaLinkedServiceProperties object itself.
*/
public SapHanaLinkedServiceProperties withServer(Object server) {
this.server = server;
return this;
}
/**
* Get the authenticationType property: The authentication type to be used to connect to the SAP HANA server.
*
* @return the authenticationType value.
*/
public SapHanaAuthenticationType authenticationType() {
return this.authenticationType;
}
/**
* Set the authenticationType property: The authentication type to be used to connect to the SAP HANA server.
*
* @param authenticationType the authenticationType value to set.
* @return the SapHanaLinkedServiceProperties object itself.
*/
public SapHanaLinkedServiceProperties withAuthenticationType(SapHanaAuthenticationType authenticationType) {
this.authenticationType = authenticationType;
return this;
}
/**
* Get the username property: Username to access the SAP HANA server. Type: string (or Expression with resultType
* string).
*
* @return the username value.
*/
public Object username() {
return this.username;
}
/**
* Set the username property: Username to access the SAP HANA server. Type: string (or Expression with resultType
* string).
*
* @param username the username value to set.
* @return the SapHanaLinkedServiceProperties object itself.
*/
public SapHanaLinkedServiceProperties withUsername(Object username) {
this.username = username;
return this;
}
/**
* Get the password property: Password to access the SAP HANA server.
*
* @return the password value.
*/
public SecretBase password() {
return this.password;
}
/**
* Set the password property: Password to access the SAP HANA server.
*
* @param password the password value to set.
* @return the SapHanaLinkedServiceProperties object itself.
*/
public SapHanaLinkedServiceProperties withPassword(SecretBase password) {
this.password = password;
return this;
}
/**
* Get the encryptedCredential property: The encrypted credential used for authentication. Credentials are encrypted
* using the integration runtime credential manager. Type: string.
*
* @return the encryptedCredential value.
*/
public String encryptedCredential() {
return this.encryptedCredential;
}
/**
* Set the encryptedCredential property: The encrypted credential used for authentication. Credentials are encrypted
* using the integration runtime credential manager. Type: string.
*
* @param encryptedCredential the encryptedCredential value to set.
* @return the SapHanaLinkedServiceProperties object itself.
*/
public SapHanaLinkedServiceProperties withEncryptedCredential(String encryptedCredential) {
this.encryptedCredential = encryptedCredential;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (password() != null) {
password().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeUntypedField("connectionString", this.connectionString);
jsonWriter.writeUntypedField("server", this.server);
jsonWriter.writeStringField("authenticationType",
this.authenticationType == null ? null : this.authenticationType.toString());
jsonWriter.writeUntypedField("userName", this.username);
jsonWriter.writeJsonField("password", this.password);
jsonWriter.writeStringField("encryptedCredential", this.encryptedCredential);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of SapHanaLinkedServiceProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of SapHanaLinkedServiceProperties 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 SapHanaLinkedServiceProperties.
*/
public static SapHanaLinkedServiceProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
SapHanaLinkedServiceProperties deserializedSapHanaLinkedServiceProperties
= new SapHanaLinkedServiceProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("connectionString".equals(fieldName)) {
deserializedSapHanaLinkedServiceProperties.connectionString = reader.readUntyped();
} else if ("server".equals(fieldName)) {
deserializedSapHanaLinkedServiceProperties.server = reader.readUntyped();
} else if ("authenticationType".equals(fieldName)) {
deserializedSapHanaLinkedServiceProperties.authenticationType
= SapHanaAuthenticationType.fromString(reader.getString());
} else if ("userName".equals(fieldName)) {
deserializedSapHanaLinkedServiceProperties.username = reader.readUntyped();
} else if ("password".equals(fieldName)) {
deserializedSapHanaLinkedServiceProperties.password = SecretBase.fromJson(reader);
} else if ("encryptedCredential".equals(fieldName)) {
deserializedSapHanaLinkedServiceProperties.encryptedCredential = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedSapHanaLinkedServiceProperties;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy