com.azure.resourcemanager.servicebus.models.ResourceNamespacePatch Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-servicebus Show documentation
Show all versions of azure-resourcemanager-servicebus Show documentation
This package contains Microsoft Azure ServiceBus Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.servicebus.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.util.Map;
/**
* The Resource definition.
*/
@Fluent
public class ResourceNamespacePatch extends ProxyResource {
/*
* Resource location
*/
private String location;
/*
* Resource tags
*/
private Map tags;
/*
* Fully qualified resource Id for the resource.
*/
private String id;
/*
* The name of the resource.
*/
private String name;
/*
* The type of the resource.
*/
private String type;
/**
* Creates an instance of ResourceNamespacePatch class.
*/
public ResourceNamespacePatch() {
}
/**
* Get the location property: Resource location.
*
* @return the location value.
*/
public String location() {
return this.location;
}
/**
* Set the location property: Resource location.
*
* @param location the location value to set.
* @return the ResourceNamespacePatch object itself.
*/
public ResourceNamespacePatch withLocation(String location) {
this.location = location;
return this;
}
/**
* Get the tags property: Resource tags.
*
* @return the tags value.
*/
public Map tags() {
return this.tags;
}
/**
* Set the tags property: Resource tags.
*
* @param tags the tags value to set.
* @return the ResourceNamespacePatch object itself.
*/
public ResourceNamespacePatch withTags(Map tags) {
this.tags = tags;
return this;
}
/**
* Get the id property: Fully qualified resource Id for the resource.
*
* @return the id value.
*/
@Override
public String id() {
return this.id;
}
/**
* Get the name property: The name of the resource.
*
* @return the name value.
*/
@Override
public String name() {
return this.name;
}
/**
* Get the type property: The type of the resource.
*
* @return the type value.
*/
@Override
public String type() {
return this.type;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("location", this.location);
jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element));
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of ResourceNamespacePatch from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ResourceNamespacePatch 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 ResourceNamespacePatch.
*/
public static ResourceNamespacePatch fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ResourceNamespacePatch deserializedResourceNamespacePatch = new ResourceNamespacePatch();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("id".equals(fieldName)) {
deserializedResourceNamespacePatch.id = reader.getString();
} else if ("name".equals(fieldName)) {
deserializedResourceNamespacePatch.name = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedResourceNamespacePatch.type = reader.getString();
} else if ("location".equals(fieldName)) {
deserializedResourceNamespacePatch.location = reader.getString();
} else if ("tags".equals(fieldName)) {
Map tags = reader.readMap(reader1 -> reader1.getString());
deserializedResourceNamespacePatch.tags = tags;
} else {
reader.skipChildren();
}
}
return deserializedResourceNamespacePatch;
});
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy