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

package com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.AppSeenData;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** Rule counter. */
@Fluent
public final class RuleCounterInner {
    /*
     * priority number
     */
    @JsonProperty(value = "priority", required = true)
    private String priority;

    /*
     * rule Stack Name
     */
    @JsonProperty(value = "ruleStackName")
    private String ruleStackName;

    /*
     * rule list name
     */
    @JsonProperty(value = "ruleListName")
    private String ruleListName;

    /*
     * firewall name
     */
    @JsonProperty(value = "firewallName")
    private String firewallName;

    /*
     * rule name
     */
    @JsonProperty(value = "ruleName", required = true)
    private String ruleName;

    /*
     * hit count
     */
    @JsonProperty(value = "hitCount")
    private Integer hitCount;

    /*
     * apps seen
     */
    @JsonProperty(value = "appSeen")
    private AppSeenData appSeen;

    /*
     * timestamp of response
     */
    @JsonProperty(value = "timestamp")
    private OffsetDateTime timestamp;

    /*
     * timestamp of request
     */
    @JsonProperty(value = "requestTimestamp")
    private OffsetDateTime requestTimestamp;

    /*
     * last updated timestamp
     */
    @JsonProperty(value = "lastUpdatedTimestamp")
    private OffsetDateTime lastUpdatedTimestamp;

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

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

    /**
     * Set the priority property: priority number.
     *
     * @param priority the priority value to set.
     * @return the RuleCounterInner object itself.
     */
    public RuleCounterInner withPriority(String priority) {
        this.priority = priority;
        return this;
    }

    /**
     * Get the ruleStackName property: rule Stack Name.
     *
     * @return the ruleStackName value.
     */
    public String ruleStackName() {
        return this.ruleStackName;
    }

    /**
     * Set the ruleStackName property: rule Stack Name.
     *
     * @param ruleStackName the ruleStackName value to set.
     * @return the RuleCounterInner object itself.
     */
    public RuleCounterInner withRuleStackName(String ruleStackName) {
        this.ruleStackName = ruleStackName;
        return this;
    }

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

    /**
     * Set the ruleListName property: rule list name.
     *
     * @param ruleListName the ruleListName value to set.
     * @return the RuleCounterInner object itself.
     */
    public RuleCounterInner withRuleListName(String ruleListName) {
        this.ruleListName = ruleListName;
        return this;
    }

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

    /**
     * Set the firewallName property: firewall name.
     *
     * @param firewallName the firewallName value to set.
     * @return the RuleCounterInner object itself.
     */
    public RuleCounterInner withFirewallName(String firewallName) {
        this.firewallName = firewallName;
        return this;
    }

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

    /**
     * Set the ruleName property: rule name.
     *
     * @param ruleName the ruleName value to set.
     * @return the RuleCounterInner object itself.
     */
    public RuleCounterInner withRuleName(String ruleName) {
        this.ruleName = ruleName;
        return this;
    }

    /**
     * Get the hitCount property: hit count.
     *
     * @return the hitCount value.
     */
    public Integer hitCount() {
        return this.hitCount;
    }

    /**
     * Set the hitCount property: hit count.
     *
     * @param hitCount the hitCount value to set.
     * @return the RuleCounterInner object itself.
     */
    public RuleCounterInner withHitCount(Integer hitCount) {
        this.hitCount = hitCount;
        return this;
    }

    /**
     * Get the appSeen property: apps seen.
     *
     * @return the appSeen value.
     */
    public AppSeenData appSeen() {
        return this.appSeen;
    }

    /**
     * Set the appSeen property: apps seen.
     *
     * @param appSeen the appSeen value to set.
     * @return the RuleCounterInner object itself.
     */
    public RuleCounterInner withAppSeen(AppSeenData appSeen) {
        this.appSeen = appSeen;
        return this;
    }

    /**
     * Get the timestamp property: timestamp of response.
     *
     * @return the timestamp value.
     */
    public OffsetDateTime timestamp() {
        return this.timestamp;
    }

    /**
     * Set the timestamp property: timestamp of response.
     *
     * @param timestamp the timestamp value to set.
     * @return the RuleCounterInner object itself.
     */
    public RuleCounterInner withTimestamp(OffsetDateTime timestamp) {
        this.timestamp = timestamp;
        return this;
    }

    /**
     * Get the requestTimestamp property: timestamp of request.
     *
     * @return the requestTimestamp value.
     */
    public OffsetDateTime requestTimestamp() {
        return this.requestTimestamp;
    }

    /**
     * Set the requestTimestamp property: timestamp of request.
     *
     * @param requestTimestamp the requestTimestamp value to set.
     * @return the RuleCounterInner object itself.
     */
    public RuleCounterInner withRequestTimestamp(OffsetDateTime requestTimestamp) {
        this.requestTimestamp = requestTimestamp;
        return this;
    }

    /**
     * Get the lastUpdatedTimestamp property: last updated timestamp.
     *
     * @return the lastUpdatedTimestamp value.
     */
    public OffsetDateTime lastUpdatedTimestamp() {
        return this.lastUpdatedTimestamp;
    }

    /**
     * Set the lastUpdatedTimestamp property: last updated timestamp.
     *
     * @param lastUpdatedTimestamp the lastUpdatedTimestamp value to set.
     * @return the RuleCounterInner object itself.
     */
    public RuleCounterInner withLastUpdatedTimestamp(OffsetDateTime lastUpdatedTimestamp) {
        this.lastUpdatedTimestamp = lastUpdatedTimestamp;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (priority() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property priority in model RuleCounterInner"));
        }
        if (ruleName() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property ruleName in model RuleCounterInner"));
        }
        if (appSeen() != null) {
            appSeen().validate();
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(RuleCounterInner.class);
}
