com.azure.resourcemanager.security.fluent.models.ConnectorSettingProperties 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.security.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.security.models.AuthenticationDetailsProperties;
import com.azure.resourcemanager.security.models.HybridComputeSettingsProperties;
import java.io.IOException;
/**
* Describes properties of a connector setting.
*/
@Fluent
public final class ConnectorSettingProperties implements JsonSerializable {
/*
* Settings for hybrid compute management. These settings are relevant only for Arc autoProvision (Hybrid Compute).
*/
private HybridComputeSettingsProperties hybridComputeSettings;
/*
* Settings for authentication management, these settings are relevant only for the cloud connector.
*/
private AuthenticationDetailsProperties authenticationDetails;
/**
* Creates an instance of ConnectorSettingProperties class.
*/
public ConnectorSettingProperties() {
}
/**
* Get the hybridComputeSettings property: Settings for hybrid compute management. These settings are relevant only
* for Arc autoProvision (Hybrid Compute).
*
* @return the hybridComputeSettings value.
*/
public HybridComputeSettingsProperties hybridComputeSettings() {
return this.hybridComputeSettings;
}
/**
* Set the hybridComputeSettings property: Settings for hybrid compute management. These settings are relevant only
* for Arc autoProvision (Hybrid Compute).
*
* @param hybridComputeSettings the hybridComputeSettings value to set.
* @return the ConnectorSettingProperties object itself.
*/
public ConnectorSettingProperties withHybridComputeSettings(HybridComputeSettingsProperties hybridComputeSettings) {
this.hybridComputeSettings = hybridComputeSettings;
return this;
}
/**
* Get the authenticationDetails property: Settings for authentication management, these settings are relevant only
* for the cloud connector.
*
* @return the authenticationDetails value.
*/
public AuthenticationDetailsProperties authenticationDetails() {
return this.authenticationDetails;
}
/**
* Set the authenticationDetails property: Settings for authentication management, these settings are relevant only
* for the cloud connector.
*
* @param authenticationDetails the authenticationDetails value to set.
* @return the ConnectorSettingProperties object itself.
*/
public ConnectorSettingProperties withAuthenticationDetails(AuthenticationDetailsProperties authenticationDetails) {
this.authenticationDetails = authenticationDetails;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (hybridComputeSettings() != null) {
hybridComputeSettings().validate();
}
if (authenticationDetails() != null) {
authenticationDetails().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("hybridComputeSettings", this.hybridComputeSettings);
jsonWriter.writeJsonField("authenticationDetails", this.authenticationDetails);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of ConnectorSettingProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ConnectorSettingProperties 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 ConnectorSettingProperties.
*/
public static ConnectorSettingProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ConnectorSettingProperties deserializedConnectorSettingProperties = new ConnectorSettingProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("hybridComputeSettings".equals(fieldName)) {
deserializedConnectorSettingProperties.hybridComputeSettings
= HybridComputeSettingsProperties.fromJson(reader);
} else if ("authenticationDetails".equals(fieldName)) {
deserializedConnectorSettingProperties.authenticationDetails
= AuthenticationDetailsProperties.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedConnectorSettingProperties;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy