// 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.util.logging.ClientLogger;
import com.azure.resourcemanager.notificationhubs.fluent.models.GcmCredentialProperties;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Description of a NotificationHub GcmCredential. */
@Fluent
public final class GcmCredential {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(GcmCredential.class);

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

    /**
     * Get the innerProperties property: Properties of NotificationHub GcmCredential.
     *
     * @return the innerProperties value.
     */
    private GcmCredentialProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the gcmEndpoint property: The FCM legacy endpoint. Default value is 'https://fcm.googleapis.com/fcm/send'.
     *
     * @return the gcmEndpoint value.
     */
    public String gcmEndpoint() {
        return this.innerProperties() == null ? null : this.innerProperties().gcmEndpoint();
    }

    /**
     * Set the gcmEndpoint property: The FCM legacy endpoint. Default value is 'https://fcm.googleapis.com/fcm/send'.
     *
     * @param gcmEndpoint the gcmEndpoint value to set.
     * @return the GcmCredential object itself.
     */
    public GcmCredential withGcmEndpoint(String gcmEndpoint) {
        if (this.innerProperties() == null) {
            this.innerProperties = new GcmCredentialProperties();
        }
        this.innerProperties().withGcmEndpoint(gcmEndpoint);
        return this;
    }

    /**
     * Get the googleApiKey property: The Google API key.
     *
     * @return the googleApiKey value.
     */
    public String googleApiKey() {
        return this.innerProperties() == null ? null : this.innerProperties().googleApiKey();
    }

    /**
     * Set the googleApiKey property: The Google API key.
     *
     * @param googleApiKey the googleApiKey value to set.
     * @return the GcmCredential object itself.
     */
    public GcmCredential withGoogleApiKey(String googleApiKey) {
        if (this.innerProperties() == null) {
            this.innerProperties = new GcmCredentialProperties();
        }
        this.innerProperties().withGoogleApiKey(googleApiKey);
        return this;
    }

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