Sha256: fc587f2340c03f5e9c877d8547f936754c3654be809b0e678fd775763e5a8361

Contents?: true

Size: 1.13 KB

Versions: 12

Compression:

Stored size: 1.13 KB

Contents

package org.embulk.input.facebook_ads_insights.model;

import com.facebook.ads.sdk.AdsInsights;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import org.embulk.config.ConfigException;

public class Level
{
    private final AdsInsights.EnumLevel enumLevel;

    private Level(final AdsInsights.EnumLevel enumLevel)
    {
        this.enumLevel = enumLevel;
    }

    @JsonValue
    @Override
    public String toString()
    {
        return this.enumLevel.toString();
    }

    @JsonCreator
    public static Level fromString(final String value)
    {
        switch (value) {
            case "account": return new Level(AdsInsights.EnumLevel.VALUE_ACCOUNT);
            case "campaign": return new Level(AdsInsights.EnumLevel.VALUE_CAMPAIGN);
            case "adset": return new Level(AdsInsights.EnumLevel.VALUE_ADSET);
            case "ad": return new Level(AdsInsights.EnumLevel.VALUE_AD);
            default: throw new ConfigException(String.format("Unknown Level value '%s'", value));
        }
    }

    public AdsInsights.EnumLevel getEnum()
    {
        return this.enumLevel;
    }
}

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
embulk-input-facebook_ads_insights-0.1.11 src/main/java/org/embulk/input/facebook_ads_insights/model/Level.java
embulk-input-facebook_ads_insights-0.1.10 src/main/java/org/embulk/input/facebook_ads_insights/model/Level.java
embulk-input-facebook_ads_insights-0.1.9 src/main/java/org/embulk/input/facebook_ads_insights/model/Level.java
embulk-input-facebook_ads_insights-0.1.8 src/main/java/org/embulk/input/facebook_ads_insights/model/Level.java
embulk-input-facebook_ads_insights-0.1.7 src/main/java/org/embulk/input/facebook_ads_insights/model/Level.java
embulk-input-facebook_ads_insights-0.1.6 src/main/java/org/embulk/input/facebook_ads_insights/model/Level.java
embulk-input-facebook_ads_insights-0.1.5 src/main/java/org/embulk/input/facebook_ads_insights/model/Level.java
embulk-input-facebook_ads_insights-0.1.4 src/main/java/org/embulk/input/facebook_ads_insights/model/Level.java
embulk-input-facebook_ads_insights-0.1.3 src/main/java/org/embulk/input/facebook_ads_insights/model/Level.java
embulk-input-facebook_ads_insights-0.1.2 src/main/java/org/embulk/input/facebook_ads_insights/model/Level.java
embulk-input-facebook_ads_insights-0.1.1 src/main/java/org/embulk/input/facebook_ads_insights/model/Level.java
embulk-input-facebook_ads_insights-0.1.0 src/main/java/org/embulk/input/facebook_ads_insights/model/Level.java