com.azure.resourcemanager.hybridcompute.models.PrivateEndpointConnectionDataModel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-hybridcompute Show documentation
Show all versions of azure-resourcemanager-hybridcompute Show documentation
This package contains Microsoft Azure SDK for HybridCompute Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Hybrid Compute Management Client. Package tag package-preview-2024-05.
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.resourcemanager.hybridcompute.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;
/**
* The Data Model for a Private Endpoint Connection associated with a Private Link Scope.
*/
@Fluent
public final class PrivateEndpointConnectionDataModel implements JsonSerializable {
/*
* The ARM Resource Id of the Private Endpoint.
*/
private String id;
/*
* The Name of the Private Endpoint.
*/
private String name;
/*
* Azure resource type
*/
private String type;
/*
* The Private Endpoint Connection properties.
*/
private PrivateEndpointConnectionProperties properties;
/**
* Creates an instance of PrivateEndpointConnectionDataModel class.
*/
public PrivateEndpointConnectionDataModel() {
}
/**
* Get the id property: The ARM Resource Id of the Private Endpoint.
*
* @return the id value.
*/
public String id() {
return this.id;
}
/**
* Get the name property: The Name of the Private Endpoint.
*
* @return the name value.
*/
public String name() {
return this.name;
}
/**
* Get the type property: Azure resource type.
*
* @return the type value.
*/
public String type() {
return this.type;
}
/**
* Get the properties property: The Private Endpoint Connection properties.
*
* @return the properties value.
*/
public PrivateEndpointConnectionProperties properties() {
return this.properties;
}
/**
* Set the properties property: The Private Endpoint Connection properties.
*
* @param properties the properties value to set.
* @return the PrivateEndpointConnectionDataModel object itself.
*/
public PrivateEndpointConnectionDataModel withProperties(PrivateEndpointConnectionProperties properties) {
this.properties = properties;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (properties() != null) {
properties().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("properties", this.properties);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of PrivateEndpointConnectionDataModel from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of PrivateEndpointConnectionDataModel 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 PrivateEndpointConnectionDataModel.
*/
public static PrivateEndpointConnectionDataModel fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
PrivateEndpointConnectionDataModel deserializedPrivateEndpointConnectionDataModel
= new PrivateEndpointConnectionDataModel();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("id".equals(fieldName)) {
deserializedPrivateEndpointConnectionDataModel.id = reader.getString();
} else if ("name".equals(fieldName)) {
deserializedPrivateEndpointConnectionDataModel.name = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedPrivateEndpointConnectionDataModel.type = reader.getString();
} else if ("properties".equals(fieldName)) {
deserializedPrivateEndpointConnectionDataModel.properties
= PrivateEndpointConnectionProperties.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedPrivateEndpointConnectionDataModel;
});
}
}