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

package com.azure.resourcemanager.recoveryservicessiterecovery.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;

/** This class represents the recovery plan group task. */
@JsonTypeInfo(
    use = JsonTypeInfo.Id.NAME,
    include = JsonTypeInfo.As.PROPERTY,
    property = "instanceType",
    defaultImpl = RecoveryPlanGroupTaskDetails.class)
@JsonTypeName("RecoveryPlanGroupTaskDetails")
@JsonSubTypes({
    @JsonSubTypes.Type(
        name = "RecoveryPlanShutdownGroupTaskDetails",
        value = RecoveryPlanShutdownGroupTaskDetails.class)
})
@Fluent
public class RecoveryPlanGroupTaskDetails extends GroupTaskDetails {
    /*
     * The name.
     */
    @JsonProperty(value = "name")
    private String name;

    /*
     * The group identifier.
     */
    @JsonProperty(value = "groupId")
    private String groupId;

    /*
     * The group type.
     */
    @JsonProperty(value = "rpGroupType")
    private String rpGroupType;

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

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

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

    /**
     * Get the groupId property: The group identifier.
     *
     * @return the groupId value.
     */
    public String groupId() {
        return this.groupId;
    }

    /**
     * Set the groupId property: The group identifier.
     *
     * @param groupId the groupId value to set.
     * @return the RecoveryPlanGroupTaskDetails object itself.
     */
    public RecoveryPlanGroupTaskDetails withGroupId(String groupId) {
        this.groupId = groupId;
        return this;
    }

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

    /**
     * Set the rpGroupType property: The group type.
     *
     * @param rpGroupType the rpGroupType value to set.
     * @return the RecoveryPlanGroupTaskDetails object itself.
     */
    public RecoveryPlanGroupTaskDetails withRpGroupType(String rpGroupType) {
        this.rpGroupType = rpGroupType;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public RecoveryPlanGroupTaskDetails withChildTasks(List<AsrTask> childTasks) {
        super.withChildTasks(childTasks);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
    }
}
