// 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.util.logging.ClientLogger;
import com.azure.resourcemanager.notificationhubs.models.AdmCredential;
import com.azure.resourcemanager.notificationhubs.models.ApnsCredential;
import com.azure.resourcemanager.notificationhubs.models.BaiduCredential;
import com.azure.resourcemanager.notificationhubs.models.GcmCredential;
import com.azure.resourcemanager.notificationhubs.models.MpnsCredential;
import com.azure.resourcemanager.notificationhubs.models.WnsCredential;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** NotificationHub properties. */
@Fluent
public final class NotificationHubProperties {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationHubProperties.class);

    /*
     * The NotificationHub name.
     */
    @JsonProperty(value = "name")
    private String name;

    /*
     * The RegistrationTtl of the created NotificationHub
     */
    @JsonProperty(value = "registrationTtl")
    private String registrationTtl;

    /*
     * The AuthorizationRules of the created NotificationHub
     */
    @JsonProperty(value = "authorizationRules")
    private List<SharedAccessAuthorizationRuleProperties> authorizationRules;

    /*
     * The ApnsCredential of the created NotificationHub
     */
    @JsonProperty(value = "apnsCredential")
    private ApnsCredential apnsCredential;

    /*
     * The WnsCredential of the created NotificationHub
     */
    @JsonProperty(value = "wnsCredential")
    private WnsCredential wnsCredential;

    /*
     * The GcmCredential of the created NotificationHub
     */
    @JsonProperty(value = "gcmCredential")
    private GcmCredential gcmCredential;

    /*
     * The MpnsCredential of the created NotificationHub
     */
    @JsonProperty(value = "mpnsCredential")
    private MpnsCredential mpnsCredential;

    /*
     * The AdmCredential of the created NotificationHub
     */
    @JsonProperty(value = "admCredential")
    private AdmCredential admCredential;

    /*
     * The BaiduCredential of the created NotificationHub
     */
    @JsonProperty(value = "baiduCredential")
    private BaiduCredential baiduCredential;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (authorizationRules() != null) {
            authorizationRules().forEach(e -> e.validate());
        }
        if (apnsCredential() != null) {
            apnsCredential().validate();
        }
        if (wnsCredential() != null) {
            wnsCredential().validate();
        }
        if (gcmCredential() != null) {
            gcmCredential().validate();
        }
        if (mpnsCredential() != null) {
            mpnsCredential().validate();
        }
        if (admCredential() != null) {
            admCredential().validate();
        }
        if (baiduCredential() != null) {
            baiduCredential().validate();
        }
    }
}
