// 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;
import java.util.List;

/**
 * Installs Windows Updates. Corresponds to Packer Windows Update Provisioner
 * (https://github.com/rgl/packer-provisioner-windows-update).
 */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonTypeName("WindowsUpdate")
@Fluent
public final class ImageTemplateWindowsUpdateCustomizer extends ImageTemplateCustomizer {
    /*
     * Criteria to search updates. Omit or specify empty string to use the default (search all). Refer to above link
     * for examples and detailed description of this field.
     */
    @JsonProperty(value = "searchCriteria")
    private String searchCriteria;

    /*
     * Array of filters to select updates to apply. Omit or specify empty array to use the default (no filter). Refer
     * to above link for examples and detailed description of this field.
     */
    @JsonProperty(value = "filters")
    private List<String> filters;

    /*
     * Maximum number of updates to apply at a time. Omit or specify 0 to use the default (1000)
     */
    @JsonProperty(value = "updateLimit")
    private Integer updateLimit;

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

    /**
     * Get the searchCriteria property: Criteria to search updates. Omit or specify empty string to use the default
     * (search all). Refer to above link for examples and detailed description of this field.
     *
     * @return the searchCriteria value.
     */
    public String searchCriteria() {
        return this.searchCriteria;
    }

    /**
     * Set the searchCriteria property: Criteria to search updates. Omit or specify empty string to use the default
     * (search all). Refer to above link for examples and detailed description of this field.
     *
     * @param searchCriteria the searchCriteria value to set.
     * @return the ImageTemplateWindowsUpdateCustomizer object itself.
     */
    public ImageTemplateWindowsUpdateCustomizer withSearchCriteria(String searchCriteria) {
        this.searchCriteria = searchCriteria;
        return this;
    }

    /**
     * Get the filters property: Array of filters to select updates to apply. Omit or specify empty array to use the
     * default (no filter). Refer to above link for examples and detailed description of this field.
     *
     * @return the filters value.
     */
    public List<String> filters() {
        return this.filters;
    }

    /**
     * Set the filters property: Array of filters to select updates to apply. Omit or specify empty array to use the
     * default (no filter). Refer to above link for examples and detailed description of this field.
     *
     * @param filters the filters value to set.
     * @return the ImageTemplateWindowsUpdateCustomizer object itself.
     */
    public ImageTemplateWindowsUpdateCustomizer withFilters(List<String> filters) {
        this.filters = filters;
        return this;
    }

    /**
     * Get the updateLimit property: Maximum number of updates to apply at a time. Omit or specify 0 to use the default
     * (1000).
     *
     * @return the updateLimit value.
     */
    public Integer updateLimit() {
        return this.updateLimit;
    }

    /**
     * Set the updateLimit property: Maximum number of updates to apply at a time. Omit or specify 0 to use the default
     * (1000).
     *
     * @param updateLimit the updateLimit value to set.
     * @return the ImageTemplateWindowsUpdateCustomizer object itself.
     */
    public ImageTemplateWindowsUpdateCustomizer withUpdateLimit(Integer updateLimit) {
        this.updateLimit = updateLimit;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ImageTemplateWindowsUpdateCustomizer withName(String name) {
        super.withName(name);
        return this;
    }

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