
com.azure.resourcemanager.devcenter.fluent.models.NetworkConnectionInner 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.devcenter.fluent.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.management.SystemData;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.devcenter.models.DomainJoinType;
import com.azure.resourcemanager.devcenter.models.HealthCheckStatus;
import com.azure.resourcemanager.devcenter.models.ProvisioningState;
import java.io.IOException;
import java.util.Map;
/**
* Network related settings.
*/
@Fluent
public final class NetworkConnectionInner extends Resource {
/*
* Properties of a Network Connection
*/
private NetworkProperties innerProperties;
/*
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
*/
private SystemData systemData;
/*
* The type of the resource.
*/
private String type;
/*
* The name of the resource.
*/
private String name;
/*
* Fully qualified resource Id for the resource.
*/
private String id;
/**
* Creates an instance of NetworkConnectionInner class.
*/
public NetworkConnectionInner() {
}
/**
* Get the innerProperties property: Properties of a Network Connection.
*
* @return the innerProperties value.
*/
private NetworkProperties innerProperties() {
return this.innerProperties;
}
/**
* Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
*
* @return the systemData value.
*/
public SystemData systemData() {
return this.systemData;
}
/**
* Get the type property: The type of the resource.
*
* @return the type value.
*/
@Override
public String type() {
return this.type;
}
/**
* Get the name property: The name of the resource.
*
* @return the name value.
*/
@Override
public String name() {
return this.name;
}
/**
* Get the id property: Fully qualified resource Id for the resource.
*
* @return the id value.
*/
@Override
public String id() {
return this.id;
}
/**
* {@inheritDoc}
*/
@Override
public NetworkConnectionInner withLocation(String location) {
super.withLocation(location);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public NetworkConnectionInner withTags(Map tags) {
super.withTags(tags);
return this;
}
/**
* Get the provisioningState property: The provisioning state of the resource.
*
* @return the provisioningState value.
*/
public ProvisioningState provisioningState() {
return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
}
/**
* Get the healthCheckStatus property: Overall health status of the network connection. Health checks are run on
* creation, update, and periodically to validate the network connection.
*
* @return the healthCheckStatus value.
*/
public HealthCheckStatus healthCheckStatus() {
return this.innerProperties() == null ? null : this.innerProperties().healthCheckStatus();
}
/**
* Get the networkingResourceGroupName property: The name for resource group where NICs will be placed.
*
* @return the networkingResourceGroupName value.
*/
public String networkingResourceGroupName() {
return this.innerProperties() == null ? null : this.innerProperties().networkingResourceGroupName();
}
/**
* Set the networkingResourceGroupName property: The name for resource group where NICs will be placed.
*
* @param networkingResourceGroupName the networkingResourceGroupName value to set.
* @return the NetworkConnectionInner object itself.
*/
public NetworkConnectionInner withNetworkingResourceGroupName(String networkingResourceGroupName) {
if (this.innerProperties() == null) {
this.innerProperties = new NetworkProperties();
}
this.innerProperties().withNetworkingResourceGroupName(networkingResourceGroupName);
return this;
}
/**
* Get the domainJoinType property: AAD Join type.
*
* @return the domainJoinType value.
*/
public DomainJoinType domainJoinType() {
return this.innerProperties() == null ? null : this.innerProperties().domainJoinType();
}
/**
* Set the domainJoinType property: AAD Join type.
*
* @param domainJoinType the domainJoinType value to set.
* @return the NetworkConnectionInner object itself.
*/
public NetworkConnectionInner withDomainJoinType(DomainJoinType domainJoinType) {
if (this.innerProperties() == null) {
this.innerProperties = new NetworkProperties();
}
this.innerProperties().withDomainJoinType(domainJoinType);
return this;
}
/**
* Get the subnetId property: The subnet to attach Virtual Machines to.
*
* @return the subnetId value.
*/
public String subnetId() {
return this.innerProperties() == null ? null : this.innerProperties().subnetId();
}
/**
* Set the subnetId property: The subnet to attach Virtual Machines to.
*
* @param subnetId the subnetId value to set.
* @return the NetworkConnectionInner object itself.
*/
public NetworkConnectionInner withSubnetId(String subnetId) {
if (this.innerProperties() == null) {
this.innerProperties = new NetworkProperties();
}
this.innerProperties().withSubnetId(subnetId);
return this;
}
/**
* Get the domainName property: Active Directory domain name.
*
* @return the domainName value.
*/
public String domainName() {
return this.innerProperties() == null ? null : this.innerProperties().domainName();
}
/**
* Set the domainName property: Active Directory domain name.
*
* @param domainName the domainName value to set.
* @return the NetworkConnectionInner object itself.
*/
public NetworkConnectionInner withDomainName(String domainName) {
if (this.innerProperties() == null) {
this.innerProperties = new NetworkProperties();
}
this.innerProperties().withDomainName(domainName);
return this;
}
/**
* Get the organizationUnit property: Active Directory domain Organization Unit (OU).
*
* @return the organizationUnit value.
*/
public String organizationUnit() {
return this.innerProperties() == null ? null : this.innerProperties().organizationUnit();
}
/**
* Set the organizationUnit property: Active Directory domain Organization Unit (OU).
*
* @param organizationUnit the organizationUnit value to set.
* @return the NetworkConnectionInner object itself.
*/
public NetworkConnectionInner withOrganizationUnit(String organizationUnit) {
if (this.innerProperties() == null) {
this.innerProperties = new NetworkProperties();
}
this.innerProperties().withOrganizationUnit(organizationUnit);
return this;
}
/**
* Get the domainUsername property: The username of an Active Directory account (user or service account) that has
* permissions to create computer objects in Active Directory. Required format: admin@contoso.com.
*
* @return the domainUsername value.
*/
public String domainUsername() {
return this.innerProperties() == null ? null : this.innerProperties().domainUsername();
}
/**
* Set the domainUsername property: The username of an Active Directory account (user or service account) that has
* permissions to create computer objects in Active Directory. Required format: admin@contoso.com.
*
* @param domainUsername the domainUsername value to set.
* @return the NetworkConnectionInner object itself.
*/
public NetworkConnectionInner withDomainUsername(String domainUsername) {
if (this.innerProperties() == null) {
this.innerProperties = new NetworkProperties();
}
this.innerProperties().withDomainUsername(domainUsername);
return this;
}
/**
* Get the domainPassword property: The password for the account used to join domain.
*
* @return the domainPassword value.
*/
public String domainPassword() {
return this.innerProperties() == null ? null : this.innerProperties().domainPassword();
}
/**
* Set the domainPassword property: The password for the account used to join domain.
*
* @param domainPassword the domainPassword value to set.
* @return the NetworkConnectionInner object itself.
*/
public NetworkConnectionInner withDomainPassword(String domainPassword) {
if (this.innerProperties() == null) {
this.innerProperties = new NetworkProperties();
}
this.innerProperties().withDomainPassword(domainPassword);
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("location", location());
jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
jsonWriter.writeJsonField("properties", this.innerProperties);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of NetworkConnectionInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of NetworkConnectionInner if the JsonReader was pointing to an instance of it, or null if it
* was pointing to JSON null.
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
* @throws IOException If an error occurs while reading the NetworkConnectionInner.
*/
public static NetworkConnectionInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
NetworkConnectionInner deserializedNetworkConnectionInner = new NetworkConnectionInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("id".equals(fieldName)) {
deserializedNetworkConnectionInner.id = reader.getString();
} else if ("name".equals(fieldName)) {
deserializedNetworkConnectionInner.name = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedNetworkConnectionInner.type = reader.getString();
} else if ("location".equals(fieldName)) {
deserializedNetworkConnectionInner.withLocation(reader.getString());
} else if ("tags".equals(fieldName)) {
Map tags = reader.readMap(reader1 -> reader1.getString());
deserializedNetworkConnectionInner.withTags(tags);
} else if ("properties".equals(fieldName)) {
deserializedNetworkConnectionInner.innerProperties = NetworkProperties.fromJson(reader);
} else if ("systemData".equals(fieldName)) {
deserializedNetworkConnectionInner.systemData = SystemData.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedNetworkConnectionInner;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy