
com.azure.resourcemanager.devcenter.fluent.models.DevCenterInner 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.DevCenterProjectCatalogSettings;
import com.azure.resourcemanager.devcenter.models.Encryption;
import com.azure.resourcemanager.devcenter.models.ManagedServiceIdentity;
import com.azure.resourcemanager.devcenter.models.ProvisioningState;
import java.io.IOException;
import java.util.Map;
/**
* Represents a devcenter resource.
*/
@Fluent
public final class DevCenterInner extends Resource {
/*
* DevCenter properties
*/
private DevCenterProperties innerProperties;
/*
* Managed identity properties
*/
private ManagedServiceIdentity identity;
/*
* 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 DevCenterInner class.
*/
public DevCenterInner() {
}
/**
* Get the innerProperties property: DevCenter properties.
*
* @return the innerProperties value.
*/
private DevCenterProperties innerProperties() {
return this.innerProperties;
}
/**
* Get the identity property: Managed identity properties.
*
* @return the identity value.
*/
public ManagedServiceIdentity identity() {
return this.identity;
}
/**
* Set the identity property: Managed identity properties.
*
* @param identity the identity value to set.
* @return the DevCenterInner object itself.
*/
public DevCenterInner withIdentity(ManagedServiceIdentity identity) {
this.identity = identity;
return this;
}
/**
* 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 DevCenterInner withLocation(String location) {
super.withLocation(location);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public DevCenterInner 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 devCenterUri property: The URI of the Dev Center.
*
* @return the devCenterUri value.
*/
public String devCenterUri() {
return this.innerProperties() == null ? null : this.innerProperties().devCenterUri();
}
/**
* Get the encryption property: Encryption settings to be used for server-side encryption for proprietary content
* (such as catalogs, logs, customizations).
*
* @return the encryption value.
*/
public Encryption encryption() {
return this.innerProperties() == null ? null : this.innerProperties().encryption();
}
/**
* Set the encryption property: Encryption settings to be used for server-side encryption for proprietary content
* (such as catalogs, logs, customizations).
*
* @param encryption the encryption value to set.
* @return the DevCenterInner object itself.
*/
public DevCenterInner withEncryption(Encryption encryption) {
if (this.innerProperties() == null) {
this.innerProperties = new DevCenterProperties();
}
this.innerProperties().withEncryption(encryption);
return this;
}
/**
* Get the displayName property: The display name of the devcenter.
*
* @return the displayName value.
*/
public String displayName() {
return this.innerProperties() == null ? null : this.innerProperties().displayName();
}
/**
* Set the displayName property: The display name of the devcenter.
*
* @param displayName the displayName value to set.
* @return the DevCenterInner object itself.
*/
public DevCenterInner withDisplayName(String displayName) {
if (this.innerProperties() == null) {
this.innerProperties = new DevCenterProperties();
}
this.innerProperties().withDisplayName(displayName);
return this;
}
/**
* Get the projectCatalogSettings property: Dev Center settings to be used when associating a project with a
* catalog.
*
* @return the projectCatalogSettings value.
*/
public DevCenterProjectCatalogSettings projectCatalogSettings() {
return this.innerProperties() == null ? null : this.innerProperties().projectCatalogSettings();
}
/**
* Set the projectCatalogSettings property: Dev Center settings to be used when associating a project with a
* catalog.
*
* @param projectCatalogSettings the projectCatalogSettings value to set.
* @return the DevCenterInner object itself.
*/
public DevCenterInner withProjectCatalogSettings(DevCenterProjectCatalogSettings projectCatalogSettings) {
if (this.innerProperties() == null) {
this.innerProperties = new DevCenterProperties();
}
this.innerProperties().withProjectCatalogSettings(projectCatalogSettings);
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (innerProperties() != null) {
innerProperties().validate();
}
if (identity() != null) {
identity().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);
jsonWriter.writeJsonField("identity", this.identity);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of DevCenterInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of DevCenterInner 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 DevCenterInner.
*/
public static DevCenterInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
DevCenterInner deserializedDevCenterInner = new DevCenterInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("id".equals(fieldName)) {
deserializedDevCenterInner.id = reader.getString();
} else if ("name".equals(fieldName)) {
deserializedDevCenterInner.name = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedDevCenterInner.type = reader.getString();
} else if ("location".equals(fieldName)) {
deserializedDevCenterInner.withLocation(reader.getString());
} else if ("tags".equals(fieldName)) {
Map tags = reader.readMap(reader1 -> reader1.getString());
deserializedDevCenterInner.withTags(tags);
} else if ("properties".equals(fieldName)) {
deserializedDevCenterInner.innerProperties = DevCenterProperties.fromJson(reader);
} else if ("identity".equals(fieldName)) {
deserializedDevCenterInner.identity = ManagedServiceIdentity.fromJson(reader);
} else if ("systemData".equals(fieldName)) {
deserializedDevCenterInner.systemData = SystemData.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedDevCenterInner;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy