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

package com.azure.resourcemanager.automation.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.automation.fluent.models.WatcherUpdateProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The WatcherUpdateParameters model. */
@Fluent
public final class WatcherUpdateParameters {
    /*
     * Gets or sets the watcher update properties.
     */
    @JsonProperty(value = "properties")
    private WatcherUpdateProperties innerProperties;

    /*
     * Gets or sets the name of the resource.
     */
    @JsonProperty(value = "name")
    private String name;

    /**
     * Get the innerProperties property: Gets or sets the watcher update properties.
     *
     * @return the innerProperties value.
     */
    private WatcherUpdateProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the name property: Gets or sets the name of the resource.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: Gets or sets the name of the resource.
     *
     * @param name the name value to set.
     * @return the WatcherUpdateParameters object itself.
     */
    public WatcherUpdateParameters withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the executionFrequencyInSeconds property: Gets or sets the frequency at which the watcher is invoked.
     *
     * @return the executionFrequencyInSeconds value.
     */
    public Long executionFrequencyInSeconds() {
        return this.innerProperties() == null ? null : this.innerProperties().executionFrequencyInSeconds();
    }

    /**
     * Set the executionFrequencyInSeconds property: Gets or sets the frequency at which the watcher is invoked.
     *
     * @param executionFrequencyInSeconds the executionFrequencyInSeconds value to set.
     * @return the WatcherUpdateParameters object itself.
     */
    public WatcherUpdateParameters withExecutionFrequencyInSeconds(Long executionFrequencyInSeconds) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WatcherUpdateProperties();
        }
        this.innerProperties().withExecutionFrequencyInSeconds(executionFrequencyInSeconds);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (innerProperties() != null) {
            innerProperties().validate();
        }
    }
}
