com.azure.resourcemanager.webpubsub.models.WebPubSubTlsSettings 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.webpubsub.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;
/**
* TLS settings for the resource.
*/
@Fluent
public final class WebPubSubTlsSettings implements JsonSerializable {
/*
* Request client certificate during TLS handshake if enabled. Not supported for free tier. Any input will be
* ignored for free tier.
*/
private Boolean clientCertEnabled;
/**
* Creates an instance of WebPubSubTlsSettings class.
*/
public WebPubSubTlsSettings() {
}
/**
* Get the clientCertEnabled property: Request client certificate during TLS handshake if enabled. Not supported for
* free tier. Any input will be ignored for free tier.
*
* @return the clientCertEnabled value.
*/
public Boolean clientCertEnabled() {
return this.clientCertEnabled;
}
/**
* Set the clientCertEnabled property: Request client certificate during TLS handshake if enabled. Not supported for
* free tier. Any input will be ignored for free tier.
*
* @param clientCertEnabled the clientCertEnabled value to set.
* @return the WebPubSubTlsSettings object itself.
*/
public WebPubSubTlsSettings withClientCertEnabled(Boolean clientCertEnabled) {
this.clientCertEnabled = clientCertEnabled;
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.writeBooleanField("clientCertEnabled", this.clientCertEnabled);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of WebPubSubTlsSettings from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of WebPubSubTlsSettings 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 WebPubSubTlsSettings.
*/
public static WebPubSubTlsSettings fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
WebPubSubTlsSettings deserializedWebPubSubTlsSettings = new WebPubSubTlsSettings();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("clientCertEnabled".equals(fieldName)) {
deserializedWebPubSubTlsSettings.clientCertEnabled = reader.getNullable(JsonReader::getBoolean);
} else {
reader.skipChildren();
}
}
return deserializedWebPubSubTlsSettings;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy