embulk-input-facebook_ads_insights 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/LICENSE.txt +21 -0
- data/README.md +78 -0
- data/build.gradle +99 -0
- data/config/checkstyle/checkstyle.xml +128 -0
- data/config/checkstyle/default.xml +108 -0
- data/gradle/wrapper/gradle-wrapper.jar +0 -0
- data/gradle/wrapper/gradle-wrapper.properties +5 -0
- data/gradlew +172 -0
- data/gradlew.bat +84 -0
- data/lib/embulk/input/facebook_ads_insights.rb +3 -0
- data/src/main/java/org/embulk/input/facebook_ads_insights/AdsInsightsAccessor.java +149 -0
- data/src/main/java/org/embulk/input/facebook_ads_insights/Client.java +243 -0
- data/src/main/java/org/embulk/input/facebook_ads_insights/FacebookAdsInsightsColumnVisitor.java +123 -0
- data/src/main/java/org/embulk/input/facebook_ads_insights/FacebookAdsInsightsInputPlugin.java +79 -0
- data/src/main/java/org/embulk/input/facebook_ads_insights/PluginTask.java +80 -0
- data/src/main/java/org/embulk/input/facebook_ads_insights/Util.java +18 -0
- data/src/main/java/org/embulk/input/facebook_ads_insights/model/ActionAttributionWindow.java +43 -0
- data/src/main/java/org/embulk/input/facebook_ads_insights/model/ActionBreakdown.java +47 -0
- data/src/main/java/org/embulk/input/facebook_ads_insights/model/ActionReportTime.java +38 -0
- data/src/main/java/org/embulk/input/facebook_ads_insights/model/Breakdown.java +69 -0
- data/src/main/java/org/embulk/input/facebook_ads_insights/model/DatePreset.java +55 -0
- data/src/main/java/org/embulk/input/facebook_ads_insights/model/Level.java +40 -0
- data/src/main/java/org/embulk/input/facebook_ads_insights/model/ObjectType.java +30 -0
- data/src/test/java/org/embulk/input/facebook_ads_insights/TestFacebookAdsInsightsInputPlugin.java +5 -0
- metadata +106 -0
@@ -0,0 +1,55 @@
|
|
1
|
+
package org.embulk.input.facebook_ads_insights.model;
|
2
|
+
|
3
|
+
import com.facebook.ads.sdk.AdsInsights;
|
4
|
+
import com.fasterxml.jackson.annotation.JsonCreator;
|
5
|
+
import com.fasterxml.jackson.annotation.JsonValue;
|
6
|
+
import org.embulk.config.ConfigException;
|
7
|
+
|
8
|
+
public class DatePreset
|
9
|
+
{
|
10
|
+
private final AdsInsights.EnumDatePreset enumDatePreset;
|
11
|
+
|
12
|
+
private DatePreset(final AdsInsights.EnumDatePreset enumDatePreset)
|
13
|
+
{
|
14
|
+
this.enumDatePreset = enumDatePreset;
|
15
|
+
}
|
16
|
+
|
17
|
+
@JsonValue
|
18
|
+
@Override
|
19
|
+
public String toString()
|
20
|
+
{
|
21
|
+
return this.enumDatePreset.toString();
|
22
|
+
}
|
23
|
+
|
24
|
+
@JsonCreator
|
25
|
+
public static DatePreset fromString(final String value)
|
26
|
+
{
|
27
|
+
switch (value) {
|
28
|
+
case "today": return new DatePreset(AdsInsights.EnumDatePreset.VALUE_TODAY);
|
29
|
+
case "yesterday": return new DatePreset(AdsInsights.EnumDatePreset.VALUE_YESTERDAY);
|
30
|
+
case "this_month": return new DatePreset(AdsInsights.EnumDatePreset.VALUE_THIS_MONTH);
|
31
|
+
case "last_month": return new DatePreset(AdsInsights.EnumDatePreset.VALUE_LAST_MONTH);
|
32
|
+
case "this_quarter": return new DatePreset(AdsInsights.EnumDatePreset.VALUE_THIS_QUARTER);
|
33
|
+
case "lifetime": return new DatePreset(AdsInsights.EnumDatePreset.VALUE_LIFETIME);
|
34
|
+
case "last_3d": return new DatePreset(AdsInsights.EnumDatePreset.VALUE_LAST_3D);
|
35
|
+
case "last_7d": return new DatePreset(AdsInsights.EnumDatePreset.VALUE_LAST_7D);
|
36
|
+
case "last_14d": return new DatePreset(AdsInsights.EnumDatePreset.VALUE_LAST_14D);
|
37
|
+
case "last_28d": return new DatePreset(AdsInsights.EnumDatePreset.VALUE_LAST_28D);
|
38
|
+
case "last_30d": return new DatePreset(AdsInsights.EnumDatePreset.VALUE_LAST_30D);
|
39
|
+
case "last_90d": return new DatePreset(AdsInsights.EnumDatePreset.VALUE_LAST_90D);
|
40
|
+
case "last_week_mon_sun": return new DatePreset(AdsInsights.EnumDatePreset.VALUE_LAST_WEEK_MON_SUN);
|
41
|
+
case "last_week_sun_sat": return new DatePreset(AdsInsights.EnumDatePreset.VALUE_LAST_WEEK_SUN_SAT);
|
42
|
+
case "last_quarter": return new DatePreset(AdsInsights.EnumDatePreset.VALUE_LAST_QUARTER);
|
43
|
+
case "last_year": return new DatePreset(AdsInsights.EnumDatePreset.VALUE_LAST_YEAR);
|
44
|
+
case "this_week_mon_today": return new DatePreset(AdsInsights.EnumDatePreset.VALUE_THIS_WEEK_MON_TODAY);
|
45
|
+
case "this_week_sun_today": return new DatePreset(AdsInsights.EnumDatePreset.VALUE_THIS_WEEK_SUN_TODAY);
|
46
|
+
case "this_year": return new DatePreset(AdsInsights.EnumDatePreset.VALUE_THIS_YEAR);
|
47
|
+
default: throw new ConfigException(String.format("Unknown DatePreset value '%s'", value));
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
public AdsInsights.EnumDatePreset getEnum()
|
52
|
+
{
|
53
|
+
return this.enumDatePreset;
|
54
|
+
}
|
55
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
package org.embulk.input.facebook_ads_insights.model;
|
2
|
+
|
3
|
+
import com.facebook.ads.sdk.AdsInsights;
|
4
|
+
import com.fasterxml.jackson.annotation.JsonCreator;
|
5
|
+
import com.fasterxml.jackson.annotation.JsonValue;
|
6
|
+
import org.embulk.config.ConfigException;
|
7
|
+
|
8
|
+
public class Level
|
9
|
+
{
|
10
|
+
private final AdsInsights.EnumLevel enumLevel;
|
11
|
+
|
12
|
+
private Level(final AdsInsights.EnumLevel enumLevel)
|
13
|
+
{
|
14
|
+
this.enumLevel = enumLevel;
|
15
|
+
}
|
16
|
+
|
17
|
+
@JsonValue
|
18
|
+
@Override
|
19
|
+
public String toString()
|
20
|
+
{
|
21
|
+
return this.enumLevel.toString();
|
22
|
+
}
|
23
|
+
|
24
|
+
@JsonCreator
|
25
|
+
public static Level fromString(final String value)
|
26
|
+
{
|
27
|
+
switch (value) {
|
28
|
+
case "account": return new Level(AdsInsights.EnumLevel.VALUE_ACCOUNT);
|
29
|
+
case "campaign": return new Level(AdsInsights.EnumLevel.VALUE_CAMPAIGN);
|
30
|
+
case "adset": return new Level(AdsInsights.EnumLevel.VALUE_ADSET);
|
31
|
+
case "ad": return new Level(AdsInsights.EnumLevel.VALUE_AD);
|
32
|
+
default: throw new ConfigException(String.format("Unknown Level value '%s'", value));
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
public AdsInsights.EnumLevel getEnum()
|
37
|
+
{
|
38
|
+
return this.enumLevel;
|
39
|
+
}
|
40
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
package org.embulk.input.facebook_ads_insights.model;
|
2
|
+
|
3
|
+
import com.fasterxml.jackson.annotation.JsonCreator;
|
4
|
+
import com.fasterxml.jackson.annotation.JsonValue;
|
5
|
+
import org.embulk.config.ConfigException;
|
6
|
+
|
7
|
+
public enum ObjectType {
|
8
|
+
ACCOUNT,
|
9
|
+
CAMPAIGN,
|
10
|
+
ADSET,
|
11
|
+
AD;
|
12
|
+
@JsonValue
|
13
|
+
@Override
|
14
|
+
public String toString()
|
15
|
+
{
|
16
|
+
return this.name().toLowerCase();
|
17
|
+
}
|
18
|
+
|
19
|
+
@JsonCreator
|
20
|
+
public static ObjectType fromString(final String value)
|
21
|
+
{
|
22
|
+
switch (value) {
|
23
|
+
case "account": return ACCOUNT;
|
24
|
+
case "campaign": return CAMPAIGN;
|
25
|
+
case "adset": return ADSET;
|
26
|
+
case "ad": return AD;
|
27
|
+
default: throw new ConfigException(String.format("Unknown ObjectType value '%s'", value));
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
metadata
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: embulk-input-facebook_ads_insights
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- naotaka nakane
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-09-28 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - "~>"
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '1.0'
|
19
|
+
name: bundler
|
20
|
+
prerelease: false
|
21
|
+
type: :development
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - "~>"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '12.0'
|
33
|
+
name: rake
|
34
|
+
prerelease: false
|
35
|
+
type: :development
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '12.0'
|
41
|
+
description: Loads records from Facebook Ads Insights.
|
42
|
+
email:
|
43
|
+
- n.nakane0219@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- LICENSE.txt
|
50
|
+
- README.md
|
51
|
+
- build.gradle
|
52
|
+
- classpath/annotations-13.0.jar
|
53
|
+
- classpath/embulk-input-facebook_ads_insights-0.1.0.jar
|
54
|
+
- classpath/facebook-java-business-sdk-4.0.5.jar
|
55
|
+
- classpath/gson-2.5.jar
|
56
|
+
- classpath/guava-20.0.jar
|
57
|
+
- classpath/kotlin-stdlib-1.3.0.jar
|
58
|
+
- classpath/kotlin-stdlib-common-1.3.0.jar
|
59
|
+
- classpath/okhttp-3.9.1.jar
|
60
|
+
- classpath/okio-2.1.0.jar
|
61
|
+
- config/checkstyle/checkstyle.xml
|
62
|
+
- config/checkstyle/default.xml
|
63
|
+
- gradle/wrapper/gradle-wrapper.jar
|
64
|
+
- gradle/wrapper/gradle-wrapper.properties
|
65
|
+
- gradlew
|
66
|
+
- gradlew.bat
|
67
|
+
- lib/embulk/input/facebook_ads_insights.rb
|
68
|
+
- src/main/java/org/embulk/input/facebook_ads_insights/AdsInsightsAccessor.java
|
69
|
+
- src/main/java/org/embulk/input/facebook_ads_insights/Client.java
|
70
|
+
- src/main/java/org/embulk/input/facebook_ads_insights/FacebookAdsInsightsColumnVisitor.java
|
71
|
+
- src/main/java/org/embulk/input/facebook_ads_insights/FacebookAdsInsightsInputPlugin.java
|
72
|
+
- src/main/java/org/embulk/input/facebook_ads_insights/PluginTask.java
|
73
|
+
- src/main/java/org/embulk/input/facebook_ads_insights/Util.java
|
74
|
+
- src/main/java/org/embulk/input/facebook_ads_insights/model/ActionAttributionWindow.java
|
75
|
+
- src/main/java/org/embulk/input/facebook_ads_insights/model/ActionBreakdown.java
|
76
|
+
- src/main/java/org/embulk/input/facebook_ads_insights/model/ActionReportTime.java
|
77
|
+
- src/main/java/org/embulk/input/facebook_ads_insights/model/Breakdown.java
|
78
|
+
- src/main/java/org/embulk/input/facebook_ads_insights/model/DatePreset.java
|
79
|
+
- src/main/java/org/embulk/input/facebook_ads_insights/model/Level.java
|
80
|
+
- src/main/java/org/embulk/input/facebook_ads_insights/model/ObjectType.java
|
81
|
+
- src/test/java/org/embulk/input/facebook_ads_insights/TestFacebookAdsInsightsInputPlugin.java
|
82
|
+
homepage: https://github.com/trocco-io/embulk-input-facebook_ads_insights
|
83
|
+
licenses:
|
84
|
+
- MIT
|
85
|
+
metadata: {}
|
86
|
+
post_install_message:
|
87
|
+
rdoc_options: []
|
88
|
+
require_paths:
|
89
|
+
- lib
|
90
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
requirements: []
|
101
|
+
rubyforge_project:
|
102
|
+
rubygems_version: 2.6.8
|
103
|
+
signing_key:
|
104
|
+
specification_version: 4
|
105
|
+
summary: Facebook Ads Insights input plugin for Embulk
|
106
|
+
test_files: []
|