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

package com.azure.resourcemanager.dataprotection.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.dataprotection.fluent.models.FeatureValidationResponseBaseInner;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;

/** Feature Validation Response. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType")
@JsonTypeName("FeatureValidationResponse")
@Fluent
public final class FeatureValidationResponse extends FeatureValidationResponseBaseInner {
    /*
     * backup support feature type.
     */
    @JsonProperty(value = "featureType")
    private FeatureType featureType;

    /*
     * Response features
     */
    @JsonProperty(value = "features")
    private List<SupportedFeature> features;

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

    /**
     * Get the featureType property: backup support feature type.
     *
     * @return the featureType value.
     */
    public FeatureType featureType() {
        return this.featureType;
    }

    /**
     * Set the featureType property: backup support feature type.
     *
     * @param featureType the featureType value to set.
     * @return the FeatureValidationResponse object itself.
     */
    public FeatureValidationResponse withFeatureType(FeatureType featureType) {
        this.featureType = featureType;
        return this;
    }

    /**
     * Get the features property: Response features.
     *
     * @return the features value.
     */
    public List<SupportedFeature> features() {
        return this.features;
    }

    /**
     * Set the features property: Response features.
     *
     * @param features the features value to set.
     * @return the FeatureValidationResponse object itself.
     */
    public FeatureValidationResponse withFeatures(List<SupportedFeature> features) {
        this.features = features;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (features() != null) {
            features().forEach(e -> e.validate());
        }
    }
}
