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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.notificationhubs.models.AccessRights;
import com.azure.resourcemanager.notificationhubs.models.Sku;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** Description of a Namespace AuthorizationRules. */
@Fluent
public final class SharedAccessAuthorizationRuleResourceInner extends Resource {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(SharedAccessAuthorizationRuleResourceInner.class);

    /*
     * Properties of the Namespace AuthorizationRule.
     */
    @JsonProperty(value = "properties")
    private SharedAccessAuthorizationRuleProperties innerProperties;

    /*
     * The sku of the created namespace
     */
    @JsonProperty(value = "sku")
    private Sku sku;

    /**
     * Get the innerProperties property: Properties of the Namespace AuthorizationRule.
     *
     * @return the innerProperties value.
     */
    private SharedAccessAuthorizationRuleProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the sku property: The sku of the created namespace.
     *
     * @return the sku value.
     */
    public Sku sku() {
        return this.sku;
    }

    /**
     * Set the sku property: The sku of the created namespace.
     *
     * @param sku the sku value to set.
     * @return the SharedAccessAuthorizationRuleResourceInner object itself.
     */
    public SharedAccessAuthorizationRuleResourceInner withSku(Sku sku) {
        this.sku = sku;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public SharedAccessAuthorizationRuleResourceInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public SharedAccessAuthorizationRuleResourceInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

    /**
     * Get the rights property: The rights associated with the rule.
     *
     * @return the rights value.
     */
    public List<AccessRights> rights() {
        return this.innerProperties() == null ? null : this.innerProperties().rights();
    }

    /**
     * Set the rights property: The rights associated with the rule.
     *
     * @param rights the rights value to set.
     * @return the SharedAccessAuthorizationRuleResourceInner object itself.
     */
    public SharedAccessAuthorizationRuleResourceInner withRights(List<AccessRights> rights) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SharedAccessAuthorizationRuleProperties();
        }
        this.innerProperties().withRights(rights);
        return this;
    }

    /**
     * Get the primaryKey property: A base64-encoded 256-bit primary key for signing and validating the SAS token.
     *
     * @return the primaryKey value.
     */
    public String primaryKey() {
        return this.innerProperties() == null ? null : this.innerProperties().primaryKey();
    }

    /**
     * Get the secondaryKey property: A base64-encoded 256-bit primary key for signing and validating the SAS token.
     *
     * @return the secondaryKey value.
     */
    public String secondaryKey() {
        return this.innerProperties() == null ? null : this.innerProperties().secondaryKey();
    }

    /**
     * Get the keyName property: A string that describes the authorization rule.
     *
     * @return the keyName value.
     */
    public String keyName() {
        return this.innerProperties() == null ? null : this.innerProperties().keyName();
    }

    /**
     * Get the claimType property: A string that describes the claim type.
     *
     * @return the claimType value.
     */
    public String claimType() {
        return this.innerProperties() == null ? null : this.innerProperties().claimType();
    }

    /**
     * Get the claimValue property: A string that describes the claim value.
     *
     * @return the claimValue value.
     */
    public String claimValue() {
        return this.innerProperties() == null ? null : this.innerProperties().claimValue();
    }

    /**
     * Get the modifiedTime property: The last modified time for this rule.
     *
     * @return the modifiedTime value.
     */
    public String modifiedTime() {
        return this.innerProperties() == null ? null : this.innerProperties().modifiedTime();
    }

    /**
     * Get the createdTime property: The created time for this rule.
     *
     * @return the createdTime value.
     */
    public String createdTime() {
        return this.innerProperties() == null ? null : this.innerProperties().createdTime();
    }

    /**
     * Get the revision property: The revision number for the rule.
     *
     * @return the revision value.
     */
    public Integer revision() {
        return this.innerProperties() == null ? null : this.innerProperties().revision();
    }

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