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

com.azure.resourcemanager.datafactory.models.ExposureControlRequest 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.datafactory.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;

/**
 * The exposure control request.
 */
@Fluent
public final class ExposureControlRequest implements JsonSerializable {
    /*
     * The feature name.
     */
    private String featureName;

    /*
     * The feature type.
     */
    private String featureType;

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

    /**
     * Get the featureName property: The feature name.
     * 
     * @return the featureName value.
     */
    public String featureName() {
        return this.featureName;
    }

    /**
     * Set the featureName property: The feature name.
     * 
     * @param featureName the featureName value to set.
     * @return the ExposureControlRequest object itself.
     */
    public ExposureControlRequest withFeatureName(String featureName) {
        this.featureName = featureName;
        return this;
    }

    /**
     * Get the featureType property: The feature type.
     * 
     * @return the featureType value.
     */
    public String featureType() {
        return this.featureType;
    }

    /**
     * Set the featureType property: The feature type.
     * 
     * @param featureType the featureType value to set.
     * @return the ExposureControlRequest object itself.
     */
    public ExposureControlRequest withFeatureType(String featureType) {
        this.featureType = featureType;
        return this;
    }

    /**
     * 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("featureName", this.featureName);
        jsonWriter.writeStringField("featureType", this.featureType);
        return jsonWriter.writeEndObject();
    }

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

                if ("featureName".equals(fieldName)) {
                    deserializedExposureControlRequest.featureName = reader.getString();
                } else if ("featureType".equals(fieldName)) {
                    deserializedExposureControlRequest.featureType = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedExposureControlRequest;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy