Sha256: 4bd234c99586bba30449d44983abcca5ffa19ff2db80cb7c581bad78ccf2f7d5

Contents?: true

Size: 1.13 KB

Versions: 24

Compression:

Stored size: 1.13 KB

Contents

package org.embulk.output.mailchimp.model;

import com.fasterxml.jackson.annotation.JsonCreator;
import org.embulk.config.ConfigException;

/**
 * Created by thangnc on 4/17/17.
 * <p>
 * MailChimp v3 supports 2 types of auth: OAuth and API key.
 */
public enum AuthMethod
{
    /**
     * OAuth2 type
     */
    OAUTH("oauth"),
    /**
     * API key type
     */
    API_KEY("api_key");

    private String type;

    AuthMethod(final String type)
    {
        this.type = type;
    }

    /**
     * Gets type.
     *
     * @return the type
     */
    public String getType()
    {
        return type;
    }

    /**
     * Find by type auth method.
     *
     * @param type the type
     * @return the auth method
     */
    @JsonCreator
    public static AuthMethod findByType(final String type)
    {
        for (AuthMethod method : values()) {
            if (method.getType().equals(type.toLowerCase())) {
                return method;
            }
        }

        throw new ConfigException(
                String.format("Unknown auth_method '%s'. Supported targets are [api_key, oauth]",
                              type));
    }
}

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
embulk-output-mailchimp-0.3.31 src/main/java/org/embulk/output/mailchimp/model/AuthMethod.java
embulk-output-mailchimp-0.3.28 src/main/java/org/embulk/output/mailchimp/model/AuthMethod.java
embulk-output-mailchimp-0.3.25 src/main/java/org/embulk/output/mailchimp/model/AuthMethod.java
embulk-output-mailchimp-0.3.24 src/main/java/org/embulk/output/mailchimp/model/AuthMethod.java
embulk-output-mailchimp-0.3.23 src/main/java/org/embulk/output/mailchimp/model/AuthMethod.java
embulk-output-mailchimp-0.3.22 src/main/java/org/embulk/output/mailchimp/model/AuthMethod.java
embulk-output-mailchimp-0.3.21 src/main/java/org/embulk/output/mailchimp/model/AuthMethod.java
embulk-output-mailchimp-0.3.20 src/main/java/org/embulk/output/mailchimp/model/AuthMethod.java
embulk-output-mailchimp-0.3.19 src/main/java/org/embulk/output/mailchimp/model/AuthMethod.java
embulk-output-mailchimp-0.3.18 src/main/java/org/embulk/output/mailchimp/model/AuthMethod.java
embulk-output-mailchimp-0.3.17 src/main/java/org/embulk/output/mailchimp/model/AuthMethod.java
embulk-output-mailchimp-0.3.16 src/main/java/org/embulk/output/mailchimp/model/AuthMethod.java
embulk-output-mailchimp-0.3.15 src/main/java/org/embulk/output/mailchimp/model/AuthMethod.java
embulk-output-mailchimp-0.3.14 src/main/java/org/embulk/output/mailchimp/model/AuthMethod.java
embulk-output-mailchimp-0.3.13 src/main/java/org/embulk/output/mailchimp/model/AuthMethod.java
embulk-output-mailchimp-0.3.12 src/main/java/org/embulk/output/mailchimp/model/AuthMethod.java
embulk-output-mailchimp-0.3.11 src/main/java/org/embulk/output/mailchimp/model/AuthMethod.java
embulk-output-mailchimp-0.3.10 src/main/java/org/embulk/output/mailchimp/model/AuthMethod.java
embulk-output-mailchimp-0.3.9 src/main/java/org/embulk/output/mailchimp/model/AuthMethod.java
embulk-output-mailchimp-0.3.7 src/main/java/org/embulk/output/mailchimp/model/AuthMethod.java