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

com.azure.resourcemanager.search.models.PrivateLinkResourceProperties Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure Cognitive Search Management SDK. For documentation on how to use this package, please see https://aka.ms/azure-sdk-java-mgmt

There is a newer version: 2.45.0
Show newest version
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.search.models;

import com.azure.core.annotation.Immutable;
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.List;

/**
 * Describes the properties of a supported private link resource for the search service. For a given API version, this
 * represents the 'supported' groupIds when creating a shared private link resource.
 */
@Immutable
public final class PrivateLinkResourceProperties implements JsonSerializable {
    /*
     * The group ID of the private link resource.
     */
    private String groupId;

    /*
     * The list of required members of the private link resource.
     */
    private List requiredMembers;

    /*
     * The list of required DNS zone names of the private link resource.
     */
    private List requiredZoneNames;

    /*
     * The list of resources that are onboarded to private link service and that are supported by search.
     */
    private List shareablePrivateLinkResourceTypes;

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

    /**
     * Get the groupId property: The group ID of the private link resource.
     * 
     * @return the groupId value.
     */
    public String groupId() {
        return this.groupId;
    }

    /**
     * Get the requiredMembers property: The list of required members of the private link resource.
     * 
     * @return the requiredMembers value.
     */
    public List requiredMembers() {
        return this.requiredMembers;
    }

    /**
     * Get the requiredZoneNames property: The list of required DNS zone names of the private link resource.
     * 
     * @return the requiredZoneNames value.
     */
    public List requiredZoneNames() {
        return this.requiredZoneNames;
    }

    /**
     * Get the shareablePrivateLinkResourceTypes property: The list of resources that are onboarded to private link
     * service and that are supported by search.
     * 
     * @return the shareablePrivateLinkResourceTypes value.
     */
    public List shareablePrivateLinkResourceTypes() {
        return this.shareablePrivateLinkResourceTypes;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (shareablePrivateLinkResourceTypes() != null) {
            shareablePrivateLinkResourceTypes().forEach(e -> e.validate());
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        return jsonWriter.writeEndObject();
    }

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

                if ("groupId".equals(fieldName)) {
                    deserializedPrivateLinkResourceProperties.groupId = reader.getString();
                } else if ("requiredMembers".equals(fieldName)) {
                    List requiredMembers = reader.readArray(reader1 -> reader1.getString());
                    deserializedPrivateLinkResourceProperties.requiredMembers = requiredMembers;
                } else if ("requiredZoneNames".equals(fieldName)) {
                    List requiredZoneNames = reader.readArray(reader1 -> reader1.getString());
                    deserializedPrivateLinkResourceProperties.requiredZoneNames = requiredZoneNames;
                } else if ("shareablePrivateLinkResourceTypes".equals(fieldName)) {
                    List shareablePrivateLinkResourceTypes
                        = reader.readArray(reader1 -> ShareablePrivateLinkResourceType.fromJson(reader1));
                    deserializedPrivateLinkResourceProperties.shareablePrivateLinkResourceTypes
                        = shareablePrivateLinkResourceTypes;
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedPrivateLinkResourceProperties;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy