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

com.azure.resourcemanager.azurestackhci.models.SbeCredentials Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for AzureStackHci Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack HCI management service. Package tag package-2024-04.

The 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.azurestackhci.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;

/**
 * secrets used for solution builder extension (SBE) partner extensibility.
 */
@Fluent
public final class SbeCredentials implements JsonSerializable {
    /*
     * secret name stored in keyvault.
     */
    private String secretName;

    /*
     * secret name expected for Enterprise Cloud Engine (ECE).
     */
    private String eceSecretName;

    /*
     * secret URI stored in keyvault.
     */
    private String secretLocation;

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

    /**
     * Get the secretName property: secret name stored in keyvault.
     * 
     * @return the secretName value.
     */
    public String secretName() {
        return this.secretName;
    }

    /**
     * Set the secretName property: secret name stored in keyvault.
     * 
     * @param secretName the secretName value to set.
     * @return the SbeCredentials object itself.
     */
    public SbeCredentials withSecretName(String secretName) {
        this.secretName = secretName;
        return this;
    }

    /**
     * Get the eceSecretName property: secret name expected for Enterprise Cloud Engine (ECE).
     * 
     * @return the eceSecretName value.
     */
    public String eceSecretName() {
        return this.eceSecretName;
    }

    /**
     * Set the eceSecretName property: secret name expected for Enterprise Cloud Engine (ECE).
     * 
     * @param eceSecretName the eceSecretName value to set.
     * @return the SbeCredentials object itself.
     */
    public SbeCredentials withEceSecretName(String eceSecretName) {
        this.eceSecretName = eceSecretName;
        return this;
    }

    /**
     * Get the secretLocation property: secret URI stored in keyvault.
     * 
     * @return the secretLocation value.
     */
    public String secretLocation() {
        return this.secretLocation;
    }

    /**
     * Set the secretLocation property: secret URI stored in keyvault.
     * 
     * @param secretLocation the secretLocation value to set.
     * @return the SbeCredentials object itself.
     */
    public SbeCredentials withSecretLocation(String secretLocation) {
        this.secretLocation = secretLocation;
        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("secretName", this.secretName);
        jsonWriter.writeStringField("eceSecretName", this.eceSecretName);
        jsonWriter.writeStringField("secretLocation", this.secretLocation);
        return jsonWriter.writeEndObject();
    }

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

                if ("secretName".equals(fieldName)) {
                    deserializedSbeCredentials.secretName = reader.getString();
                } else if ("eceSecretName".equals(fieldName)) {
                    deserializedSbeCredentials.eceSecretName = reader.getString();
                } else if ("secretLocation".equals(fieldName)) {
                    deserializedSbeCredentials.secretLocation = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedSbeCredentials;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy