
com.azure.resourcemanager.network.models.PrivateLinkServiceConnection 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.network.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.management.SubResource;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.network.fluent.models.PrivateLinkServiceConnectionProperties;
import java.io.IOException;
import java.util.List;
/**
* PrivateLinkServiceConnection resource.
*/
@Fluent
public final class PrivateLinkServiceConnection extends SubResource {
/*
* Properties of the private link service connection.
*/
private PrivateLinkServiceConnectionProperties innerProperties;
/*
* The name of the resource that is unique within a resource group. This name can be used to access the resource.
*/
private String name;
/*
* The resource type.
*/
private String type;
/*
* A unique read-only string that changes whenever the resource is updated.
*/
private String etag;
/**
* Creates an instance of PrivateLinkServiceConnection class.
*/
public PrivateLinkServiceConnection() {
}
/**
* Get the innerProperties property: Properties of the private link service connection.
*
* @return the innerProperties value.
*/
private PrivateLinkServiceConnectionProperties innerProperties() {
return this.innerProperties;
}
/**
* Get the name property: The name of the resource that is unique within a resource group. This name can be used to
* access the resource.
*
* @return the name value.
*/
public String name() {
return this.name;
}
/**
* Set the name property: The name of the resource that is unique within a resource group. This name can be used to
* access the resource.
*
* @param name the name value to set.
* @return the PrivateLinkServiceConnection object itself.
*/
public PrivateLinkServiceConnection withName(String name) {
this.name = name;
return this;
}
/**
* Get the type property: The resource type.
*
* @return the type value.
*/
public String type() {
return this.type;
}
/**
* Get the etag property: A unique read-only string that changes whenever the resource is updated.
*
* @return the etag value.
*/
public String etag() {
return this.etag;
}
/**
* {@inheritDoc}
*/
@Override
public PrivateLinkServiceConnection withId(String id) {
super.withId(id);
return this;
}
/**
* Get the provisioningState property: The provisioning state of the private link service connection resource.
*
* @return the provisioningState value.
*/
public ProvisioningState provisioningState() {
return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
}
/**
* Get the privateLinkServiceId property: The resource id of private link service.
*
* @return the privateLinkServiceId value.
*/
public String privateLinkServiceId() {
return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceId();
}
/**
* Set the privateLinkServiceId property: The resource id of private link service.
*
* @param privateLinkServiceId the privateLinkServiceId value to set.
* @return the PrivateLinkServiceConnection object itself.
*/
public PrivateLinkServiceConnection withPrivateLinkServiceId(String privateLinkServiceId) {
if (this.innerProperties() == null) {
this.innerProperties = new PrivateLinkServiceConnectionProperties();
}
this.innerProperties().withPrivateLinkServiceId(privateLinkServiceId);
return this;
}
/**
* Get the groupIds property: The ID(s) of the group(s) obtained from the remote resource that this private endpoint
* should connect to.
*
* @return the groupIds value.
*/
public List groupIds() {
return this.innerProperties() == null ? null : this.innerProperties().groupIds();
}
/**
* Set the groupIds property: The ID(s) of the group(s) obtained from the remote resource that this private endpoint
* should connect to.
*
* @param groupIds the groupIds value to set.
* @return the PrivateLinkServiceConnection object itself.
*/
public PrivateLinkServiceConnection withGroupIds(List groupIds) {
if (this.innerProperties() == null) {
this.innerProperties = new PrivateLinkServiceConnectionProperties();
}
this.innerProperties().withGroupIds(groupIds);
return this;
}
/**
* Get the requestMessage property: A message passed to the owner of the remote resource with this connection
* request. Restricted to 140 chars.
*
* @return the requestMessage value.
*/
public String requestMessage() {
return this.innerProperties() == null ? null : this.innerProperties().requestMessage();
}
/**
* Set the requestMessage property: A message passed to the owner of the remote resource with this connection
* request. Restricted to 140 chars.
*
* @param requestMessage the requestMessage value to set.
* @return the PrivateLinkServiceConnection object itself.
*/
public PrivateLinkServiceConnection withRequestMessage(String requestMessage) {
if (this.innerProperties() == null) {
this.innerProperties = new PrivateLinkServiceConnectionProperties();
}
this.innerProperties().withRequestMessage(requestMessage);
return this;
}
/**
* Get the privateLinkServiceConnectionState property: A collection of read-only information about the state of the
* connection to the remote resource.
*
* @return the privateLinkServiceConnectionState value.
*/
public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() {
return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState();
}
/**
* Set the privateLinkServiceConnectionState property: A collection of read-only information about the state of the
* connection to the remote resource.
*
* @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set.
* @return the PrivateLinkServiceConnection object itself.
*/
public PrivateLinkServiceConnection
withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) {
if (this.innerProperties() == null) {
this.innerProperties = new PrivateLinkServiceConnectionProperties();
}
this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState);
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (innerProperties() != null) {
innerProperties().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("id", id());
jsonWriter.writeJsonField("properties", this.innerProperties);
jsonWriter.writeStringField("name", this.name);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of PrivateLinkServiceConnection from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of PrivateLinkServiceConnection 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 PrivateLinkServiceConnection.
*/
public static PrivateLinkServiceConnection fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
PrivateLinkServiceConnection deserializedPrivateLinkServiceConnection = new PrivateLinkServiceConnection();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("id".equals(fieldName)) {
deserializedPrivateLinkServiceConnection.withId(reader.getString());
} else if ("properties".equals(fieldName)) {
deserializedPrivateLinkServiceConnection.innerProperties
= PrivateLinkServiceConnectionProperties.fromJson(reader);
} else if ("name".equals(fieldName)) {
deserializedPrivateLinkServiceConnection.name = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedPrivateLinkServiceConnection.type = reader.getString();
} else if ("etag".equals(fieldName)) {
deserializedPrivateLinkServiceConnection.etag = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedPrivateLinkServiceConnection;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy