
com.azure.resourcemanager.datafactory.models.PrivateLinkConnectionApprovalRequest 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.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;
/**
* A request to approve or reject a private endpoint connection.
*/
@Fluent
public final class PrivateLinkConnectionApprovalRequest
implements JsonSerializable {
/*
* The state of a private link connection
*/
private PrivateLinkConnectionState privateLinkServiceConnectionState;
/*
* The resource of private endpoint.
*/
private PrivateEndpoint privateEndpoint;
/**
* Creates an instance of PrivateLinkConnectionApprovalRequest class.
*/
public PrivateLinkConnectionApprovalRequest() {
}
/**
* Get the privateLinkServiceConnectionState property: The state of a private link connection.
*
* @return the privateLinkServiceConnectionState value.
*/
public PrivateLinkConnectionState privateLinkServiceConnectionState() {
return this.privateLinkServiceConnectionState;
}
/**
* Set the privateLinkServiceConnectionState property: The state of a private link connection.
*
* @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set.
* @return the PrivateLinkConnectionApprovalRequest object itself.
*/
public PrivateLinkConnectionApprovalRequest
withPrivateLinkServiceConnectionState(PrivateLinkConnectionState privateLinkServiceConnectionState) {
this.privateLinkServiceConnectionState = privateLinkServiceConnectionState;
return this;
}
/**
* Get the privateEndpoint property: The resource of private endpoint.
*
* @return the privateEndpoint value.
*/
public PrivateEndpoint privateEndpoint() {
return this.privateEndpoint;
}
/**
* Set the privateEndpoint property: The resource of private endpoint.
*
* @param privateEndpoint the privateEndpoint value to set.
* @return the PrivateLinkConnectionApprovalRequest object itself.
*/
public PrivateLinkConnectionApprovalRequest withPrivateEndpoint(PrivateEndpoint privateEndpoint) {
this.privateEndpoint = privateEndpoint;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (privateLinkServiceConnectionState() != null) {
privateLinkServiceConnectionState().validate();
}
if (privateEndpoint() != null) {
privateEndpoint().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState);
jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of PrivateLinkConnectionApprovalRequest from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of PrivateLinkConnectionApprovalRequest 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 PrivateLinkConnectionApprovalRequest.
*/
public static PrivateLinkConnectionApprovalRequest fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
PrivateLinkConnectionApprovalRequest deserializedPrivateLinkConnectionApprovalRequest
= new PrivateLinkConnectionApprovalRequest();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("privateLinkServiceConnectionState".equals(fieldName)) {
deserializedPrivateLinkConnectionApprovalRequest.privateLinkServiceConnectionState
= PrivateLinkConnectionState.fromJson(reader);
} else if ("privateEndpoint".equals(fieldName)) {
deserializedPrivateLinkConnectionApprovalRequest.privateEndpoint = PrivateEndpoint.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedPrivateLinkConnectionApprovalRequest;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy