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

package com.azure.resourcemanager.billing.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.resourcemanager.billing.models.ViewCharges;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The customer's Policy. */
@Fluent
public final class CustomerPolicyInner extends ProxyResource {
    /*
     * The properties of a customer's policy.
     */
    @JsonProperty(value = "properties")
    private CustomerPolicyProperties innerProperties;

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

    /**
     * Get the innerProperties property: The properties of a customer's policy.
     *
     * @return the innerProperties value.
     */
    private CustomerPolicyProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the viewCharges property: The policy that controls whether the users in customer's organization can view
     * charges at pay-as-you-go prices.
     *
     * @return the viewCharges value.
     */
    public ViewCharges viewCharges() {
        return this.innerProperties() == null ? null : this.innerProperties().viewCharges();
    }

    /**
     * Set the viewCharges property: The policy that controls whether the users in customer's organization can view
     * charges at pay-as-you-go prices.
     *
     * @param viewCharges the viewCharges value to set.
     * @return the CustomerPolicyInner object itself.
     */
    public CustomerPolicyInner withViewCharges(ViewCharges viewCharges) {
        if (this.innerProperties() == null) {
            this.innerProperties = new CustomerPolicyProperties();
        }
        this.innerProperties().withViewCharges(viewCharges);
        return this;
    }

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