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

package com.azure.resourcemanager.machinelearning.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/** Defines a Sampling Algorithm that generates values randomly. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "samplingAlgorithmType")
@JsonTypeName("Random")
@Fluent
public final class RandomSamplingAlgorithm extends SamplingAlgorithm {
    /*
     * The specific type of random algorithm
     */
    @JsonProperty(value = "rule")
    private RandomSamplingAlgorithmRule rule;

    /*
     * An optional integer to use as the seed for random number generation
     */
    @JsonProperty(value = "seed")
    private Integer seed;

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

    /**
     * Get the rule property: The specific type of random algorithm.
     *
     * @return the rule value.
     */
    public RandomSamplingAlgorithmRule rule() {
        return this.rule;
    }

    /**
     * Set the rule property: The specific type of random algorithm.
     *
     * @param rule the rule value to set.
     * @return the RandomSamplingAlgorithm object itself.
     */
    public RandomSamplingAlgorithm withRule(RandomSamplingAlgorithmRule rule) {
        this.rule = rule;
        return this;
    }

    /**
     * Get the seed property: An optional integer to use as the seed for random number generation.
     *
     * @return the seed value.
     */
    public Integer seed() {
        return this.seed;
    }

    /**
     * Set the seed property: An optional integer to use as the seed for random number generation.
     *
     * @param seed the seed value to set.
     * @return the RandomSamplingAlgorithm object itself.
     */
    public RandomSamplingAlgorithm withSeed(Integer seed) {
        this.seed = seed;
        return this;
    }

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