// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.networkcloud.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.networkcloud.fluent.models.ConsolePatchProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.Map;

/** ConsolePatchParameters represents the body of the request to patch the virtual machine console. */
@Fluent
public final class ConsolePatchParameters {
    /*
     * ConsolePatchProperties represents the properties of the virtual machine console that can be patched.
     *
     * The list of the resource properties.
     */
    @JsonProperty(value = "properties")
    private ConsolePatchProperties innerProperties;

    /*
     * The Azure resource tags that will replace the existing ones.
     */
    @JsonProperty(value = "tags")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> tags;

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

    /**
     * Get the innerProperties property: ConsolePatchProperties represents the properties of the virtual machine console
     * that can be patched.
     *
     * <p>The list of the resource properties.
     *
     * @return the innerProperties value.
     */
    private ConsolePatchProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the tags property: The Azure resource tags that will replace the existing ones.
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.tags;
    }

    /**
     * Set the tags property: The Azure resource tags that will replace the existing ones.
     *
     * @param tags the tags value to set.
     * @return the ConsolePatchParameters object itself.
     */
    public ConsolePatchParameters withTags(Map<String, String> tags) {
        this.tags = tags;
        return this;
    }

    /**
     * Get the enabled property: The credentials used to login to the image repository that has access to the specified
     * image.
     *
     * @return the enabled value.
     */
    public ConsoleEnabled enabled() {
        return this.innerProperties() == null ? null : this.innerProperties().enabled();
    }

    /**
     * Set the enabled property: The credentials used to login to the image repository that has access to the specified
     * image.
     *
     * @param enabled the enabled value to set.
     * @return the ConsolePatchParameters object itself.
     */
    public ConsolePatchParameters withEnabled(ConsoleEnabled enabled) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ConsolePatchProperties();
        }
        this.innerProperties().withEnabled(enabled);
        return this;
    }

    /**
     * Get the expiration property: The date and time after which the key will be disallowed access.
     *
     * @return the expiration value.
     */
    public OffsetDateTime expiration() {
        return this.innerProperties() == null ? null : this.innerProperties().expiration();
    }

    /**
     * Set the expiration property: The date and time after which the key will be disallowed access.
     *
     * @param expiration the expiration value to set.
     * @return the ConsolePatchParameters object itself.
     */
    public ConsolePatchParameters withExpiration(OffsetDateTime expiration) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ConsolePatchProperties();
        }
        this.innerProperties().withExpiration(expiration);
        return this;
    }

    /**
     * Get the sshPublicKey property: SshPublicKey represents the public key used to authenticate with a resource
     * through SSH.
     *
     * <p>The SSH public key that will be provisioned for user access. The user is expected to have the corresponding
     * SSH private key for logging in.
     *
     * @return the sshPublicKey value.
     */
    public SshPublicKey sshPublicKey() {
        return this.innerProperties() == null ? null : this.innerProperties().sshPublicKey();
    }

    /**
     * Set the sshPublicKey property: SshPublicKey represents the public key used to authenticate with a resource
     * through SSH.
     *
     * <p>The SSH public key that will be provisioned for user access. The user is expected to have the corresponding
     * SSH private key for logging in.
     *
     * @param sshPublicKey the sshPublicKey value to set.
     * @return the ConsolePatchParameters object itself.
     */
    public ConsolePatchParameters withSshPublicKey(SshPublicKey sshPublicKey) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ConsolePatchProperties();
        }
        this.innerProperties().withSshPublicKey(sshPublicKey);
        return this;
    }

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