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

package com.azure.resourcemanager.recoveryservicesbackup.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** Base class for restore request. Workload-specific restore requests are derived from this class. */
@Fluent
public final class RestoreRequestResource extends Resource {
    /*
     * RestoreRequestResource properties
     */
    @JsonProperty(value = "properties")
    private RestoreRequest properties;

    /*
     * Optional ETag.
     */
    @JsonProperty(value = "eTag")
    private String etag;

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

    /**
     * Get the properties property: RestoreRequestResource properties.
     *
     * @return the properties value.
     */
    public RestoreRequest properties() {
        return this.properties;
    }

    /**
     * Set the properties property: RestoreRequestResource properties.
     *
     * @param properties the properties value to set.
     * @return the RestoreRequestResource object itself.
     */
    public RestoreRequestResource withProperties(RestoreRequest properties) {
        this.properties = properties;
        return this;
    }

    /**
     * Get the etag property: Optional ETag.
     *
     * @return the etag value.
     */
    public String etag() {
        return this.etag;
    }

    /**
     * Set the etag property: Optional ETag.
     *
     * @param etag the etag value to set.
     * @return the RestoreRequestResource object itself.
     */
    public RestoreRequestResource withEtag(String etag) {
        this.etag = etag;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public RestoreRequestResource withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public RestoreRequestResource withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

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