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

com.azure.resourcemanager.servicelinker.models.LinkerPatch 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.servicelinker.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 com.azure.resourcemanager.servicelinker.fluent.models.LinkerProperties;
import java.io.IOException;

/**
 * A Linker to be updated.
 */
@Fluent
public final class LinkerPatch implements JsonSerializable {
    /*
     * Linker properties
     */
    private LinkerProperties innerProperties;

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

    /**
     * Get the innerProperties property: Linker properties.
     * 
     * @return the innerProperties value.
     */
    private LinkerProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the targetService property: The target service properties.
     * 
     * @return the targetService value.
     */
    public TargetServiceBase targetService() {
        return this.innerProperties() == null ? null : this.innerProperties().targetService();
    }

    /**
     * Set the targetService property: The target service properties.
     * 
     * @param targetService the targetService value to set.
     * @return the LinkerPatch object itself.
     */
    public LinkerPatch withTargetService(TargetServiceBase targetService) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LinkerProperties();
        }
        this.innerProperties().withTargetService(targetService);
        return this;
    }

    /**
     * Get the authInfo property: The authentication type.
     * 
     * @return the authInfo value.
     */
    public AuthInfoBase authInfo() {
        return this.innerProperties() == null ? null : this.innerProperties().authInfo();
    }

    /**
     * Set the authInfo property: The authentication type.
     * 
     * @param authInfo the authInfo value to set.
     * @return the LinkerPatch object itself.
     */
    public LinkerPatch withAuthInfo(AuthInfoBase authInfo) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LinkerProperties();
        }
        this.innerProperties().withAuthInfo(authInfo);
        return this;
    }

    /**
     * Get the clientType property: The application client type.
     * 
     * @return the clientType value.
     */
    public ClientType clientType() {
        return this.innerProperties() == null ? null : this.innerProperties().clientType();
    }

    /**
     * Set the clientType property: The application client type.
     * 
     * @param clientType the clientType value to set.
     * @return the LinkerPatch object itself.
     */
    public LinkerPatch withClientType(ClientType clientType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LinkerProperties();
        }
        this.innerProperties().withClientType(clientType);
        return this;
    }

    /**
     * Get the provisioningState property: The provisioning state.
     * 
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Get the vNetSolution property: The VNet solution.
     * 
     * @return the vNetSolution value.
     */
    public VNetSolution vNetSolution() {
        return this.innerProperties() == null ? null : this.innerProperties().vNetSolution();
    }

    /**
     * Set the vNetSolution property: The VNet solution.
     * 
     * @param vNetSolution the vNetSolution value to set.
     * @return the LinkerPatch object itself.
     */
    public LinkerPatch withVNetSolution(VNetSolution vNetSolution) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LinkerProperties();
        }
        this.innerProperties().withVNetSolution(vNetSolution);
        return this;
    }

    /**
     * Get the secretStore property: An option to store secret value in secure place.
     * 
     * @return the secretStore value.
     */
    public SecretStore secretStore() {
        return this.innerProperties() == null ? null : this.innerProperties().secretStore();
    }

    /**
     * Set the secretStore property: An option to store secret value in secure place.
     * 
     * @param secretStore the secretStore value to set.
     * @return the LinkerPatch object itself.
     */
    public LinkerPatch withSecretStore(SecretStore secretStore) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LinkerProperties();
        }
        this.innerProperties().withSecretStore(secretStore);
        return this;
    }

    /**
     * Get the scope property: connection scope in source service.
     * 
     * @return the scope value.
     */
    public String scope() {
        return this.innerProperties() == null ? null : this.innerProperties().scope();
    }

    /**
     * Set the scope property: connection scope in source service.
     * 
     * @param scope the scope value to set.
     * @return the LinkerPatch object itself.
     */
    public LinkerPatch withScope(String scope) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LinkerProperties();
        }
        this.innerProperties().withScope(scope);
        return this;
    }

    /**
     * Get the publicNetworkSolution property: The network solution.
     * 
     * @return the publicNetworkSolution value.
     */
    public PublicNetworkSolution publicNetworkSolution() {
        return this.innerProperties() == null ? null : this.innerProperties().publicNetworkSolution();
    }

    /**
     * Set the publicNetworkSolution property: The network solution.
     * 
     * @param publicNetworkSolution the publicNetworkSolution value to set.
     * @return the LinkerPatch object itself.
     */
    public LinkerPatch withPublicNetworkSolution(PublicNetworkSolution publicNetworkSolution) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LinkerProperties();
        }
        this.innerProperties().withPublicNetworkSolution(publicNetworkSolution);
        return this;
    }

    /**
     * Get the configurationInfo property: The connection information consumed by applications, including secrets,
     * connection strings.
     * 
     * @return the configurationInfo value.
     */
    public ConfigurationInfo configurationInfo() {
        return this.innerProperties() == null ? null : this.innerProperties().configurationInfo();
    }

    /**
     * Set the configurationInfo property: The connection information consumed by applications, including secrets,
     * connection strings.
     * 
     * @param configurationInfo the configurationInfo value to set.
     * @return the LinkerPatch object itself.
     */
    public LinkerPatch withConfigurationInfo(ConfigurationInfo configurationInfo) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LinkerProperties();
        }
        this.innerProperties().withConfigurationInfo(configurationInfo);
        return this;
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeJsonField("properties", this.innerProperties);
        return jsonWriter.writeEndObject();
    }

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

                if ("properties".equals(fieldName)) {
                    deserializedLinkerPatch.innerProperties = LinkerProperties.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedLinkerPatch;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy