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

package com.azure.resourcemanager.imagebuilder.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;

/** Generates version number that will be latest based on existing version numbers. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "scheme")
@JsonTypeName("Latest")
@Fluent
public final class DistributeVersionerLatest extends DistributeVersioner {
    /*
     * Major version for the generated version number. Determine what is "latest" based on versions with this value as
     * the major version. -1 is equivalent to leaving it unset.
     */
    @JsonProperty(value = "major")
    private Integer major;

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

    /**
     * Get the major property: Major version for the generated version number. Determine what is "latest" based on
     * versions with this value as the major version. -1 is equivalent to leaving it unset.
     *
     * @return the major value.
     */
    public Integer major() {
        return this.major;
    }

    /**
     * Set the major property: Major version for the generated version number. Determine what is "latest" based on
     * versions with this value as the major version. -1 is equivalent to leaving it unset.
     *
     * @param major the major value to set.
     * @return the DistributeVersionerLatest object itself.
     */
    public DistributeVersionerLatest withMajor(Integer major) {
        this.major = major;
        return this;
    }

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