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

package com.azure.resourcemanager.netapp.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.netapp.fluent.models.SnapshotPolicyProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** Snapshot policy Details for create and update. */
@Fluent
public final class SnapshotPolicyPatch {
    /*
     * Resource location
     */
    @JsonProperty(value = "location")
    private String location;

    /*
     * Resource Id
     */
    @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
    private String id;

    /*
     * Resource name
     */
    @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
    private String name;

    /*
     * Resource type
     */
    @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY)
    private String type;

    /*
     * Resource tags
     */
    @JsonProperty(value = "tags")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> tags;

    /*
     * Snapshot Policy properties
     */
    @JsonProperty(value = "properties")
    private SnapshotPolicyProperties innerProperties;

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

    /**
     * Get the location property: Resource location.
     *
     * @return the location value.
     */
    public String location() {
        return this.location;
    }

    /**
     * Set the location property: Resource location.
     *
     * @param location the location value to set.
     * @return the SnapshotPolicyPatch object itself.
     */
    public SnapshotPolicyPatch withLocation(String location) {
        this.location = location;
        return this;
    }

    /**
     * Get the id property: Resource Id.
     *
     * @return the id value.
     */
    public String id() {
        return this.id;
    }

    /**
     * Get the name property: Resource name.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Get the type property: Resource type.
     *
     * @return the type value.
     */
    public String type() {
        return this.type;
    }

    /**
     * Get the tags property: Resource tags.
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.tags;
    }

    /**
     * Set the tags property: Resource tags.
     *
     * @param tags the tags value to set.
     * @return the SnapshotPolicyPatch object itself.
     */
    public SnapshotPolicyPatch withTags(Map<String, String> tags) {
        this.tags = tags;
        return this;
    }

    /**
     * Get the innerProperties property: Snapshot Policy properties.
     *
     * @return the innerProperties value.
     */
    private SnapshotPolicyProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the hourlySchedule property: Schedule for hourly snapshots.
     *
     * @return the hourlySchedule value.
     */
    public HourlySchedule hourlySchedule() {
        return this.innerProperties() == null ? null : this.innerProperties().hourlySchedule();
    }

    /**
     * Set the hourlySchedule property: Schedule for hourly snapshots.
     *
     * @param hourlySchedule the hourlySchedule value to set.
     * @return the SnapshotPolicyPatch object itself.
     */
    public SnapshotPolicyPatch withHourlySchedule(HourlySchedule hourlySchedule) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SnapshotPolicyProperties();
        }
        this.innerProperties().withHourlySchedule(hourlySchedule);
        return this;
    }

    /**
     * Get the dailySchedule property: Schedule for daily snapshots.
     *
     * @return the dailySchedule value.
     */
    public DailySchedule dailySchedule() {
        return this.innerProperties() == null ? null : this.innerProperties().dailySchedule();
    }

    /**
     * Set the dailySchedule property: Schedule for daily snapshots.
     *
     * @param dailySchedule the dailySchedule value to set.
     * @return the SnapshotPolicyPatch object itself.
     */
    public SnapshotPolicyPatch withDailySchedule(DailySchedule dailySchedule) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SnapshotPolicyProperties();
        }
        this.innerProperties().withDailySchedule(dailySchedule);
        return this;
    }

    /**
     * Get the weeklySchedule property: Schedule for weekly snapshots.
     *
     * @return the weeklySchedule value.
     */
    public WeeklySchedule weeklySchedule() {
        return this.innerProperties() == null ? null : this.innerProperties().weeklySchedule();
    }

    /**
     * Set the weeklySchedule property: Schedule for weekly snapshots.
     *
     * @param weeklySchedule the weeklySchedule value to set.
     * @return the SnapshotPolicyPatch object itself.
     */
    public SnapshotPolicyPatch withWeeklySchedule(WeeklySchedule weeklySchedule) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SnapshotPolicyProperties();
        }
        this.innerProperties().withWeeklySchedule(weeklySchedule);
        return this;
    }

    /**
     * Get the monthlySchedule property: Schedule for monthly snapshots.
     *
     * @return the monthlySchedule value.
     */
    public MonthlySchedule monthlySchedule() {
        return this.innerProperties() == null ? null : this.innerProperties().monthlySchedule();
    }

    /**
     * Set the monthlySchedule property: Schedule for monthly snapshots.
     *
     * @param monthlySchedule the monthlySchedule value to set.
     * @return the SnapshotPolicyPatch object itself.
     */
    public SnapshotPolicyPatch withMonthlySchedule(MonthlySchedule monthlySchedule) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SnapshotPolicyProperties();
        }
        this.innerProperties().withMonthlySchedule(monthlySchedule);
        return this;
    }

    /**
     * Get the enabled property: The property to decide policy is enabled or not.
     *
     * @return the enabled value.
     */
    public Boolean enabled() {
        return this.innerProperties() == null ? null : this.innerProperties().enabled();
    }

    /**
     * Set the enabled property: The property to decide policy is enabled or not.
     *
     * @param enabled the enabled value to set.
     * @return the SnapshotPolicyPatch object itself.
     */
    public SnapshotPolicyPatch withEnabled(Boolean enabled) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SnapshotPolicyProperties();
        }
        this.innerProperties().withEnabled(enabled);
        return this;
    }

    /**
     * Get the provisioningState property: Azure lifecycle management.
     *
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

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