All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.healthdataaiservices.models.DeidUpdate Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for Health Data AI Services Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt.

The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.resourcemanager.healthdataaiservices.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;
import java.util.Map;

/**
 * Patch request body for DeidService.
 */
@Fluent
public final class DeidUpdate implements JsonSerializable {
    /*
     * Resource tags.
     */
    private Map tags;

    /*
     * Updatable managed service identity
     */
    private ManagedServiceIdentityUpdate identity;

    /*
     * RP-specific properties
     */
    private DeidPropertiesUpdate properties;

    /**
     * Creates an instance of DeidUpdate class.
     */
    public DeidUpdate() {
    }

    /**
     * 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 DeidUpdate object itself.
     */
    public DeidUpdate withTags(Map tags) {
        this.tags = tags;
        return this;
    }

    /**
     * Get the identity property: Updatable managed service identity.
     * 
     * @return the identity value.
     */
    public ManagedServiceIdentityUpdate identity() {
        return this.identity;
    }

    /**
     * Set the identity property: Updatable managed service identity.
     * 
     * @param identity the identity value to set.
     * @return the DeidUpdate object itself.
     */
    public DeidUpdate withIdentity(ManagedServiceIdentityUpdate identity) {
        this.identity = identity;
        return this;
    }

    /**
     * Get the properties property: RP-specific properties.
     * 
     * @return the properties value.
     */
    public DeidPropertiesUpdate properties() {
        return this.properties;
    }

    /**
     * Set the properties property: RP-specific properties.
     * 
     * @param properties the properties value to set.
     * @return the DeidUpdate object itself.
     */
    public DeidUpdate withProperties(DeidPropertiesUpdate properties) {
        this.properties = properties;
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (identity() != null) {
            identity().validate();
        }
        if (properties() != null) {
            properties().validate();
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element));
        jsonWriter.writeJsonField("identity", this.identity);
        jsonWriter.writeJsonField("properties", this.properties);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of DeidUpdate from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of DeidUpdate 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 DeidUpdate.
     */
    public static DeidUpdate fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            DeidUpdate deserializedDeidUpdate = new DeidUpdate();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("tags".equals(fieldName)) {
                    Map tags = reader.readMap(reader1 -> reader1.getString());
                    deserializedDeidUpdate.tags = tags;
                } else if ("identity".equals(fieldName)) {
                    deserializedDeidUpdate.identity = ManagedServiceIdentityUpdate.fromJson(reader);
                } else if ("properties".equals(fieldName)) {
                    deserializedDeidUpdate.properties = DeidPropertiesUpdate.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedDeidUpdate;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy