// 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.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.fluent.models.NotificationHubProperties;
import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleProperties;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** Parameters supplied to the patch NotificationHub operation. */
@Fluent
public final class NotificationHubPatchParameters extends Resource {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationHubPatchParameters.class);

    /*
     * Properties of the NotificationHub.
     */
    @JsonProperty(value = "properties")
    private NotificationHubProperties innerProperties;

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

    /**
     * Get the innerProperties property: Properties of the NotificationHub.
     *
     * @return the innerProperties value.
     */
    private NotificationHubProperties 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 NotificationHubPatchParameters object itself.
     */
    public NotificationHubPatchParameters withSku(Sku sku) {
        this.sku = sku;
        return this;
    }

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

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

    /**
     * Get the name property: The NotificationHub name.
     *
     * @return the name value.
     */
    public String namePropertiesName() {
        return this.innerProperties() == null ? null : this.innerProperties().name();
    }

    /**
     * Set the name property: The NotificationHub name.
     *
     * @param name the name value to set.
     * @return the NotificationHubPatchParameters object itself.
     */
    public NotificationHubPatchParameters withNamePropertiesName(String name) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NotificationHubProperties();
        }
        this.innerProperties().withName(name);
        return this;
    }

    /**
     * Get the registrationTtl property: The RegistrationTtl of the created NotificationHub.
     *
     * @return the registrationTtl value.
     */
    public String registrationTtl() {
        return this.innerProperties() == null ? null : this.innerProperties().registrationTtl();
    }

    /**
     * Set the registrationTtl property: The RegistrationTtl of the created NotificationHub.
     *
     * @param registrationTtl the registrationTtl value to set.
     * @return the NotificationHubPatchParameters object itself.
     */
    public NotificationHubPatchParameters withRegistrationTtl(String registrationTtl) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NotificationHubProperties();
        }
        this.innerProperties().withRegistrationTtl(registrationTtl);
        return this;
    }

    /**
     * Get the authorizationRules property: The AuthorizationRules of the created NotificationHub.
     *
     * @return the authorizationRules value.
     */
    public List<SharedAccessAuthorizationRuleProperties> authorizationRules() {
        return this.innerProperties() == null ? null : this.innerProperties().authorizationRules();
    }

    /**
     * Set the authorizationRules property: The AuthorizationRules of the created NotificationHub.
     *
     * @param authorizationRules the authorizationRules value to set.
     * @return the NotificationHubPatchParameters object itself.
     */
    public NotificationHubPatchParameters withAuthorizationRules(
        List<SharedAccessAuthorizationRuleProperties> authorizationRules) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NotificationHubProperties();
        }
        this.innerProperties().withAuthorizationRules(authorizationRules);
        return this;
    }

    /**
     * Get the apnsCredential property: The ApnsCredential of the created NotificationHub.
     *
     * @return the apnsCredential value.
     */
    public ApnsCredential apnsCredential() {
        return this.innerProperties() == null ? null : this.innerProperties().apnsCredential();
    }

    /**
     * Set the apnsCredential property: The ApnsCredential of the created NotificationHub.
     *
     * @param apnsCredential the apnsCredential value to set.
     * @return the NotificationHubPatchParameters object itself.
     */
    public NotificationHubPatchParameters withApnsCredential(ApnsCredential apnsCredential) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NotificationHubProperties();
        }
        this.innerProperties().withApnsCredential(apnsCredential);
        return this;
    }

    /**
     * Get the wnsCredential property: The WnsCredential of the created NotificationHub.
     *
     * @return the wnsCredential value.
     */
    public WnsCredential wnsCredential() {
        return this.innerProperties() == null ? null : this.innerProperties().wnsCredential();
    }

    /**
     * Set the wnsCredential property: The WnsCredential of the created NotificationHub.
     *
     * @param wnsCredential the wnsCredential value to set.
     * @return the NotificationHubPatchParameters object itself.
     */
    public NotificationHubPatchParameters withWnsCredential(WnsCredential wnsCredential) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NotificationHubProperties();
        }
        this.innerProperties().withWnsCredential(wnsCredential);
        return this;
    }

    /**
     * Get the gcmCredential property: The GcmCredential of the created NotificationHub.
     *
     * @return the gcmCredential value.
     */
    public GcmCredential gcmCredential() {
        return this.innerProperties() == null ? null : this.innerProperties().gcmCredential();
    }

    /**
     * Set the gcmCredential property: The GcmCredential of the created NotificationHub.
     *
     * @param gcmCredential the gcmCredential value to set.
     * @return the NotificationHubPatchParameters object itself.
     */
    public NotificationHubPatchParameters withGcmCredential(GcmCredential gcmCredential) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NotificationHubProperties();
        }
        this.innerProperties().withGcmCredential(gcmCredential);
        return this;
    }

    /**
     * Get the mpnsCredential property: The MpnsCredential of the created NotificationHub.
     *
     * @return the mpnsCredential value.
     */
    public MpnsCredential mpnsCredential() {
        return this.innerProperties() == null ? null : this.innerProperties().mpnsCredential();
    }

    /**
     * Set the mpnsCredential property: The MpnsCredential of the created NotificationHub.
     *
     * @param mpnsCredential the mpnsCredential value to set.
     * @return the NotificationHubPatchParameters object itself.
     */
    public NotificationHubPatchParameters withMpnsCredential(MpnsCredential mpnsCredential) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NotificationHubProperties();
        }
        this.innerProperties().withMpnsCredential(mpnsCredential);
        return this;
    }

    /**
     * Get the admCredential property: The AdmCredential of the created NotificationHub.
     *
     * @return the admCredential value.
     */
    public AdmCredential admCredential() {
        return this.innerProperties() == null ? null : this.innerProperties().admCredential();
    }

    /**
     * Set the admCredential property: The AdmCredential of the created NotificationHub.
     *
     * @param admCredential the admCredential value to set.
     * @return the NotificationHubPatchParameters object itself.
     */
    public NotificationHubPatchParameters withAdmCredential(AdmCredential admCredential) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NotificationHubProperties();
        }
        this.innerProperties().withAdmCredential(admCredential);
        return this;
    }

    /**
     * Get the baiduCredential property: The BaiduCredential of the created NotificationHub.
     *
     * @return the baiduCredential value.
     */
    public BaiduCredential baiduCredential() {
        return this.innerProperties() == null ? null : this.innerProperties().baiduCredential();
    }

    /**
     * Set the baiduCredential property: The BaiduCredential of the created NotificationHub.
     *
     * @param baiduCredential the baiduCredential value to set.
     * @return the NotificationHubPatchParameters object itself.
     */
    public NotificationHubPatchParameters withBaiduCredential(BaiduCredential baiduCredential) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NotificationHubProperties();
        }
        this.innerProperties().withBaiduCredential(baiduCredential);
        return this;
    }

    /**
     * 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();
        }
    }
}
