Class CredentialCreator


  • public class CredentialCreator
    extends Creator<Credential>
    PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
    • Constructor Detail

      • CredentialCreator

        public CredentialCreator​(Credential.PushService type)
        Construct a new CredentialCreator.
        Parameters:
        type - The Credential type
    • Method Detail

      • setFriendlyName

        public CredentialCreator setFriendlyName​(String friendlyName)
        A descriptive string that you create to describe the resource. It can be up to 64 characters long..
        Parameters:
        friendlyName - A string to describe the resource
        Returns:
        this
      • setCertificate

        public CredentialCreator setCertificate​(String certificate)
        [APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. `-----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----`.
        Parameters:
        certificate - [APN only] The URL-encoded representation of the certificate
        Returns:
        this
      • setPrivateKey

        public CredentialCreator setPrivateKey​(String privateKey)
        [APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. `-----BEGIN RSA PRIVATE KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\n.-----END RSA PRIVATE KEY-----`.
        Parameters:
        privateKey - [APN only] URL-encoded representation of the private key
        Returns:
        this
      • setSandbox

        public CredentialCreator setSandbox​(Boolean sandbox)
        [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production..
        Parameters:
        sandbox - [APN only] Whether to send the credential to sandbox APNs
        Returns:
        this
      • setApiKey

        public CredentialCreator setApiKey​(String apiKey)
        [GCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging..
        Parameters:
        apiKey - [GCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging
        Returns:
        this
      • setSecret

        public CredentialCreator setSecret​(String secret)
        [FCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging..
        Parameters:
        secret - [FCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging
        Returns:
        this
      • create

        public Credential create​(TwilioRestClient client)
        Make the request to the Twilio API to perform the create.
        Specified by:
        create in class Creator<Credential>
        Parameters:
        client - TwilioRestClient with which to make the request
        Returns:
        Created Credential