// 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.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Description of a NotificationHub ApnsCredential. Note that there is no explicit switch between Certificate and Token
 * Authentication Modes. The mode is determined based on the properties passed in.
 */
@Fluent
public final class ApnsCredentialProperties {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(ApnsCredentialProperties.class);

    /*
     * The APNS certificate. Specify if using Certificate Authentication Mode.
     */
    @JsonProperty(value = "apnsCertificate")
    private String apnsCertificate;

    /*
     * The APNS certificate password if it exists.
     */
    @JsonProperty(value = "certificateKey")
    private String certificateKey;

    /*
     * The APNS endpoint of this credential. If using Certificate
     * Authentication Mode and Sandbox specify
     * 'gateway.sandbox.push.apple.com'. If using Certificate Authentication
     * Mode and Production specify 'gateway.push.apple.com'. If using Token
     * Authentication Mode and Sandbox specify
     * 'https://api.development.push.apple.com:443/3/device'. If using Token
     * Authentication Mode and Production specify
     * 'https://api.push.apple.com:443/3/device'.
     */
    @JsonProperty(value = "endpoint")
    private String endpoint;

    /*
     * The APNS certificate thumbprint. Specify if using Certificate
     * Authentication Mode.
     */
    @JsonProperty(value = "thumbprint")
    private String thumbprint;

    /*
     * A 10-character key identifier (kid) key, obtained from your developer
     * account. Specify if using Token Authentication Mode.
     */
    @JsonProperty(value = "keyId")
    private String keyId;

    /*
     * The name of the application or BundleId. Specify if using Token
     * Authentication Mode.
     */
    @JsonProperty(value = "appName")
    private String appName;

    /*
     * The issuer (iss) registered claim key. The value is a 10-character
     * TeamId, obtained from your developer account. Specify if using Token
     * Authentication Mode.
     */
    @JsonProperty(value = "appId")
    private String appId;

    /*
     * Provider Authentication Token, obtained through your developer account.
     * Specify if using Token Authentication Mode.
     */
    @JsonProperty(value = "token")
    private String token;

    /**
     * Get the apnsCertificate property: The APNS certificate. Specify if using Certificate Authentication Mode.
     *
     * @return the apnsCertificate value.
     */
    public String apnsCertificate() {
        return this.apnsCertificate;
    }

    /**
     * Set the apnsCertificate property: The APNS certificate. Specify if using Certificate Authentication Mode.
     *
     * @param apnsCertificate the apnsCertificate value to set.
     * @return the ApnsCredentialProperties object itself.
     */
    public ApnsCredentialProperties withApnsCertificate(String apnsCertificate) {
        this.apnsCertificate = apnsCertificate;
        return this;
    }

    /**
     * Get the certificateKey property: The APNS certificate password if it exists.
     *
     * @return the certificateKey value.
     */
    public String certificateKey() {
        return this.certificateKey;
    }

    /**
     * Set the certificateKey property: The APNS certificate password if it exists.
     *
     * @param certificateKey the certificateKey value to set.
     * @return the ApnsCredentialProperties object itself.
     */
    public ApnsCredentialProperties withCertificateKey(String certificateKey) {
        this.certificateKey = certificateKey;
        return this;
    }

    /**
     * Get the endpoint property: The APNS endpoint of this credential. If using Certificate Authentication Mode and
     * Sandbox specify 'gateway.sandbox.push.apple.com'. If using Certificate Authentication Mode and Production specify
     * 'gateway.push.apple.com'. If using Token Authentication Mode and Sandbox specify
     * 'https://api.development.push.apple.com:443/3/device'. If using Token Authentication Mode and Production specify
     * 'https://api.push.apple.com:443/3/device'.
     *
     * @return the endpoint value.
     */
    public String endpoint() {
        return this.endpoint;
    }

    /**
     * Set the endpoint property: The APNS endpoint of this credential. If using Certificate Authentication Mode and
     * Sandbox specify 'gateway.sandbox.push.apple.com'. If using Certificate Authentication Mode and Production specify
     * 'gateway.push.apple.com'. If using Token Authentication Mode and Sandbox specify
     * 'https://api.development.push.apple.com:443/3/device'. If using Token Authentication Mode and Production specify
     * 'https://api.push.apple.com:443/3/device'.
     *
     * @param endpoint the endpoint value to set.
     * @return the ApnsCredentialProperties object itself.
     */
    public ApnsCredentialProperties withEndpoint(String endpoint) {
        this.endpoint = endpoint;
        return this;
    }

    /**
     * Get the thumbprint property: The APNS certificate thumbprint. Specify if using Certificate Authentication Mode.
     *
     * @return the thumbprint value.
     */
    public String thumbprint() {
        return this.thumbprint;
    }

    /**
     * Set the thumbprint property: The APNS certificate thumbprint. Specify if using Certificate Authentication Mode.
     *
     * @param thumbprint the thumbprint value to set.
     * @return the ApnsCredentialProperties object itself.
     */
    public ApnsCredentialProperties withThumbprint(String thumbprint) {
        this.thumbprint = thumbprint;
        return this;
    }

    /**
     * Get the keyId property: A 10-character key identifier (kid) key, obtained from your developer account. Specify if
     * using Token Authentication Mode.
     *
     * @return the keyId value.
     */
    public String keyId() {
        return this.keyId;
    }

    /**
     * Set the keyId property: A 10-character key identifier (kid) key, obtained from your developer account. Specify if
     * using Token Authentication Mode.
     *
     * @param keyId the keyId value to set.
     * @return the ApnsCredentialProperties object itself.
     */
    public ApnsCredentialProperties withKeyId(String keyId) {
        this.keyId = keyId;
        return this;
    }

    /**
     * Get the appName property: The name of the application or BundleId. Specify if using Token Authentication Mode.
     *
     * @return the appName value.
     */
    public String appName() {
        return this.appName;
    }

    /**
     * Set the appName property: The name of the application or BundleId. Specify if using Token Authentication Mode.
     *
     * @param appName the appName value to set.
     * @return the ApnsCredentialProperties object itself.
     */
    public ApnsCredentialProperties withAppName(String appName) {
        this.appName = appName;
        return this;
    }

    /**
     * Get the appId property: The issuer (iss) registered claim key. The value is a 10-character TeamId, obtained from
     * your developer account. Specify if using Token Authentication Mode.
     *
     * @return the appId value.
     */
    public String appId() {
        return this.appId;
    }

    /**
     * Set the appId property: The issuer (iss) registered claim key. The value is a 10-character TeamId, obtained from
     * your developer account. Specify if using Token Authentication Mode.
     *
     * @param appId the appId value to set.
     * @return the ApnsCredentialProperties object itself.
     */
    public ApnsCredentialProperties withAppId(String appId) {
        this.appId = appId;
        return this;
    }

    /**
     * Get the token property: Provider Authentication Token, obtained through your developer account. Specify if using
     * Token Authentication Mode.
     *
     * @return the token value.
     */
    public String token() {
        return this.token;
    }

    /**
     * Set the token property: Provider Authentication Token, obtained through your developer account. Specify if using
     * Token Authentication Mode.
     *
     * @param token the token value to set.
     * @return the ApnsCredentialProperties object itself.
     */
    public ApnsCredentialProperties withToken(String token) {
        this.token = token;
        return this;
    }

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