diff --git a/android/java/v1/AmpliApp/ampli.json b/android/java/v1/AmpliApp/ampli.json index 351ec49a..2e29ca39 100644 --- a/android/java/v1/AmpliApp/ampli.json +++ b/android/java/v1/AmpliApp/ampli.json @@ -4,8 +4,11 @@ "SourceId": "5152cfab-d377-4cea-bc98-47320e113d06", "Path": "./app/src/main/java/com/amplitude/ampli", "Branch": "main", - "Version": "0.0.0", + "Version": "1.0.0", "Runtime": "android:java-ampli", - "VersionId": "79154a50-f057-4db5-9755-775e4e9f05e6", - "OmitApiKeys": true + "VersionId": "a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c", + "OmitApiKeys": true, + "Platform": "Android", + "Language": "Java", + "SDK": "com.amplitude:android-sdk:2.+" } \ No newline at end of file diff --git a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/Ampli.java b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/Ampli.java index 17df26d6..025b100e 100644 --- a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/Ampli.java +++ b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/Ampli.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli' // -// Required dependencies: com.amplitude:android-sdk:2.37.0, com.squareup.okhttp3:okhttp:4.2.2 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:android-sdk:[2.37.0,3.0), com.squareup.okhttp3:okhttp:4.2.2 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli // @@ -45,15 +45,15 @@ private synchronized static void createSingleton() { } public enum Environment { - DEV, - PROD + PROD, + DEV } public static final Map API_KEY = new HashMap<>(); static { - API_KEY.put(Environment.DEV, ""); API_KEY.put(Environment.PROD, ""); + API_KEY.put(Environment.DEV, ""); } private boolean disabled = false; @@ -72,8 +72,8 @@ public AmplitudeClient getClient() { private final Plan observePlan = new Plan() .setBranch("main") .setSource("java-ampli") - .setVersion("0") - .setVersionId("79154a50-f057-4db5-9755-775e4e9f05e6"); + .setVersion("1") + .setVersionId("a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c"); // Options should have 'environment', 'client.api_key' or 'client.instance' public void load(android.content.Context appContext, LoadOptions options) { @@ -185,70 +185,6 @@ public void flush() { this.client.uploadEvents(); } - /** - * EventMaxIntForTest - *

- * View in Tracking Plan - *

- * Event to test schema validation - *

- * Owner: Test codegen - * - * @param event The event - */ - public void eventMaxIntForTest(EventMaxIntForTest event) { - this.eventMaxIntForTest(event, null, null); - } - - /** - * EventMaxIntForTest - *

- * View in Tracking Plan - *

- * Event to test schema validation - *

- * Owner: Test codegen - * - * @param event The event - * @param options The event's options - */ - public void eventMaxIntForTest(EventMaxIntForTest event, EventOptions options) { - this.eventMaxIntForTest(event, options, null); - } - - /** - * EventMaxIntForTest - *

- * View in Tracking Plan - *

- * Event to test schema validation - *

- * Owner: Test codegen - * - * @param event The event - * @param extra Extra untyped parameters for use in middleware - */ - public void eventMaxIntForTest(EventMaxIntForTest event, MiddlewareExtra extra) { - this.eventMaxIntForTest(event, null, extra); - } - - /** - * EventMaxIntForTest - *

- * View in Tracking Plan - *

- * Event to test schema validation - *

- * Owner: Test codegen - * - * @param event The event - * @param options The event's options - * @param extra Extra untyped parameters for use in middleware - */ - public void eventMaxIntForTest(EventMaxIntForTest event, EventOptions options, MiddlewareExtra extra) { - this.track(event, options, extra); - } - /** * Event No Properties *

@@ -561,70 +497,6 @@ public void eventWithConstTypes(EventOptions options, MiddlewareExtra extra) { this.track(EventWithConstTypes.builder().build(), options, extra); } - /** - * event withDifferent_CasingTypes - *

- * View in Tracking Plan - *

- * Description for case with space - *

- * Owner: Test codegen - * - * @param event The event - */ - public void eventWithDifferentCasingTypes(EventWithDifferentCasingTypes event) { - this.eventWithDifferentCasingTypes(event, null, null); - } - - /** - * event withDifferent_CasingTypes - *

- * View in Tracking Plan - *

- * Description for case with space - *

- * Owner: Test codegen - * - * @param event The event - * @param options The event's options - */ - public void eventWithDifferentCasingTypes(EventWithDifferentCasingTypes event, EventOptions options) { - this.eventWithDifferentCasingTypes(event, options, null); - } - - /** - * event withDifferent_CasingTypes - *

- * View in Tracking Plan - *

- * Description for case with space - *

- * Owner: Test codegen - * - * @param event The event - * @param extra Extra untyped parameters for use in middleware - */ - public void eventWithDifferentCasingTypes(EventWithDifferentCasingTypes event, MiddlewareExtra extra) { - this.eventWithDifferentCasingTypes(event, null, extra); - } - - /** - * event withDifferent_CasingTypes - *

- * View in Tracking Plan - *

- * Description for case with space - *

- * Owner: Test codegen - * - * @param event The event - * @param options The event's options - * @param extra Extra untyped parameters for use in middleware - */ - public void eventWithDifferentCasingTypes(EventWithDifferentCasingTypes event, EventOptions options, MiddlewareExtra extra) { - this.track(event, options, extra); - } - /** * Event With Enum Types *

@@ -881,6 +753,134 @@ public void eventWithTemplateProperties(EventWithTemplateProperties event, Event this.track(event, options, extra); } + /** + * event withDifferent_CasingTypes + *

+ * View in Tracking Plan + *

+ * Description for case with space + *

+ * Owner: Test codegen + * + * @param event The event + */ + public void eventWithDifferentCasingTypes(EventWithDifferentCasingTypes event) { + this.eventWithDifferentCasingTypes(event, null, null); + } + + /** + * event withDifferent_CasingTypes + *

+ * View in Tracking Plan + *

+ * Description for case with space + *

+ * Owner: Test codegen + * + * @param event The event + * @param options The event's options + */ + public void eventWithDifferentCasingTypes(EventWithDifferentCasingTypes event, EventOptions options) { + this.eventWithDifferentCasingTypes(event, options, null); + } + + /** + * event withDifferent_CasingTypes + *

+ * View in Tracking Plan + *

+ * Description for case with space + *

+ * Owner: Test codegen + * + * @param event The event + * @param extra Extra untyped parameters for use in middleware + */ + public void eventWithDifferentCasingTypes(EventWithDifferentCasingTypes event, MiddlewareExtra extra) { + this.eventWithDifferentCasingTypes(event, null, extra); + } + + /** + * event withDifferent_CasingTypes + *

+ * View in Tracking Plan + *

+ * Description for case with space + *

+ * Owner: Test codegen + * + * @param event The event + * @param options The event's options + * @param extra Extra untyped parameters for use in middleware + */ + public void eventWithDifferentCasingTypes(EventWithDifferentCasingTypes event, EventOptions options, MiddlewareExtra extra) { + this.track(event, options, extra); + } + + /** + * EventMaxIntForTest + *

+ * View in Tracking Plan + *

+ * Event to test schema validation + *

+ * Owner: Test codegen + * + * @param event The event + */ + public void eventMaxIntForTest(EventMaxIntForTest event) { + this.eventMaxIntForTest(event, null, null); + } + + /** + * EventMaxIntForTest + *

+ * View in Tracking Plan + *

+ * Event to test schema validation + *

+ * Owner: Test codegen + * + * @param event The event + * @param options The event's options + */ + public void eventMaxIntForTest(EventMaxIntForTest event, EventOptions options) { + this.eventMaxIntForTest(event, options, null); + } + + /** + * EventMaxIntForTest + *

+ * View in Tracking Plan + *

+ * Event to test schema validation + *

+ * Owner: Test codegen + * + * @param event The event + * @param extra Extra untyped parameters for use in middleware + */ + public void eventMaxIntForTest(EventMaxIntForTest event, MiddlewareExtra extra) { + this.eventMaxIntForTest(event, null, extra); + } + + /** + * EventMaxIntForTest + *

+ * View in Tracking Plan + *

+ * Event to test schema validation + *

+ * Owner: Test codegen + * + * @param event The event + * @param options The event's options + * @param extra Extra untyped parameters for use in middleware + */ + public void eventMaxIntForTest(EventMaxIntForTest event, EventOptions options, MiddlewareExtra extra) { + this.track(event, options, extra); + } + private void handleEventOptions(EventOptions options, String userId) { if (options != null && options.deviceId != null) { this.client.setDeviceId(options.deviceId); diff --git a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/Event.java b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/Event.java index cb51869b..1b5846dd 100644 --- a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/Event.java +++ b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/Event.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli' // -// Required dependencies: com.amplitude:android-sdk:2.37.0, com.squareup.okhttp3:okhttp:4.2.2 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:android-sdk:[2.37.0,3.0), com.squareup.okhttp3:okhttp:4.2.2 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli // diff --git a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventMaxIntForTest.java b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventMaxIntForTest.java index efb306d3..fcca83c6 100644 --- a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventMaxIntForTest.java +++ b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventMaxIntForTest.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli' // -// Required dependencies: com.amplitude:android-sdk:2.37.0, com.squareup.okhttp3:okhttp:4.2.2 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:android-sdk:[2.37.0,3.0), com.squareup.okhttp3:okhttp:4.2.2 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli // diff --git a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventNoProperties.java b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventNoProperties.java index dd863b85..36135d62 100644 --- a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventNoProperties.java +++ b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventNoProperties.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli' // -// Required dependencies: com.amplitude:android-sdk:2.37.0, com.squareup.okhttp3:okhttp:4.2.2 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:android-sdk:[2.37.0,3.0), com.squareup.okhttp3:okhttp:4.2.2 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli // diff --git a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventObjectTypes.java b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventObjectTypes.java index 26541835..1dba3dbf 100644 --- a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventObjectTypes.java +++ b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventObjectTypes.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli' // -// Required dependencies: com.amplitude:android-sdk:2.37.0, com.squareup.okhttp3:okhttp:4.2.2 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:android-sdk:[2.37.0,3.0), com.squareup.okhttp3:okhttp:4.2.2 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli // diff --git a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventOptions.java b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventOptions.java index e825ec94..c17c73d5 100644 --- a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventOptions.java +++ b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventOptions.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli' // -// Required dependencies: com.amplitude:android-sdk:2.37.0, com.squareup.okhttp3:okhttp:4.2.2 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:android-sdk:[2.37.0,3.0), com.squareup.okhttp3:okhttp:4.2.2 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli // diff --git a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithAllProperties.java b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithAllProperties.java index 11af1df3..db967f0e 100644 --- a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithAllProperties.java +++ b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithAllProperties.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli' // -// Required dependencies: com.amplitude:android-sdk:2.37.0, com.squareup.okhttp3:okhttp:4.2.2 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:android-sdk:[2.37.0,3.0), com.squareup.okhttp3:okhttp:4.2.2 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli // diff --git a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithArrayTypes.java b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithArrayTypes.java index 46b8c5e1..a95dbd64 100644 --- a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithArrayTypes.java +++ b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithArrayTypes.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli' // -// Required dependencies: com.amplitude:android-sdk:2.37.0, com.squareup.okhttp3:okhttp:4.2.2 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:android-sdk:[2.37.0,3.0), com.squareup.okhttp3:okhttp:4.2.2 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli // @@ -25,7 +25,7 @@ private EventWithArrayTypes(Builder builder) { public static IRequiredBooleanArray builder() { return new Builder(); } // Inner Builder class with required properties - public static class Builder implements IRequiredBooleanArray, IRequiredNumberArray, IRequiredObjectArray, IRequiredStringArray, IBuild { + public static class Builder implements IRequiredBooleanArray, IRequiredEnumArray, IRequiredNumberArray, IRequiredObjectArray, IRequiredStringArray, IBuild { private final HashMap properties = new HashMap<>(); private Builder() { @@ -35,13 +35,23 @@ private Builder() { /** * description for required boolean array *

- * Must be followed by {@link IRequiredNumberArray#requiredNumberArray(Double[]) + * Must be followed by {@link IRequiredEnumArray#requiredEnumArray(String[]) */ - public IRequiredNumberArray requiredBooleanArray(Boolean[] requiredBooleanArray) { + public IRequiredEnumArray requiredBooleanArray(Boolean[] requiredBooleanArray) { this.properties.put("requiredBooleanArray", requiredBooleanArray); return this; } + /** + * Description for enum array property + *

+ * Must be followed by {@link IRequiredNumberArray#requiredNumberArray(Double[]) + */ + public IRequiredNumberArray requiredEnumArray(String[] requiredEnumArray) { + this.properties.put("requiredEnumArray", requiredEnumArray); + return this; + } + /** * Description for required number array *

@@ -79,7 +89,11 @@ public EventWithArrayTypes build() { // Required property interfaces public interface IRequiredBooleanArray { - IRequiredNumberArray requiredBooleanArray(Boolean[] requiredBooleanArray); + IRequiredEnumArray requiredBooleanArray(Boolean[] requiredBooleanArray); + } + + public interface IRequiredEnumArray { + IRequiredNumberArray requiredEnumArray(String[] requiredEnumArray); } public interface IRequiredNumberArray { diff --git a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithConstTypes.java b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithConstTypes.java index a0e91059..2b1ddffb 100644 --- a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithConstTypes.java +++ b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithConstTypes.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli' // -// Required dependencies: com.amplitude:android-sdk:2.37.0, com.squareup.okhttp3:okhttp:4.2.2 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:android-sdk:[2.37.0,3.0), com.squareup.okhttp3:okhttp:4.2.2 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli // diff --git a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithDifferentCasingTypes.java b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithDifferentCasingTypes.java index 27ce9797..aeb4427a 100644 --- a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithDifferentCasingTypes.java +++ b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithDifferentCasingTypes.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli' // -// Required dependencies: com.amplitude:android-sdk:2.37.0, com.squareup.okhttp3:okhttp:4.2.2 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:android-sdk:[2.37.0,3.0), com.squareup.okhttp3:okhttp:4.2.2 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli // @@ -18,8 +18,8 @@ import java.util.HashMap; public class EventWithDifferentCasingTypes extends Event { - public enum EnumCamelCase { - ENUMCAMELCASE("enumCamelCase"); + public enum EnumWithSpace { + ENUM_WITH_SPACE("enum with space"); private final String value; @@ -28,14 +28,14 @@ public String getValue() return this.value; } - EnumCamelCase(String value) + EnumWithSpace(String value) { this.value = value; } } - public enum EnumPascalCase { - ENUMPASCALCASE("EnumPascalCase"); + public enum EnumSnakeCase { + ENUM_SNAKE_CASE("enum_snake_case"); private final String value; @@ -44,14 +44,14 @@ public String getValue() return this.value; } - EnumPascalCase(String value) + EnumSnakeCase(String value) { this.value = value; } } - public enum EnumSnakeCase { - ENUM_SNAKE_CASE("enum_snake_case"); + public enum EnumCamelCase { + ENUMCAMELCASE("enumCamelCase"); private final String value; @@ -60,14 +60,14 @@ public String getValue() return this.value; } - EnumSnakeCase(String value) + EnumCamelCase(String value) { this.value = value; } } - public enum EnumWithSpace { - ENUM_WITH_SPACE("enum with space"); + public enum EnumPascalCase { + ENUMPASCALCASE("EnumPascalCase"); private final String value; @@ -76,7 +76,7 @@ public String getValue() return this.value; } - EnumWithSpace(String value) + EnumPascalCase(String value) { this.value = value; } diff --git a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithEnumTypes.java b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithEnumTypes.java index e9b1b48c..61bee410 100644 --- a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithEnumTypes.java +++ b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithEnumTypes.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli' // -// Required dependencies: com.amplitude:android-sdk:2.37.0, com.squareup.okhttp3:okhttp:4.2.2 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:android-sdk:[2.37.0,3.0), com.squareup.okhttp3:okhttp:4.2.2 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli // diff --git a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithOptionalArrayTypes.java b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithOptionalArrayTypes.java index b11b6eac..419c23d6 100644 --- a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithOptionalArrayTypes.java +++ b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithOptionalArrayTypes.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli' // -// Required dependencies: com.amplitude:android-sdk:2.37.0, com.squareup.okhttp3:okhttp:4.2.2 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:android-sdk:[2.37.0,3.0), com.squareup.okhttp3:okhttp:4.2.2 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli // @@ -40,6 +40,14 @@ public IBuild optionalBooleanArray(Boolean[] optionalBooleanArray) { return this; } + /** + * Description for optional enum array + */ + public IBuild optionalEnumArray(String[] optionalEnumArray) { + this.properties.put("optionalEnumArray", optionalEnumArray); + return this; + } + /** * Description for optional object array */ @@ -72,6 +80,7 @@ public EventWithOptionalArrayTypes build() { /** Build interface with optional properties */ public interface IBuild { IBuild optionalBooleanArray(Boolean[] optionalBooleanArray); + IBuild optionalEnumArray(String[] optionalEnumArray); IBuild optionalJsonArray(Object[] optionalJsonArray); IBuild optionalNumberArray(Double[] optionalNumberArray); IBuild optionalStringArray(String[] optionalStringArray); diff --git a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithOptionalProperties.java b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithOptionalProperties.java index 41d3709d..cb1e9fb0 100644 --- a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithOptionalProperties.java +++ b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithOptionalProperties.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli' // -// Required dependencies: com.amplitude:android-sdk:2.37.0, com.squareup.okhttp3:okhttp:4.2.2 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:android-sdk:[2.37.0,3.0), com.squareup.okhttp3:okhttp:4.2.2 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli // diff --git a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithTemplateProperties.java b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithTemplateProperties.java index c42e661a..b50bdf30 100644 --- a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithTemplateProperties.java +++ b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithTemplateProperties.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli' // -// Required dependencies: com.amplitude:android-sdk:2.37.0, com.squareup.okhttp3:okhttp:4.2.2 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:android-sdk:[2.37.0,3.0), com.squareup.okhttp3:okhttp:4.2.2 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli // diff --git a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/Identify.java b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/Identify.java index 9fcb417b..d7926cc7 100644 --- a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/Identify.java +++ b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/Identify.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli' // -// Required dependencies: com.amplitude:android-sdk:2.37.0, com.squareup.okhttp3:okhttp:4.2.2 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:android-sdk:[2.37.0,3.0), com.squareup.okhttp3:okhttp:4.2.2 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli // @@ -19,7 +19,7 @@ public class Identify extends Event { private Identify(Builder builder) { - super("Identify", builder.properties); + super("$identify", builder.properties); } public static IRequiredNumber builder() { return new Builder(); } diff --git a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/LoadClientOptions.java b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/LoadClientOptions.java index 4661a8b1..405cf473 100644 --- a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/LoadClientOptions.java +++ b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/LoadClientOptions.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli' // -// Required dependencies: com.amplitude:android-sdk:2.37.0, com.squareup.okhttp3:okhttp:4.2.2 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:android-sdk:[2.37.0,3.0), com.squareup.okhttp3:okhttp:4.2.2 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli // diff --git a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/LoadOptions.java b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/LoadOptions.java index e19fd6c2..eb019407 100644 --- a/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/LoadOptions.java +++ b/android/java/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/LoadOptions.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli' // -// Required dependencies: com.amplitude:android-sdk:2.37.0, com.squareup.okhttp3:okhttp:4.2.2 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:android-sdk:[2.37.0,3.0), com.squareup.okhttp3:okhttp:4.2.2 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli // diff --git a/android/java/v1/AmpliApp/app/src/main/java/com/example/ampliapp/MainActivity.java b/android/java/v1/AmpliApp/app/src/main/java/com/example/ampliapp/MainActivity.java index 4341373d..14af09c1 100644 --- a/android/java/v1/AmpliApp/app/src/main/java/com/example/ampliapp/MainActivity.java +++ b/android/java/v1/AmpliApp/app/src/main/java/com/example/ampliapp/MainActivity.java @@ -76,6 +76,7 @@ protected void onCreate(Bundle savedInstanceState) { Ampli.getInstance().eventWithArrayTypes(EventWithArrayTypes.builder() .requiredBooleanArray(new Boolean[]{true, false, true}) + .requiredEnumArray(new String[]{"enum1"}) .requiredNumberArray(new Double[]{1.1, 2.2, 3.3}) .requiredObjectArray(new Object[]{1, "a", true}) .requiredStringArray(new String[]{"a", "bc", "def"}) diff --git a/android/java/v2/AmpliApp/ampli.json b/android/java/v2/AmpliApp/ampli.json index 4c578357..0ba85bfa 100644 --- a/android/java/v2/AmpliApp/ampli.json +++ b/android/java/v2/AmpliApp/ampli.json @@ -5,8 +5,11 @@ "SourceId": "73e1bbb5-5036-4712-904e-9df1f195c556", "Runtime": "android:java-ampli-v2", "Branch": "main", - "Version": "0.0.0", - "VersionId": "79154a50-f057-4db5-9755-775e4e9f05e6", + "Version": "1.0.0", + "VersionId": "a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c", "Path": "./app/src/main/java/com/amplitude/ampli", - "OmitApiKeys": true + "OmitApiKeys": true, + "Platform": "Android", + "Language": "Java", + "SDK": "com.amplitude:analytics-android:1.+" } \ No newline at end of file diff --git a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/Ampli.java b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/Ampli.java index 2be85ba8..de3c312b 100644 --- a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/Ampli.java +++ b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/Ampli.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli-v2' // -// Required dependencies: com.amplitude:analytics-android:1.0.0 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:analytics-android:[1.0.0,2.0) +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli-v2 // @@ -41,15 +41,15 @@ private synchronized static void createSingleton() { } public enum Environment { - DEV, - PROD + PROD, + DEV } public static final Map API_KEY = new HashMap<>(); static { - API_KEY.put(Environment.DEV, ""); API_KEY.put(Environment.PROD, ""); + API_KEY.put(Environment.DEV, ""); } private boolean disabled = false; @@ -65,7 +65,7 @@ public Amplitude getClient() { return this.client; } - private Plan defaultObservePlan = new Plan("main","java-ampli-v2","0", "79154a50-f057-4db5-9755-775e4e9f05e6"); + private Plan defaultObservePlan = new Plan("main","java-ampli-v2","1", "a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c"); // Options should have 'environment', 'client.api_key' or 'client.instance' public void load(android.content.Context appContext, LoadOptions options) { @@ -148,37 +148,6 @@ public void flush() { this.client.flush(); } - /** - * EventMaxIntForTest - *

- * View in Tracking Plan - *

- * Event to test schema validation - *

- * Owner: Test codegen - * - * @param event The event - */ - public void eventMaxIntForTest(EventMaxIntForTest event) { - this.eventMaxIntForTest(event, null); - } - - /** - * EventMaxIntForTest - *

- * View in Tracking Plan - *

- * Event to test schema validation - *

- * Owner: Test codegen - * - * @param event The event - * @param options The event's options - */ - public void eventMaxIntForTest(EventMaxIntForTest event, EventOptions options) { - this.track(event, options); - } - /** * Event No Properties *

@@ -330,37 +299,6 @@ public void eventWithConstTypes(EventOptions options) { this.track(EventWithConstTypes.builder().build(), options); } - /** - * event withDifferent_CasingTypes - *

- * View in Tracking Plan - *

- * Description for case with space - *

- * Owner: Test codegen - * - * @param event The event - */ - public void eventWithDifferentCasingTypes(EventWithDifferentCasingTypes event) { - this.eventWithDifferentCasingTypes(event, null); - } - - /** - * event withDifferent_CasingTypes - *

- * View in Tracking Plan - *

- * Description for case with space - *

- * Owner: Test codegen - * - * @param event The event - * @param options The event's options - */ - public void eventWithDifferentCasingTypes(EventWithDifferentCasingTypes event, EventOptions options) { - this.track(event, options); - } - /** * Event With Enum Types *

@@ -485,6 +423,68 @@ public void eventWithTemplateProperties(EventWithTemplateProperties event, Event this.track(event, options); } + /** + * event withDifferent_CasingTypes + *

+ * View in Tracking Plan + *

+ * Description for case with space + *

+ * Owner: Test codegen + * + * @param event The event + */ + public void eventWithDifferentCasingTypes(EventWithDifferentCasingTypes event) { + this.eventWithDifferentCasingTypes(event, null); + } + + /** + * event withDifferent_CasingTypes + *

+ * View in Tracking Plan + *

+ * Description for case with space + *

+ * Owner: Test codegen + * + * @param event The event + * @param options The event's options + */ + public void eventWithDifferentCasingTypes(EventWithDifferentCasingTypes event, EventOptions options) { + this.track(event, options); + } + + /** + * EventMaxIntForTest + *

+ * View in Tracking Plan + *

+ * Event to test schema validation + *

+ * Owner: Test codegen + * + * @param event The event + */ + public void eventMaxIntForTest(EventMaxIntForTest event) { + this.eventMaxIntForTest(event, null); + } + + /** + * EventMaxIntForTest + *

+ * View in Tracking Plan + *

+ * Event to test schema validation + *

+ * Owner: Test codegen + * + * @param event The event + * @param options The event's options + */ + public void eventMaxIntForTest(EventMaxIntForTest event, EventOptions options) { + this.track(event, options); + } + private boolean isInitializedAndEnabled() { if (this.client == null) { System.err.println("Ampli is not yet initialized. Have you called `Ampli.getInstance().load()` on app start?"); diff --git a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/DefaultConfiguration.java b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/DefaultConfiguration.java index 0f488ff1..28880d58 100644 --- a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/DefaultConfiguration.java +++ b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/DefaultConfiguration.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli-v2' // -// Required dependencies: com.amplitude:analytics-android:1.0.0 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:analytics-android:[1.0.0,2.0) +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli-v2 // diff --git a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventMaxIntForTest.java b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventMaxIntForTest.java index 067f8f17..5574bac6 100644 --- a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventMaxIntForTest.java +++ b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventMaxIntForTest.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli-v2' // -// Required dependencies: com.amplitude:analytics-android:1.0.0 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:analytics-android:[1.0.0,2.0) +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli-v2 // diff --git a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventNoProperties.java b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventNoProperties.java index 5da40249..3bbc43b9 100644 --- a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventNoProperties.java +++ b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventNoProperties.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli-v2' // -// Required dependencies: com.amplitude:analytics-android:1.0.0 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:analytics-android:[1.0.0,2.0) +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli-v2 // diff --git a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventObjectTypes.java b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventObjectTypes.java index bc6f3bcf..4c129461 100644 --- a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventObjectTypes.java +++ b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventObjectTypes.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli-v2' // -// Required dependencies: com.amplitude:analytics-android:1.0.0 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:analytics-android:[1.0.0,2.0) +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli-v2 // diff --git a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithAllProperties.java b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithAllProperties.java index 5b1b32db..1f729fb1 100644 --- a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithAllProperties.java +++ b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithAllProperties.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli-v2' // -// Required dependencies: com.amplitude:analytics-android:1.0.0 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:analytics-android:[1.0.0,2.0) +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli-v2 // diff --git a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithArrayTypes.java b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithArrayTypes.java index 285c7bdd..2b78e7c3 100644 --- a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithArrayTypes.java +++ b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithArrayTypes.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli-v2' // -// Required dependencies: com.amplitude:analytics-android:1.0.0 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:analytics-android:[1.0.0,2.0) +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli-v2 // @@ -27,7 +27,7 @@ private EventWithArrayTypes(Builder builder) { public static IRequiredBooleanArray builder() { return new Builder(); } // Inner Builder class with required properties - public static class Builder implements IRequiredBooleanArray, IRequiredNumberArray, IRequiredObjectArray, IRequiredStringArray, IBuild { + public static class Builder implements IRequiredBooleanArray, IRequiredEnumArray, IRequiredNumberArray, IRequiredObjectArray, IRequiredStringArray, IBuild { private final HashMap properties = new HashMap<>(); private Builder() { @@ -37,13 +37,23 @@ private Builder() { /** * description for required boolean array *

- * Must be followed by {@link IRequiredNumberArray#requiredNumberArray(Double[]) + * Must be followed by {@link IRequiredEnumArray#requiredEnumArray(String[]) */ - public IRequiredNumberArray requiredBooleanArray(Boolean[] requiredBooleanArray) { + public IRequiredEnumArray requiredBooleanArray(Boolean[] requiredBooleanArray) { this.properties.put("requiredBooleanArray", requiredBooleanArray); return this; } + /** + * Description for enum array property + *

+ * Must be followed by {@link IRequiredNumberArray#requiredNumberArray(Double[]) + */ + public IRequiredNumberArray requiredEnumArray(String[] requiredEnumArray) { + this.properties.put("requiredEnumArray", requiredEnumArray); + return this; + } + /** * Description for required number array *

@@ -81,7 +91,11 @@ public EventWithArrayTypes build() { // Required property interfaces public interface IRequiredBooleanArray { - IRequiredNumberArray requiredBooleanArray(Boolean[] requiredBooleanArray); + IRequiredEnumArray requiredBooleanArray(Boolean[] requiredBooleanArray); + } + + public interface IRequiredEnumArray { + IRequiredNumberArray requiredEnumArray(String[] requiredEnumArray); } public interface IRequiredNumberArray { diff --git a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithConstTypes.java b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithConstTypes.java index d43cef00..c2750933 100644 --- a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithConstTypes.java +++ b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithConstTypes.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli-v2' // -// Required dependencies: com.amplitude:analytics-android:1.0.0 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:analytics-android:[1.0.0,2.0) +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli-v2 // diff --git a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithDifferentCasingTypes.java b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithDifferentCasingTypes.java index 4f49614e..73485213 100644 --- a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithDifferentCasingTypes.java +++ b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithDifferentCasingTypes.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli-v2' // -// Required dependencies: com.amplitude:analytics-android:1.0.0 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:analytics-android:[1.0.0,2.0) +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli-v2 // @@ -19,8 +19,8 @@ import com.amplitude.android.events.BaseEvent; public class EventWithDifferentCasingTypes extends BaseEvent { - public enum EnumCamelCase { - ENUMCAMELCASE("enumCamelCase"); + public enum EnumWithSpace { + ENUM_WITH_SPACE("enum with space"); private final String value; @@ -29,14 +29,14 @@ public String getValue() return this.value; } - EnumCamelCase(String value) + EnumWithSpace(String value) { this.value = value; } } - public enum EnumPascalCase { - ENUMPASCALCASE("EnumPascalCase"); + public enum EnumSnakeCase { + ENUM_SNAKE_CASE("enum_snake_case"); private final String value; @@ -45,14 +45,14 @@ public String getValue() return this.value; } - EnumPascalCase(String value) + EnumSnakeCase(String value) { this.value = value; } } - public enum EnumSnakeCase { - ENUM_SNAKE_CASE("enum_snake_case"); + public enum EnumCamelCase { + ENUMCAMELCASE("enumCamelCase"); private final String value; @@ -61,14 +61,14 @@ public String getValue() return this.value; } - EnumSnakeCase(String value) + EnumCamelCase(String value) { this.value = value; } } - public enum EnumWithSpace { - ENUM_WITH_SPACE("enum with space"); + public enum EnumPascalCase { + ENUMPASCALCASE("EnumPascalCase"); private final String value; @@ -77,7 +77,7 @@ public String getValue() return this.value; } - EnumWithSpace(String value) + EnumPascalCase(String value) { this.value = value; } diff --git a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithEnumTypes.java b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithEnumTypes.java index 537674fd..c928565c 100644 --- a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithEnumTypes.java +++ b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithEnumTypes.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli-v2' // -// Required dependencies: com.amplitude:analytics-android:1.0.0 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:analytics-android:[1.0.0,2.0) +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli-v2 // diff --git a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithOptionalArrayTypes.java b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithOptionalArrayTypes.java index 9606c30f..d6ebae03 100644 --- a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithOptionalArrayTypes.java +++ b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithOptionalArrayTypes.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli-v2' // -// Required dependencies: com.amplitude:analytics-android:1.0.0 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:analytics-android:[1.0.0,2.0) +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli-v2 // @@ -42,6 +42,14 @@ public IBuild optionalBooleanArray(Boolean[] optionalBooleanArray) { return this; } + /** + * Description for optional enum array + */ + public IBuild optionalEnumArray(String[] optionalEnumArray) { + this.properties.put("optionalEnumArray", optionalEnumArray); + return this; + } + /** * Description for optional object array */ @@ -74,6 +82,7 @@ public EventWithOptionalArrayTypes build() { /** Build interface with optional properties */ public interface IBuild { IBuild optionalBooleanArray(Boolean[] optionalBooleanArray); + IBuild optionalEnumArray(String[] optionalEnumArray); IBuild optionalJsonArray(Object[] optionalJsonArray); IBuild optionalNumberArray(Double[] optionalNumberArray); IBuild optionalStringArray(String[] optionalStringArray); diff --git a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithOptionalProperties.java b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithOptionalProperties.java index 2995fe22..ebea6e3c 100644 --- a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithOptionalProperties.java +++ b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithOptionalProperties.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli-v2' // -// Required dependencies: com.amplitude:analytics-android:1.0.0 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:analytics-android:[1.0.0,2.0) +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli-v2 // diff --git a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithTemplateProperties.java b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithTemplateProperties.java index 429e8790..c5370401 100644 --- a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithTemplateProperties.java +++ b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/EventWithTemplateProperties.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli-v2' // -// Required dependencies: com.amplitude:analytics-android:1.0.0 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:analytics-android:[1.0.0,2.0) +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli-v2 // diff --git a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/Identify.java b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/Identify.java index 8a5b2874..5227f944 100644 --- a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/Identify.java +++ b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/Identify.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli-v2' // -// Required dependencies: com.amplitude:analytics-android:1.0.0 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:analytics-android:[1.0.0,2.0) +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli-v2 // diff --git a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/LoadClientOptions.java b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/LoadClientOptions.java index ad86a939..bf4e2a45 100644 --- a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/LoadClientOptions.java +++ b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/LoadClientOptions.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli-v2' // -// Required dependencies: com.amplitude:analytics-android:1.0.0 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:analytics-android:[1.0.0,2.0) +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli-v2 // diff --git a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/LoadOptions.java b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/LoadOptions.java index 044975e3..bc05cfec 100644 --- a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/LoadOptions.java +++ b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/LoadOptions.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli-v2' // -// Required dependencies: com.amplitude:analytics-android:1.0.0 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:analytics-android:[1.0.0,2.0) +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli-v2 // diff --git a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/SetAmpliExtrasPlugin.java b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/SetAmpliExtrasPlugin.java index 4df7ddaf..9aae6546 100644 --- a/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/SetAmpliExtrasPlugin.java +++ b/android/java/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/SetAmpliExtrasPlugin.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull java-ampli-v2' // -// Required dependencies: com.amplitude:analytics-android:1.0.0 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:analytics-android:[1.0.0,2.0) +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:java-ampli-v2 // diff --git a/android/java/v2/AmpliApp/app/src/main/java/com/example/ampliapp/MainActivity.java b/android/java/v2/AmpliApp/app/src/main/java/com/example/ampliapp/MainActivity.java index 0490c4e6..d2c39869 100644 --- a/android/java/v2/AmpliApp/app/src/main/java/com/example/ampliapp/MainActivity.java +++ b/android/java/v2/AmpliApp/app/src/main/java/com/example/ampliapp/MainActivity.java @@ -69,6 +69,7 @@ protected void onCreate(Bundle savedInstanceState) { Ampli.getInstance().eventWithArrayTypes(EventWithArrayTypes.builder() .requiredBooleanArray(new Boolean[]{true, false, true}) + .requiredEnumArray(new String[]{"enum1"}) .requiredNumberArray(new Double[]{1.1, 2.2, 3.3}) .requiredObjectArray(new Object[]{1, "a", true}) .requiredStringArray(new String[]{"a", "bc", "def"}) diff --git a/android/kotlin/v1/AmpliApp/ampli.json b/android/kotlin/v1/AmpliApp/ampli.json index d708e62a..1479282d 100644 --- a/android/kotlin/v1/AmpliApp/ampli.json +++ b/android/kotlin/v1/AmpliApp/ampli.json @@ -4,8 +4,11 @@ "SourceId": "a23edd97-2c05-4c1c-ab0a-663823528255", "Path": "./app/src/main/java/com/amplitude/ampli", "Branch": "main", - "Version": "0.0.0", + "Version": "1.0.0", "Runtime": "android:kotlin-ampli", - "VersionId": "79154a50-f057-4db5-9755-775e4e9f05e6", - "OmitApiKeys": true + "VersionId": "a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c", + "OmitApiKeys": true, + "Platform": "Android", + "Language": "Kotlin", + "SDK": "com.amplitude:android-sdk:2.+" } \ No newline at end of file diff --git a/android/kotlin/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/Ampli.kt b/android/kotlin/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/Ampli.kt index 8565fe1a..b7c6ef5d 100644 --- a/android/kotlin/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/Ampli.kt +++ b/android/kotlin/v1/AmpliApp/app/src/main/java/com/amplitude/ampli/Ampli.kt @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull kotlin-ampli' // -// Required dependencies: com.amplitude:android-sdk:2.37.0, com.squareup.okhttp3:okhttp:4.2.2 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:android-sdk:[2.37.0,3.0), com.squareup.okhttp3:okhttp:4.2.2 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:kotlin-ampli // @@ -83,28 +83,6 @@ class Identify private constructor( ), null as EventOptions?) } -class EventMaxIntForTest private constructor( - eventProperties: Map?, - options: EventOptions? = null -) : Event("EventMaxIntForTest", eventProperties, options, ::EventMaxIntForTest) { - /** - * EventMaxIntForTest - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) - * - * Event to test schema validation - * - * Owner: Test codegen - * - * @param intMax10 property to test schema validation - */ - constructor( - intMax10: Int - ) : this(mapOf( - "intMax10" to intMax10 - ), null as EventOptions?) -} - class EventNoProperties private constructor( eventProperties: Map?, options: EventOptions? = null @@ -206,17 +184,20 @@ class EventWithArrayTypes private constructor( * Owner: Test codegen * * @param requiredBooleanArray description for required boolean array + * @param requiredEnumArray Description for enum array property * @param requiredNumberArray Description for required number array * @param requiredObjectArray Description for required object array * @param requiredStringArray description for required string array */ constructor( requiredBooleanArray: Array, + requiredEnumArray: Array, requiredNumberArray: Array, requiredObjectArray: Array, requiredStringArray: Array ) : this(mapOf( "requiredBooleanArray" to requiredBooleanArray, + "requiredEnumArray" to requiredEnumArray, "requiredNumberArray" to requiredNumberArray, "requiredObjectArray" to requiredObjectArray, "requiredStringArray" to requiredStringArray @@ -246,65 +227,6 @@ class EventWithConstTypes private constructor( ), null as EventOptions?) } -class EventWithDifferentCasingTypes private constructor( - eventProperties: Map?, - options: EventOptions? = null -) : Event("event withDifferent_CasingTypes", eventProperties, options, ::EventWithDifferentCasingTypes) { - /** - * event withDifferent_CasingTypes - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) - * - * Description for case with space - * - * Owner: Test codegen - * - * @param enumCamelCase descriptionForEnumCamelCase - * @param enumPascalCase DescirptionForEnumPascalCase - * @param enumSnakeCase description_for_enum_snake_case - * @param enumWithSpace Description for enum with space - * @param propertyWithCamelCase descriptionForCamelCase - * @param propertyWithPascalCase DescriptionForPascalCase - * @param propertyWithSnakeCase Description_for_snake_case - * @param propertyWithSpace Description for case with space - */ - constructor( - enumCamelCase: EnumCamelCase, - enumPascalCase: EnumPascalCase, - enumSnakeCase: EnumSnakeCase, - enumWithSpace: EnumWithSpace, - propertyWithCamelCase: String, - propertyWithPascalCase: String, - propertyWithSnakeCase: String, - propertyWithSpace: String - ) : this(mapOf( - "enumCamelCase" to enumCamelCase.value, - "EnumPascalCase" to enumPascalCase.value, - "enum_snake_case" to enumSnakeCase.value, - "enum with space" to enumWithSpace.value, - "propertyWithCamelCase" to propertyWithCamelCase, - "PropertyWithPascalCase" to propertyWithPascalCase, - "property_with_snake_case" to propertyWithSnakeCase, - "property with space" to propertyWithSpace - ), null as EventOptions?) - - enum class EnumCamelCase(val value: String) { - ENUM_CAMEL_CASE("enumCamelCase") - } - - enum class EnumPascalCase(val value: String) { - ENUM_PASCAL_CASE("EnumPascalCase") - } - - enum class EnumSnakeCase(val value: String) { - ENUM_SNAKE_CASE("enum_snake_case") - } - - enum class EnumWithSpace(val value: String) { - ENUM_WITH_SPACE("enum with space") - } -} - class EventWithEnumTypes private constructor( eventProperties: Map?, options: EventOptions? = null @@ -354,17 +276,20 @@ class EventWithOptionalArrayTypes private constructor( * Owner: Test codegen * * @param optionalBooleanArray Description for optional boolean array + * @param optionalEnumArray Description for optional enum array * @param optionalJsonArray Description for optional object array * @param optionalNumberArray Description for optional number array * @param optionalStringArray Description for optional string array */ constructor( optionalBooleanArray: Array? = null, + optionalEnumArray: Array? = null, optionalJsonArray: Array? = null, optionalNumberArray: Array? = null, optionalStringArray: Array? = null ) : this(mapOf( *(if (optionalBooleanArray != null) arrayOf("optionalBooleanArray" to optionalBooleanArray) else arrayOf()), + *(if (optionalEnumArray != null) arrayOf("optionalEnumArray" to optionalEnumArray) else arrayOf()), *(if (optionalJsonArray != null) arrayOf("optionalJSONArray" to optionalJsonArray) else arrayOf()), *(if (optionalNumberArray != null) arrayOf("optionalNumberArray" to optionalNumberArray) else arrayOf()), *(if (optionalStringArray != null) arrayOf("optionalStringArray" to optionalStringArray) else arrayOf()) @@ -436,25 +361,106 @@ class EventWithTemplateProperties private constructor( ), null as EventOptions?) } +class EventWithDifferentCasingTypes private constructor( + eventProperties: Map?, + options: EventOptions? = null +) : Event("event withDifferent_CasingTypes", eventProperties, options, ::EventWithDifferentCasingTypes) { + /** + * event withDifferent_CasingTypes + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) + * + * Description for case with space + * + * Owner: Test codegen + * + * @param enumWithSpace Description for enum with space + * @param enumSnakeCase description_for_enum_snake_case + * @param enumCamelCase descriptionForEnumCamelCase + * @param enumPascalCase DescirptionForEnumPascalCase + * @param propertyWithSpace Description for case with space + * @param propertyWithSnakeCase Description_for_snake_case + * @param propertyWithCamelCase descriptionForCamelCase + * @param propertyWithPascalCase DescriptionForPascalCase + */ + constructor( + enumWithSpace: EnumWithSpace, + enumSnakeCase: EnumSnakeCase, + enumCamelCase: EnumCamelCase, + enumPascalCase: EnumPascalCase, + propertyWithSpace: String, + propertyWithSnakeCase: String, + propertyWithCamelCase: String, + propertyWithPascalCase: String + ) : this(mapOf( + "enum with space" to enumWithSpace.value, + "enum_snake_case" to enumSnakeCase.value, + "enumCamelCase" to enumCamelCase.value, + "EnumPascalCase" to enumPascalCase.value, + "property with space" to propertyWithSpace, + "property_with_snake_case" to propertyWithSnakeCase, + "propertyWithCamelCase" to propertyWithCamelCase, + "PropertyWithPascalCase" to propertyWithPascalCase + ), null as EventOptions?) + + enum class EnumWithSpace(val value: String) { + ENUM_WITH_SPACE("enum with space") + } + + enum class EnumSnakeCase(val value: String) { + ENUM_SNAKE_CASE("enum_snake_case") + } + + enum class EnumCamelCase(val value: String) { + ENUM_CAMEL_CASE("enumCamelCase") + } + + enum class EnumPascalCase(val value: String) { + ENUM_PASCAL_CASE("EnumPascalCase") + } +} + +class EventMaxIntForTest private constructor( + eventProperties: Map?, + options: EventOptions? = null +) : Event("EventMaxIntForTest", eventProperties, options, ::EventMaxIntForTest) { + /** + * EventMaxIntForTest + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) + * + * Event to test schema validation + * + * Owner: Test codegen + * + * @param intMax10 property to test schema validation + */ + constructor( + intMax10: Int + ) : this(mapOf( + "intMax10" to intMax10 + ), null as EventOptions?) +} + val ampli = Ampli() open class Ampli { companion object { val API_KEY: Map = mapOf( - Environment.DEV to "", - Environment.PROD to "" + Environment.PROD to "", + Environment.DEV to "" ) private val observePlan: Plan = Plan() .setBranch("main") .setSource("kotlin-ampli") - .setVersion("0") - .setVersionId("79154a50-f057-4db5-9755-775e4e9f05e6") + .setVersion("1") + .setVersionId("a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c") } enum class Environment { - DEV, - PROD + PROD, + DEV } private var disabled: Boolean = false @@ -553,25 +559,6 @@ open class Ampli { this._client?.uploadEvents() } - /** - * EventMaxIntForTest - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) - * - * Event to test schema validation - * - * Owner: Test codegen - * - * @param intMax10 property to test schema validation - */ - fun eventMaxIntForTest( - intMax10: Int - ) { - this.track(EventMaxIntForTest( - intMax10 = intMax10 - )) - } - /** * Event No Properties * @@ -654,18 +641,21 @@ open class Ampli { * Owner: Test codegen * * @param requiredBooleanArray description for required boolean array + * @param requiredEnumArray Description for enum array property * @param requiredNumberArray Description for required number array * @param requiredObjectArray Description for required object array * @param requiredStringArray description for required string array */ fun eventWithArrayTypes( requiredBooleanArray: Array, + requiredEnumArray: Array, requiredNumberArray: Array, requiredObjectArray: Array, requiredStringArray: Array ) { this.track(EventWithArrayTypes( requiredBooleanArray = requiredBooleanArray, + requiredEnumArray = requiredEnumArray, requiredNumberArray = requiredNumberArray, requiredObjectArray = requiredObjectArray, requiredStringArray = requiredStringArray @@ -685,46 +675,6 @@ open class Ampli { this.track(EventWithConstTypes()) } - /** - * event withDifferent_CasingTypes - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) - * - * Description for case with space - * - * Owner: Test codegen - * - * @param enumCamelCase descriptionForEnumCamelCase - * @param enumPascalCase DescirptionForEnumPascalCase - * @param enumSnakeCase description_for_enum_snake_case - * @param enumWithSpace Description for enum with space - * @param propertyWithCamelCase descriptionForCamelCase - * @param propertyWithPascalCase DescriptionForPascalCase - * @param propertyWithSnakeCase Description_for_snake_case - * @param propertyWithSpace Description for case with space - */ - fun eventWithDifferentCasingTypes( - enumCamelCase: EventWithDifferentCasingTypes.EnumCamelCase, - enumPascalCase: EventWithDifferentCasingTypes.EnumPascalCase, - enumSnakeCase: EventWithDifferentCasingTypes.EnumSnakeCase, - enumWithSpace: EventWithDifferentCasingTypes.EnumWithSpace, - propertyWithCamelCase: String, - propertyWithPascalCase: String, - propertyWithSnakeCase: String, - propertyWithSpace: String - ) { - this.track(EventWithDifferentCasingTypes( - enumCamelCase = enumCamelCase, - enumPascalCase = enumPascalCase, - enumSnakeCase = enumSnakeCase, - enumWithSpace = enumWithSpace, - propertyWithCamelCase = propertyWithCamelCase, - propertyWithPascalCase = propertyWithPascalCase, - propertyWithSnakeCase = propertyWithSnakeCase, - propertyWithSpace = propertyWithSpace - )) - } - /** * Event With Enum Types * @@ -757,18 +707,21 @@ open class Ampli { * Owner: Test codegen * * @param optionalBooleanArray Description for optional boolean array + * @param optionalEnumArray Description for optional enum array * @param optionalJsonArray Description for optional object array * @param optionalNumberArray Description for optional number array * @param optionalStringArray Description for optional string array */ fun eventWithOptionalArrayTypes( optionalBooleanArray: Array? = null, + optionalEnumArray: Array? = null, optionalJsonArray: Array? = null, optionalNumberArray: Array? = null, optionalStringArray: Array? = null ) { this.track(EventWithOptionalArrayTypes( optionalBooleanArray = optionalBooleanArray, + optionalEnumArray = optionalEnumArray, optionalJsonArray = optionalJsonArray, optionalNumberArray = optionalNumberArray, optionalStringArray = optionalStringArray @@ -834,6 +787,65 @@ open class Ampli { )) } + /** + * event withDifferent_CasingTypes + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) + * + * Description for case with space + * + * Owner: Test codegen + * + * @param enumWithSpace Description for enum with space + * @param enumSnakeCase description_for_enum_snake_case + * @param enumCamelCase descriptionForEnumCamelCase + * @param enumPascalCase DescirptionForEnumPascalCase + * @param propertyWithSpace Description for case with space + * @param propertyWithSnakeCase Description_for_snake_case + * @param propertyWithCamelCase descriptionForCamelCase + * @param propertyWithPascalCase DescriptionForPascalCase + */ + fun eventWithDifferentCasingTypes( + enumWithSpace: EventWithDifferentCasingTypes.EnumWithSpace, + enumSnakeCase: EventWithDifferentCasingTypes.EnumSnakeCase, + enumCamelCase: EventWithDifferentCasingTypes.EnumCamelCase, + enumPascalCase: EventWithDifferentCasingTypes.EnumPascalCase, + propertyWithSpace: String, + propertyWithSnakeCase: String, + propertyWithCamelCase: String, + propertyWithPascalCase: String + ) { + this.track(EventWithDifferentCasingTypes( + enumWithSpace = enumWithSpace, + enumSnakeCase = enumSnakeCase, + enumCamelCase = enumCamelCase, + enumPascalCase = enumPascalCase, + propertyWithSpace = propertyWithSpace, + propertyWithSnakeCase = propertyWithSnakeCase, + propertyWithCamelCase = propertyWithCamelCase, + propertyWithPascalCase = propertyWithPascalCase + )) + } + + /** + * EventMaxIntForTest + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) + * + * Event to test schema validation + * + * Owner: Test codegen + * + * @param intMax10 property to test schema validation + */ + fun eventMaxIntForTest( + intMax10: Int + ) { + this.track(EventMaxIntForTest( + intMax10 = intMax10 + )) + } + private fun handleEventOptions(options: EventOptions?, overrideOptions: EventOptions?, overrideUserId: String? = null) { val userId = overrideUserId ?: overrideOptions?.userId ?: options?.userId if (userId != null) { diff --git a/android/kotlin/v1/AmpliApp/app/src/main/java/com/example/ampliapp/MainActivity.kt b/android/kotlin/v1/AmpliApp/app/src/main/java/com/example/ampliapp/MainActivity.kt index e6b41d8b..a4c0a4fa 100644 --- a/android/kotlin/v1/AmpliApp/app/src/main/java/com/example/ampliapp/MainActivity.kt +++ b/android/kotlin/v1/AmpliApp/app/src/main/java/com/example/ampliapp/MainActivity.kt @@ -71,6 +71,7 @@ class MainActivity : AppCompatActivity() { ampli.eventWithArrayTypes( requiredBooleanArray = arrayOf(true, false, true), + requiredEnumArray = arrayOf("enum1"), requiredNumberArray = arrayOf(1.1, 2.2, 3.3), requiredStringArray = arrayOf("a", "bc", "def"), requiredObjectArray = arrayOf(1, "a", true) diff --git a/android/kotlin/v2/AmpliApp/ampli.json b/android/kotlin/v2/AmpliApp/ampli.json index 0ea8ac68..b2bb4018 100644 --- a/android/kotlin/v2/AmpliApp/ampli.json +++ b/android/kotlin/v2/AmpliApp/ampli.json @@ -5,8 +5,11 @@ "SourceId": "9d4bb6f1-0cb1-46c6-a36e-bdc23f57d22f", "Runtime": "android:kotlin-ampli-v2", "Branch": "main", - "Version": "0.0.0", - "VersionId": "79154a50-f057-4db5-9755-775e4e9f05e6", + "Version": "1.0.0", + "VersionId": "a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c", "Path": "./app/src/main/java/com/amplitude/ampli", - "OmitApiKeys": true + "OmitApiKeys": true, + "Platform": "Android", + "Language": "Kotlin", + "SDK": "com.amplitude:analytics-android:1.+" } \ No newline at end of file diff --git a/android/kotlin/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/Ampli.kt b/android/kotlin/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/Ampli.kt index 1826ef27..c53dd694 100644 --- a/android/kotlin/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/Ampli.kt +++ b/android/kotlin/v2/AmpliApp/app/src/main/java/com/amplitude/ampli/Ampli.kt @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull kotlin-ampli-v2' // -// Required dependencies: com.amplitude:analytics-android:1.0.0 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:analytics-android:[1.0.0,2.0) +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: android:kotlin-ampli-v2 // @@ -58,7 +58,7 @@ class SetAmpliExtrasPlugin : Plugin { } } -val defaultObservePlan = Plan("main", "kotlin-ampli-v2", "0", "79154a50-f057-4db5-9755-775e4e9f05e6") +val defaultObservePlan = Plan("main", "kotlin-ampli-v2", "1", "a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c") class DefaultConfiguration(apiKey: String, context : android.content.Context) { val config : Configuration @@ -95,29 +95,6 @@ class Identify private constructor() : BaseEvent() { } } -class EventMaxIntForTest private constructor() : BaseEvent() { - /** - * EventMaxIntForTest - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) - * - * Event to test schema validation - * - * Owner: Test codegen - * - * @param intMax10 property to test schema validation - */ - constructor( - intMax10: Int - ) : this() { - this.eventType = "EventMaxIntForTest" - this.eventProperties = - mutableMapOf( - "intMax10" to intMax10 - ) - } -} - class EventNoProperties : BaseEvent() { /** * Event No Properties @@ -217,12 +194,14 @@ class EventWithArrayTypes private constructor() : BaseEvent() { * Owner: Test codegen * * @param requiredBooleanArray description for required boolean array + * @param requiredEnumArray Description for enum array property * @param requiredNumberArray Description for required number array * @param requiredObjectArray Description for required object array * @param requiredStringArray description for required string array */ constructor( requiredBooleanArray: Array, + requiredEnumArray: Array, requiredNumberArray: Array, requiredObjectArray: Array, requiredStringArray: Array @@ -231,6 +210,7 @@ class EventWithArrayTypes private constructor() : BaseEvent() { this.eventProperties = mutableMapOf( "requiredBooleanArray" to requiredBooleanArray, + "requiredEnumArray" to requiredEnumArray, "requiredNumberArray" to requiredNumberArray, "requiredObjectArray" to requiredObjectArray, "requiredStringArray" to requiredStringArray @@ -262,66 +242,6 @@ class EventWithConstTypes : BaseEvent() { } } -class EventWithDifferentCasingTypes private constructor() : BaseEvent() { - /** - * event withDifferent_CasingTypes - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) - * - * Description for case with space - * - * Owner: Test codegen - * - * @param enumCamelCase descriptionForEnumCamelCase - * @param enumPascalCase DescirptionForEnumPascalCase - * @param enumSnakeCase description_for_enum_snake_case - * @param enumWithSpace Description for enum with space - * @param propertyWithCamelCase descriptionForCamelCase - * @param propertyWithPascalCase DescriptionForPascalCase - * @param propertyWithSnakeCase Description_for_snake_case - * @param propertyWithSpace Description for case with space - */ - constructor( - enumCamelCase: EnumCamelCase, - enumPascalCase: EnumPascalCase, - enumSnakeCase: EnumSnakeCase, - enumWithSpace: EnumWithSpace, - propertyWithCamelCase: String, - propertyWithPascalCase: String, - propertyWithSnakeCase: String, - propertyWithSpace: String - ) : this() { - this.eventType = "event withDifferent_CasingTypes" - this.eventProperties = - mutableMapOf( - "enumCamelCase" to enumCamelCase.value, - "EnumPascalCase" to enumPascalCase.value, - "enum_snake_case" to enumSnakeCase.value, - "enum with space" to enumWithSpace.value, - "propertyWithCamelCase" to propertyWithCamelCase, - "PropertyWithPascalCase" to propertyWithPascalCase, - "property_with_snake_case" to propertyWithSnakeCase, - "property with space" to propertyWithSpace - ) - } - - enum class EnumCamelCase(val value: String) { - ENUM_CAMEL_CASE("enumCamelCase") - } - - enum class EnumPascalCase(val value: String) { - ENUM_PASCAL_CASE("EnumPascalCase") - } - - enum class EnumSnakeCase(val value: String) { - ENUM_SNAKE_CASE("enum_snake_case") - } - - enum class EnumWithSpace(val value: String) { - ENUM_WITH_SPACE("enum with space") - } -} - class EventWithEnumTypes private constructor() : BaseEvent() { /** * Event With Enum Types @@ -369,12 +289,14 @@ class EventWithOptionalArrayTypes private constructor() : BaseEvent() { * Owner: Test codegen * * @param optionalBooleanArray Description for optional boolean array + * @param optionalEnumArray Description for optional enum array * @param optionalJsonArray Description for optional object array * @param optionalNumberArray Description for optional number array * @param optionalStringArray Description for optional string array */ constructor( optionalBooleanArray: Array? = null, + optionalEnumArray: Array? = null, optionalJsonArray: Array? = null, optionalNumberArray: Array? = null, optionalStringArray: Array? = null @@ -383,6 +305,7 @@ class EventWithOptionalArrayTypes private constructor() : BaseEvent() { this.eventProperties = mutableMapOf( *(if (optionalBooleanArray != null) arrayOf("optionalBooleanArray" to optionalBooleanArray) else arrayOf()), + *(if (optionalEnumArray != null) arrayOf("optionalEnumArray" to optionalEnumArray) else arrayOf()), *(if (optionalJsonArray != null) arrayOf("optionalJSONArray" to optionalJsonArray) else arrayOf()), *(if (optionalNumberArray != null) arrayOf("optionalNumberArray" to optionalNumberArray) else arrayOf()), *(if (optionalStringArray != null) arrayOf("optionalStringArray" to optionalStringArray) else arrayOf()) @@ -457,17 +380,100 @@ class EventWithTemplateProperties private constructor() : BaseEvent() { } } +class EventWithDifferentCasingTypes private constructor() : BaseEvent() { + /** + * event withDifferent_CasingTypes + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) + * + * Description for case with space + * + * Owner: Test codegen + * + * @param enumWithSpace Description for enum with space + * @param enumSnakeCase description_for_enum_snake_case + * @param enumCamelCase descriptionForEnumCamelCase + * @param enumPascalCase DescirptionForEnumPascalCase + * @param propertyWithSpace Description for case with space + * @param propertyWithSnakeCase Description_for_snake_case + * @param propertyWithCamelCase descriptionForCamelCase + * @param propertyWithPascalCase DescriptionForPascalCase + */ + constructor( + enumWithSpace: EnumWithSpace, + enumSnakeCase: EnumSnakeCase, + enumCamelCase: EnumCamelCase, + enumPascalCase: EnumPascalCase, + propertyWithSpace: String, + propertyWithSnakeCase: String, + propertyWithCamelCase: String, + propertyWithPascalCase: String + ) : this() { + this.eventType = "event withDifferent_CasingTypes" + this.eventProperties = + mutableMapOf( + "enum with space" to enumWithSpace.value, + "enum_snake_case" to enumSnakeCase.value, + "enumCamelCase" to enumCamelCase.value, + "EnumPascalCase" to enumPascalCase.value, + "property with space" to propertyWithSpace, + "property_with_snake_case" to propertyWithSnakeCase, + "propertyWithCamelCase" to propertyWithCamelCase, + "PropertyWithPascalCase" to propertyWithPascalCase + ) + } + + enum class EnumWithSpace(val value: String) { + ENUM_WITH_SPACE("enum with space") + } + + enum class EnumSnakeCase(val value: String) { + ENUM_SNAKE_CASE("enum_snake_case") + } + + enum class EnumCamelCase(val value: String) { + ENUM_CAMEL_CASE("enumCamelCase") + } + + enum class EnumPascalCase(val value: String) { + ENUM_PASCAL_CASE("EnumPascalCase") + } +} + +class EventMaxIntForTest private constructor() : BaseEvent() { + /** + * EventMaxIntForTest + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) + * + * Event to test schema validation + * + * Owner: Test codegen + * + * @param intMax10 property to test schema validation + */ + constructor( + intMax10: Int + ) : this() { + this.eventType = "EventMaxIntForTest" + this.eventProperties = + mutableMapOf( + "intMax10" to intMax10 + ) + } +} + open class Ampli { companion object { val API_KEY: Map = mapOf( - Environment.DEV to "", - Environment.PROD to "" + Environment.PROD to "", + Environment.DEV to "" ) } enum class Environment { - DEV, - PROD + PROD, + DEV } private var disabled: Boolean = false @@ -558,27 +564,6 @@ open class Ampli { this.client?.flush() } - /** - * EventMaxIntForTest - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) - * - * Event to test schema validation - * - * Owner: Test codegen - * - * @param intMax10 property to test schema validation - */ - fun eventMaxIntForTest( - intMax10: Int - ) { - this.track( - EventMaxIntForTest( - intMax10 = intMax10 - ) - ) - } - /** * Event No Properties * @@ -667,12 +652,14 @@ open class Ampli { * Owner: Test codegen * * @param requiredBooleanArray description for required boolean array + * @param requiredEnumArray Description for enum array property * @param requiredNumberArray Description for required number array * @param requiredObjectArray Description for required object array * @param requiredStringArray description for required string array */ fun eventWithArrayTypes( requiredBooleanArray: Array, + requiredEnumArray: Array, requiredNumberArray: Array, requiredObjectArray: Array, requiredStringArray: Array @@ -680,6 +667,7 @@ open class Ampli { this.track( EventWithArrayTypes( requiredBooleanArray = requiredBooleanArray, + requiredEnumArray = requiredEnumArray, requiredNumberArray = requiredNumberArray, requiredObjectArray = requiredObjectArray, requiredStringArray = requiredStringArray @@ -702,48 +690,6 @@ open class Ampli { ) } - /** - * event withDifferent_CasingTypes - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) - * - * Description for case with space - * - * Owner: Test codegen - * - * @param enumCamelCase descriptionForEnumCamelCase - * @param enumPascalCase DescirptionForEnumPascalCase - * @param enumSnakeCase description_for_enum_snake_case - * @param enumWithSpace Description for enum with space - * @param propertyWithCamelCase descriptionForCamelCase - * @param propertyWithPascalCase DescriptionForPascalCase - * @param propertyWithSnakeCase Description_for_snake_case - * @param propertyWithSpace Description for case with space - */ - fun eventWithDifferentCasingTypes( - enumCamelCase: EventWithDifferentCasingTypes.EnumCamelCase, - enumPascalCase: EventWithDifferentCasingTypes.EnumPascalCase, - enumSnakeCase: EventWithDifferentCasingTypes.EnumSnakeCase, - enumWithSpace: EventWithDifferentCasingTypes.EnumWithSpace, - propertyWithCamelCase: String, - propertyWithPascalCase: String, - propertyWithSnakeCase: String, - propertyWithSpace: String - ) { - this.track( - EventWithDifferentCasingTypes( - enumCamelCase = enumCamelCase, - enumPascalCase = enumPascalCase, - enumSnakeCase = enumSnakeCase, - enumWithSpace = enumWithSpace, - propertyWithCamelCase = propertyWithCamelCase, - propertyWithPascalCase = propertyWithPascalCase, - propertyWithSnakeCase = propertyWithSnakeCase, - propertyWithSpace = propertyWithSpace - ) - ) - } - /** * Event With Enum Types * @@ -778,12 +724,14 @@ open class Ampli { * Owner: Test codegen * * @param optionalBooleanArray Description for optional boolean array + * @param optionalEnumArray Description for optional enum array * @param optionalJsonArray Description for optional object array * @param optionalNumberArray Description for optional number array * @param optionalStringArray Description for optional string array */ fun eventWithOptionalArrayTypes( optionalBooleanArray: Array? = null, + optionalEnumArray: Array? = null, optionalJsonArray: Array? = null, optionalNumberArray: Array? = null, optionalStringArray: Array? = null @@ -791,6 +739,7 @@ open class Ampli { this.track( EventWithOptionalArrayTypes( optionalBooleanArray = optionalBooleanArray, + optionalEnumArray = optionalEnumArray, optionalJsonArray = optionalJsonArray, optionalNumberArray = optionalNumberArray, optionalStringArray = optionalStringArray @@ -861,6 +810,69 @@ open class Ampli { ) } + /** + * event withDifferent_CasingTypes + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) + * + * Description for case with space + * + * Owner: Test codegen + * + * @param enumWithSpace Description for enum with space + * @param enumSnakeCase description_for_enum_snake_case + * @param enumCamelCase descriptionForEnumCamelCase + * @param enumPascalCase DescirptionForEnumPascalCase + * @param propertyWithSpace Description for case with space + * @param propertyWithSnakeCase Description_for_snake_case + * @param propertyWithCamelCase descriptionForCamelCase + * @param propertyWithPascalCase DescriptionForPascalCase + */ + fun eventWithDifferentCasingTypes( + enumWithSpace: EventWithDifferentCasingTypes.EnumWithSpace, + enumSnakeCase: EventWithDifferentCasingTypes.EnumSnakeCase, + enumCamelCase: EventWithDifferentCasingTypes.EnumCamelCase, + enumPascalCase: EventWithDifferentCasingTypes.EnumPascalCase, + propertyWithSpace: String, + propertyWithSnakeCase: String, + propertyWithCamelCase: String, + propertyWithPascalCase: String + ) { + this.track( + EventWithDifferentCasingTypes( + enumWithSpace = enumWithSpace, + enumSnakeCase = enumSnakeCase, + enumCamelCase = enumCamelCase, + enumPascalCase = enumPascalCase, + propertyWithSpace = propertyWithSpace, + propertyWithSnakeCase = propertyWithSnakeCase, + propertyWithCamelCase = propertyWithCamelCase, + propertyWithPascalCase = propertyWithPascalCase + ) + ) + } + + /** + * EventMaxIntForTest + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) + * + * Event to test schema validation + * + * Owner: Test codegen + * + * @param intMax10 property to test schema validation + */ + fun eventMaxIntForTest( + intMax10: Int + ) { + this.track( + EventMaxIntForTest( + intMax10 = intMax10 + ) + ) + } + private fun isInitializedAndEnabled(): Boolean { if (this.client == null) { System.err.println("Ampli is not yet initialized. Have you called `ampli.load()` on app start?") diff --git a/android/kotlin/v2/AmpliApp/app/src/main/java/com/example/ampliapp/MainActivity.kt b/android/kotlin/v2/AmpliApp/app/src/main/java/com/example/ampliapp/MainActivity.kt index 206dd06f..b1e3791b 100644 --- a/android/kotlin/v2/AmpliApp/app/src/main/java/com/example/ampliapp/MainActivity.kt +++ b/android/kotlin/v2/AmpliApp/app/src/main/java/com/example/ampliapp/MainActivity.kt @@ -61,6 +61,7 @@ class MainActivity : AppCompatActivity() { ampli.eventWithArrayTypes( requiredBooleanArray = arrayOf(true, false, true), + requiredEnumArray = arrayOf("enum1"), requiredNumberArray = arrayOf(1.1, 2.2, 3.3), requiredStringArray = arrayOf("a", "bc", "def"), requiredObjectArray = arrayOf(1, "a", true) diff --git a/browser/javascript/v1/react-app/ampli.json b/browser/javascript/v1/react-app/ampli.json index 2cbad5a0..b6af95dd 100644 --- a/browser/javascript/v1/react-app/ampli.json +++ b/browser/javascript/v1/react-app/ampli.json @@ -4,8 +4,11 @@ "SourceId": "7f3b8b96-c1c8-4871-ad6c-5e3b443bd5fe", "Path": "./src/ampli", "Branch": "main", - "Version": "0.0.0", + "Version": "1.0.0", "Runtime": "browser:javascript-ampli", - "VersionId": "79154a50-f057-4db5-9755-775e4e9f05e6", - "OmitApiKeys": true + "VersionId": "a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c", + "OmitApiKeys": true, + "Platform": "Browser", + "Language": "JavaScript", + "SDK": "amplitude-js@^8.0" } \ No newline at end of file diff --git a/browser/javascript/v1/react-app/src/App.js b/browser/javascript/v1/react-app/src/App.js index 36991392..14ce3323 100644 --- a/browser/javascript/v1/react-app/src/App.js +++ b/browser/javascript/v1/react-app/src/App.js @@ -171,6 +171,7 @@ function App() { ampli.eventWithArrayTypes({ requiredBooleanArray: [true, false], + requiredEnumArray: ['enum1'], requiredNumberArray: [1.2, 3, 4.56], requiredObjectArray: [{ 'key-1': 'value-1' }, { 'key-2': 'value-2' }], requiredStringArray: ['string-1', 'string-2', 'string-3'], diff --git a/browser/javascript/v1/react-app/src/ampli/index.js b/browser/javascript/v1/react-app/src/ampli/index.js index 56d809d5..abc3980b 100644 --- a/browser/javascript/v1/react-app/src/ampli/index.js +++ b/browser/javascript/v1/react-app/src/ampli/index.js @@ -7,7 +7,7 @@ * To update run 'ampli pull browser-js-ampli' * * Required dependencies: amplitude-js@^8.21.0 - * Tracking Plan Version: 0 + * Tracking Plan Version: 1 * Build: 1.0.0 * Runtime: browser:javascript-ampli * @@ -71,7 +71,7 @@ import amplitude from 'amplitude-js'; /** * @typedef LoadOptions * @type {object} - * @property {'dev'|'prod'} [environment] + * @property {'prod'|'dev'} [environment] * @property {boolean} [disabled] * @property {LoadClientOptions} [client] */ @@ -99,12 +99,12 @@ import amplitude from 'amplitude-js'; /** * @typedef ApiKey * @type {object} - * @property {string} dev * @property {string} prod + * @property {string} dev */ export const ApiKey = { - dev: '', - prod: '' + prod: '', + dev: '' }; /** @@ -129,10 +129,10 @@ export const SpecialEventType = { */ export const DefaultOptions = { plan: { - version: '0', + version: '1', branch: 'main', source: 'browser-js-ampli', - versionId: '79154a50-f057-4db5-9755-775e4e9f05e6' + versionId: 'a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c' }, ...{ ingestionMetadata: { @@ -149,13 +149,6 @@ export class Identify { } } -export class EventMaxIntForTest { - constructor(properties) { - this.event_type = 'EventMaxIntForTest'; - this.event_properties = properties; - } -} - export class EventNoProperties { constructor() { this.event_type = 'Event No Properties'; @@ -200,13 +193,6 @@ export class EventWithConstTypes { } } -export class EventWithDifferentCasingTypes { - constructor(properties) { - this.event_type = 'event withDifferent_CasingTypes'; - this.event_properties = properties; - } -} - export class EventWithEnumTypes { constructor(properties) { this.event_type = 'Event With Enum Types'; @@ -235,6 +221,20 @@ export class EventWithTemplateProperties { } } +export class EventWithDifferentCasingTypes { + constructor(properties) { + this.event_type = 'event withDifferent_CasingTypes'; + this.event_properties = properties; + } +} + +export class EventMaxIntForTest { + constructor(properties) { + this.event_type = 'EventMaxIntForTest'; + this.event_properties = properties; + } +} + // prettier-ignore export class Ampli { constructor() { @@ -389,24 +389,6 @@ export class Ampli { }); } - /** - * EventMaxIntForTest - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) - * - * Event to test schema validation - * - * Owner: Test codegen - * - * @param {Object} properties The event's properties. - * @param {number} properties.intMax10 property to test schema validation - * @param {EventOptions} [options] Options for this track call. - * @param {MiddlewareExtra} [extra] Extra untyped parameters for use in middleware. - */ - eventMaxIntForTest(properties, options, extra) { - this.track(new EventMaxIntForTest(properties), options, extra); - } - /** * Event No Properties * @@ -477,6 +459,7 @@ export class Ampli { * * @param {Object} properties The event's properties. * @param {boolean[]} properties.requiredBooleanArray description for required boolean array + * @param {string[]} properties.requiredEnumArray Description for enum array property * @param {number[]} properties.requiredNumberArray Description for required number array * @param {*[]} properties.requiredObjectArray Description for required object array * @param {string[]} properties.requiredStringArray description for required string array @@ -503,31 +486,6 @@ export class Ampli { this.track(new EventWithConstTypes(), options, extra); } - /** - * event withDifferent_CasingTypes - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) - * - * Description for case with space - * - * Owner: Test codegen - * - * @param {Object} properties The event's properties. - * @param {'enumCamelCase'} properties.enumCamelCase descriptionForEnumCamelCase - * @param {'EnumPascalCase'} properties.EnumPascalCase DescirptionForEnumPascalCase - * @param {'enum_snake_case'} properties.enum_snake_case description_for_enum_snake_case - * @param {'enum with space'} properties.enum with space Description for enum with space - * @param {string} properties.propertyWithCamelCase descriptionForCamelCase - * @param {string} properties.PropertyWithPascalCase DescriptionForPascalCase - * @param {string} properties.property_with_snake_case Description_for_snake_case - * @param {string} properties.property with space Description for case with space - * @param {EventOptions} [options] Options for this track call. - * @param {MiddlewareExtra} [extra] Extra untyped parameters for use in middleware. - */ - eventWithDifferentCasingTypes(properties, options, extra) { - this.track(new EventWithDifferentCasingTypes(properties), options, extra); - } - /** * Event With Enum Types * @@ -558,6 +516,7 @@ export class Ampli { * * @param {Object} [properties] The event's properties. * @param {boolean[]} [properties.optionalBooleanArray] Description for optional boolean array + * @param {string[]} [properties.optionalEnumArray] Description for optional enum array * @param {*[]} [properties.optionalJSONArray] Description for optional object array * @param {number[]} [properties.optionalNumberArray] Description for optional number array * @param {string[]} [properties.optionalStringArray] Description for optional string array @@ -611,6 +570,49 @@ export class Ampli { this.track(new EventWithTemplateProperties(properties), options, extra); } + /** + * event withDifferent_CasingTypes + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) + * + * Description for case with space + * + * Owner: Test codegen + * + * @param {Object} properties The event's properties. + * @param {'enum with space'} properties.enum with space Description for enum with space + * @param {'enum_snake_case'} properties.enum_snake_case description_for_enum_snake_case + * @param {'enumCamelCase'} properties.enumCamelCase descriptionForEnumCamelCase + * @param {'EnumPascalCase'} properties.EnumPascalCase DescirptionForEnumPascalCase + * @param {string} properties.property with space Description for case with space + * @param {string} properties.property_with_snake_case Description_for_snake_case + * @param {string} properties.propertyWithCamelCase descriptionForCamelCase + * @param {string} properties.PropertyWithPascalCase DescriptionForPascalCase + * @param {EventOptions} [options] Options for this track call. + * @param {MiddlewareExtra} [extra] Extra untyped parameters for use in middleware. + */ + eventWithDifferentCasingTypes(properties, options, extra) { + this.track(new EventWithDifferentCasingTypes(properties), options, extra); + } + + /** + * EventMaxIntForTest + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) + * + * Event to test schema validation + * + * Owner: Test codegen + * + * @param {Object} properties The event's properties. + * @param {number} properties.intMax10 property to test schema validation + * @param {EventOptions} [options] Options for this track call. + * @param {MiddlewareExtra} [extra] Extra untyped parameters for use in middleware. + */ + eventMaxIntForTest(properties, options, extra) { + this.track(new EventMaxIntForTest(properties), options, extra); + } + /** * Add new middleware to end of chain * diff --git a/browser/javascript/v2/ember-app/ampli.json b/browser/javascript/v2/ember-app/ampli.json index 74581a9e..8c78a0b8 100644 --- a/browser/javascript/v2/ember-app/ampli.json +++ b/browser/javascript/v2/ember-app/ampli.json @@ -5,8 +5,11 @@ "SourceId": "6b939949-1003-4cf8-92a3-4bea7bf4e979", "Runtime": "browser:javascript-ampli-v2", "Branch": "main", - "Version": "0.0.0", - "VersionId": "79154a50-f057-4db5-9755-775e4e9f05e6", + "Version": "1.0.0", + "VersionId": "a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c", "Path": "./app/ampli", - "OmitApiKeys": true + "OmitApiKeys": true, + "Platform": "Browser", + "Language": "JavaScript", + "SDK": "@amplitude/analytics-browser@^1.0" } \ No newline at end of file diff --git a/browser/javascript/v2/ember-app/app/ampli/index.js b/browser/javascript/v2/ember-app/app/ampli/index.js index 69578fac..acf5aaad 100644 --- a/browser/javascript/v2/ember-app/app/ampli/index.js +++ b/browser/javascript/v2/ember-app/app/ampli/index.js @@ -7,7 +7,7 @@ * To update run 'ampli pull browser-js-ampli-v2' * * Required dependencies: @amplitude/analytics-browser@^1.3.0 - * Tracking Plan Version: 0 + * Tracking Plan Version: 1 * Build: 1.0.0 * Runtime: browser:javascript-ampli-v2 * @@ -45,7 +45,7 @@ import * as amplitude from '@amplitude/analytics-browser'; /** * @typedef LoadOptions * @type {object} - * @property {'dev'|'prod'} [environment] + * @property {'prod'|'dev'} [environment] * @property {boolean} [disabled] * @property {LoadClientOptions} [client] */ @@ -58,12 +58,12 @@ import * as amplitude from '@amplitude/analytics-browser'; /** * @typedef ApiKey * @type {object} - * @property {string} dev * @property {string} prod + * @property {string} dev */ export const ApiKey = { - dev: '', - prod: '' + prod: '', + dev: '' }; /** @@ -83,10 +83,10 @@ export const ApiKey = { */ export const DefaultConfiguration = { plan: { - version: '0', + version: '1', branch: 'main', source: 'browser-js-ampli-v2', - versionId: '79154a50-f057-4db5-9755-775e4e9f05e6' + versionId: 'a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c' }, ...{ ingestionMetadata: { @@ -103,13 +103,6 @@ export class Identify { } } -export class EventMaxIntForTest { - constructor(properties) { - this.event_type = 'EventMaxIntForTest'; - this.event_properties = properties; - } -} - export class EventNoProperties { constructor() { this.event_type = 'Event No Properties'; @@ -154,13 +147,6 @@ export class EventWithConstTypes { } } -export class EventWithDifferentCasingTypes { - constructor(properties) { - this.event_type = 'event withDifferent_CasingTypes'; - this.event_properties = properties; - } -} - export class EventWithEnumTypes { constructor(properties) { this.event_type = 'Event With Enum Types'; @@ -189,6 +175,20 @@ export class EventWithTemplateProperties { } } +export class EventWithDifferentCasingTypes { + constructor(properties) { + this.event_type = 'event withDifferent_CasingTypes'; + this.event_properties = properties; + } +} + +export class EventMaxIntForTest { + constructor(properties) { + this.event_type = 'EventMaxIntForTest'; + this.event_properties = properties; + } +} + /** * @typedef PromiseResult * @type {object} @@ -312,23 +312,6 @@ export class Ampli { return this.amplitude.track(event, undefined, options); } - /** - * EventMaxIntForTest - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) - * - * Event to test schema validation - * - * Owner: Test codegen - * - * @param {Object} properties The event's properties. - * @param {number} properties.intMax10 property to test schema validation - * @param {EventOptions} [options] Options for this track call. - */ - eventMaxIntForTest(properties, options) { - return this.track(new EventMaxIntForTest(properties), options); - } - /** * Event No Properties * @@ -396,6 +379,7 @@ export class Ampli { * * @param {Object} properties The event's properties. * @param {boolean[]} properties.requiredBooleanArray description for required boolean array + * @param {string[]} properties.requiredEnumArray Description for enum array property * @param {number[]} properties.requiredNumberArray Description for required number array * @param {*[]} properties.requiredObjectArray Description for required object array * @param {string[]} properties.requiredStringArray description for required string array @@ -420,30 +404,6 @@ export class Ampli { return this.track(new EventWithConstTypes(), options); } - /** - * event withDifferent_CasingTypes - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) - * - * Description for case with space - * - * Owner: Test codegen - * - * @param {Object} properties The event's properties. - * @param {'enumCamelCase'} properties.enumCamelCase descriptionForEnumCamelCase - * @param {'EnumPascalCase'} properties.EnumPascalCase DescirptionForEnumPascalCase - * @param {'enum_snake_case'} properties.enum_snake_case description_for_enum_snake_case - * @param {'enum with space'} properties.enum with space Description for enum with space - * @param {string} properties.propertyWithCamelCase descriptionForCamelCase - * @param {string} properties.PropertyWithPascalCase DescriptionForPascalCase - * @param {string} properties.property_with_snake_case Description_for_snake_case - * @param {string} properties.property with space Description for case with space - * @param {EventOptions} [options] Options for this track call. - */ - eventWithDifferentCasingTypes(properties, options) { - return this.track(new EventWithDifferentCasingTypes(properties), options); - } - /** * Event With Enum Types * @@ -473,6 +433,7 @@ export class Ampli { * * @param {Object} [properties] The event's properties. * @param {boolean[]} [properties.optionalBooleanArray] Description for optional boolean array + * @param {string[]} [properties.optionalEnumArray] Description for optional enum array * @param {*[]} [properties.optionalJSONArray] Description for optional object array * @param {number[]} [properties.optionalNumberArray] Description for optional number array * @param {string[]} [properties.optionalStringArray] Description for optional string array @@ -522,6 +483,47 @@ export class Ampli { eventWithTemplateProperties(properties, options) { return this.track(new EventWithTemplateProperties(properties), options); } + + /** + * event withDifferent_CasingTypes + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) + * + * Description for case with space + * + * Owner: Test codegen + * + * @param {Object} properties The event's properties. + * @param {'enum with space'} properties.enum with space Description for enum with space + * @param {'enum_snake_case'} properties.enum_snake_case description_for_enum_snake_case + * @param {'enumCamelCase'} properties.enumCamelCase descriptionForEnumCamelCase + * @param {'EnumPascalCase'} properties.EnumPascalCase DescirptionForEnumPascalCase + * @param {string} properties.property with space Description for case with space + * @param {string} properties.property_with_snake_case Description_for_snake_case + * @param {string} properties.propertyWithCamelCase descriptionForCamelCase + * @param {string} properties.PropertyWithPascalCase DescriptionForPascalCase + * @param {EventOptions} [options] Options for this track call. + */ + eventWithDifferentCasingTypes(properties, options) { + return this.track(new EventWithDifferentCasingTypes(properties), options); + } + + /** + * EventMaxIntForTest + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) + * + * Event to test schema validation + * + * Owner: Test codegen + * + * @param {Object} properties The event's properties. + * @param {number} properties.intMax10 property to test schema validation + * @param {EventOptions} [options] Options for this track call. + */ + eventMaxIntForTest(properties, options) { + return this.track(new EventMaxIntForTest(properties), options); + } } export const ampli = new Ampli(); diff --git a/browser/javascript/v2/react-app/src/ampli/index.js b/browser/javascript/v2/react-app/src/ampli/index.js index f216cada..acf5aaad 100644 --- a/browser/javascript/v2/react-app/src/ampli/index.js +++ b/browser/javascript/v2/react-app/src/ampli/index.js @@ -7,7 +7,7 @@ * To update run 'ampli pull browser-js-ampli-v2' * * Required dependencies: @amplitude/analytics-browser@^1.3.0 - * Tracking Plan Version: 0 + * Tracking Plan Version: 1 * Build: 1.0.0 * Runtime: browser:javascript-ampli-v2 * @@ -83,7 +83,7 @@ export const ApiKey = { */ export const DefaultConfiguration = { plan: { - version: '0', + version: '1', branch: 'main', source: 'browser-js-ampli-v2', versionId: 'a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c' diff --git a/browser/typescript/v1/react-app/ampli.json b/browser/typescript/v1/react-app/ampli.json index d1d6f03f..1627db7d 100644 --- a/browser/typescript/v1/react-app/ampli.json +++ b/browser/typescript/v1/react-app/ampli.json @@ -4,8 +4,11 @@ "SourceId": "93b6a56c-919c-4f3c-a06a-3bb2297599c3", "Path": "./src/ampli", "Branch": "main", - "Version": "0.0.0", + "Version": "1.0.0", "Runtime": "browser:typescript-ampli", - "VersionId": "79154a50-f057-4db5-9755-775e4e9f05e6", - "OmitApiKeys": true + "VersionId": "a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c", + "OmitApiKeys": true, + "Platform": "Browser", + "Language": "TypeScript", + "SDK": "amplitude-js@^8.0" } \ No newline at end of file diff --git a/browser/typescript/v1/react-app/src/App.tsx b/browser/typescript/v1/react-app/src/App.tsx index 34e7667c..f5349417 100644 --- a/browser/typescript/v1/react-app/src/App.tsx +++ b/browser/typescript/v1/react-app/src/App.tsx @@ -178,6 +178,7 @@ function App() { ampli.eventWithArrayTypes({ requiredBooleanArray: [true, false], + requiredEnumArray: ['enum1'], requiredNumberArray: [1.2, 3, 4.56], requiredObjectArray: [{ 'key-1': 'value-1' }, { 'key-2': 'value-2' }], requiredStringArray: ['string-1', 'string-2', 'string-3'], diff --git a/browser/typescript/v1/react-app/src/ampli/index.ts b/browser/typescript/v1/react-app/src/ampli/index.ts index 39a56e8e..b187c8ba 100644 --- a/browser/typescript/v1/react-app/src/ampli/index.ts +++ b/browser/typescript/v1/react-app/src/ampli/index.ts @@ -7,7 +7,7 @@ * To update run 'ampli pull browser-ts-ampli' * * Required dependencies: amplitude-js@^8.21.0 - * Tracking Plan Version: 0 + * Tracking Plan Version: 1 * Build: 1.0.0 * Runtime: browser:typescript-ampli * @@ -18,11 +18,11 @@ import amplitude, { AmplitudeClient, Callback, Config } from 'amplitude-js'; -export type Environment = 'dev' | 'prod'; +export type Environment = 'prod' | 'dev'; export const ApiKey: Record = { - dev: '', - prod: '' + prod: '', + dev: '' }; /** @@ -30,10 +30,10 @@ export const ApiKey: Record = { */ export const DefaultOptions: ConfigExt = { plan: { - version: '0', + version: '1', branch: 'main', source: 'browser-ts-ampli', - versionId: '79154a50-f057-4db5-9755-775e4e9f05e6' + versionId: 'a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c' }, ...{ ingestionMetadata: { @@ -71,25 +71,11 @@ export interface IdentifyProperties { requiredNumber: number; } -export interface EventMaxIntForTestProperties { - /** - * property to test schema validation - * - * | Rule | Value | - * |---|---| - * | Type | integer | - * | Max Value | 10 | - */ - intMax10: number; -} - export interface EventObjectTypesProperties { /** * Property Object Type */ - requiredObject: { - [k: string]: any; - }; + requiredObject: any; /** * Property Object Array Type */ @@ -155,6 +141,14 @@ export interface EventWithArrayTypesProperties { * | Item Type | boolean | */ requiredBooleanArray: boolean[]; + /** + * Description for enum array property + * + * | Rule | Value | + * |---|---| + * | Item Type | string | + */ + requiredEnumArray: ("enum1" | "enum2")[]; /** * Description for required number array * @@ -177,57 +171,6 @@ export interface EventWithArrayTypesProperties { requiredStringArray: string[]; } -export interface EventWithDifferentCasingTypesProperties { - /** - * descriptionForEnumCamelCase - * - * | Rule | Value | - * |---|---| - * | Enum Values | enumCamelCase | - */ - enumCamelCase: "enumCamelCase"; - /** - * DescirptionForEnumPascalCase - * - * | Rule | Value | - * |---|---| - * | Enum Values | EnumPascalCase | - */ - EnumPascalCase: "EnumPascalCase"; - /** - * description_for_enum_snake_case - * - * | Rule | Value | - * |---|---| - * | Enum Values | enum_snake_case | - */ - enum_snake_case: "enum_snake_case"; - /** - * Description for enum with space - * - * | Rule | Value | - * |---|---| - * | Enum Values | enum with space | - */ - "enum with space": "enum with space"; - /** - * descriptionForCamelCase - */ - propertyWithCamelCase: string; - /** - * DescriptionForPascalCase - */ - PropertyWithPascalCase: string; - /** - * Description_for_snake_case - */ - property_with_snake_case: string; - /** - * Description for case with space - */ - "property with space": string; -} - export interface EventWithEnumTypesProperties { /** * Description for required enum @@ -256,6 +199,14 @@ export interface EventWithOptionalArrayTypesProperties { * | Item Type | boolean | */ optionalBooleanArray?: boolean[]; + /** + * Description for optional enum array + * + * | Rule | Value | + * |---|---| + * | Item Type | string | + */ + optionalEnumArray?: ("enum1" | "enum2")[]; /** * Description for optional object array */ @@ -331,6 +282,69 @@ export interface EventWithTemplatePropertiesProperties { required_template_property: string; } +export interface EventWithDifferentCasingTypesProperties { + /** + * Description for enum with space + * + * | Rule | Value | + * |---|---| + * | Enum Values | enum with space | + */ + "enum with space": "enum with space"; + /** + * description_for_enum_snake_case + * + * | Rule | Value | + * |---|---| + * | Enum Values | enum_snake_case | + */ + enum_snake_case: "enum_snake_case"; + /** + * descriptionForEnumCamelCase + * + * | Rule | Value | + * |---|---| + * | Enum Values | enumCamelCase | + */ + enumCamelCase: "enumCamelCase"; + /** + * DescirptionForEnumPascalCase + * + * | Rule | Value | + * |---|---| + * | Enum Values | EnumPascalCase | + */ + EnumPascalCase: "EnumPascalCase"; + /** + * Description for case with space + */ + "property with space": string; + /** + * Description_for_snake_case + */ + property_with_snake_case: string; + /** + * descriptionForCamelCase + */ + propertyWithCamelCase: string; + /** + * DescriptionForPascalCase + */ + PropertyWithPascalCase: string; +} + +export interface EventMaxIntForTestProperties { + /** + * property to test schema validation + * + * | Rule | Value | + * |---|---| + * | Type | integer | + * | Max Value | 10 | + */ + intMax10: number; +} + export interface EventTemplateProperties { /** * optional_template_property description @@ -371,16 +385,6 @@ export class Identify implements BaseEvent { } } -export class EventMaxIntForTest implements BaseEvent { - event_type = 'EventMaxIntForTest'; - - constructor( - public event_properties: EventMaxIntForTestProperties, - ) { - this.event_properties = event_properties; - } -} - export class EventNoProperties implements BaseEvent { event_type = 'Event No Properties'; } @@ -433,16 +437,6 @@ export class EventWithConstTypes implements BaseEvent { }; } -export class EventWithDifferentCasingTypes implements BaseEvent { - event_type = 'event withDifferent_CasingTypes'; - - constructor( - public event_properties: EventWithDifferentCasingTypesProperties, - ) { - this.event_properties = event_properties; - } -} - export class EventWithEnumTypes implements BaseEvent { event_type = 'Event With Enum Types'; @@ -483,6 +477,26 @@ export class EventWithTemplateProperties implements BaseEvent { } } +export class EventWithDifferentCasingTypes implements BaseEvent { + event_type = 'event withDifferent_CasingTypes'; + + constructor( + public event_properties: EventWithDifferentCasingTypesProperties, + ) { + this.event_properties = event_properties; + } +} + +export class EventMaxIntForTest implements BaseEvent { + event_type = 'EventMaxIntForTest'; + + constructor( + public event_properties: EventMaxIntForTestProperties, + ) { + this.event_properties = event_properties; + } +} + // prettier-ignore export class Ampli { private disabled: boolean = false; @@ -629,27 +643,6 @@ export class Ampli { }); } - /** - * EventMaxIntForTest - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) - * - * Event to test schema validation - * - * Owner: Test codegen - * - * @param properties The event's properties (e.g. intMax10) - * @param options Amplitude event options. - * @param extra Extra untyped parameters for use in middleware. - */ - eventMaxIntForTest( - properties: EventMaxIntForTestProperties, - options?: EventOptions, - extra?: MiddlewareExtra, - ) { - return this.track(new EventMaxIntForTest(properties), options, extra); - } - /** * Event No Properties * @@ -751,27 +744,6 @@ export class Ampli { return this.track(new EventWithConstTypes(), options, extra); } - /** - * event withDifferent_CasingTypes - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) - * - * Description for case with space - * - * Owner: Test codegen - * - * @param properties The event's properties (e.g. enumCamelCase) - * @param options Amplitude event options. - * @param extra Extra untyped parameters for use in middleware. - */ - eventWithDifferentCasingTypes( - properties: EventWithDifferentCasingTypesProperties, - options?: EventOptions, - extra?: MiddlewareExtra, - ) { - return this.track(new EventWithDifferentCasingTypes(properties), options, extra); - } - /** * Event With Enum Types * @@ -856,6 +828,48 @@ export class Ampli { return this.track(new EventWithTemplateProperties(properties), options, extra); } + /** + * event withDifferent_CasingTypes + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) + * + * Description for case with space + * + * Owner: Test codegen + * + * @param properties The event's properties (e.g. enum with space) + * @param options Amplitude event options. + * @param extra Extra untyped parameters for use in middleware. + */ + eventWithDifferentCasingTypes( + properties: EventWithDifferentCasingTypesProperties, + options?: EventOptions, + extra?: MiddlewareExtra, + ) { + return this.track(new EventWithDifferentCasingTypes(properties), options, extra); + } + + /** + * EventMaxIntForTest + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) + * + * Event to test schema validation + * + * Owner: Test codegen + * + * @param properties The event's properties (e.g. intMax10) + * @param options Amplitude event options. + * @param extra Extra untyped parameters for use in middleware. + */ + eventMaxIntForTest( + properties: EventMaxIntForTestProperties, + options?: EventOptions, + extra?: MiddlewareExtra, + ) { + return this.track(new EventMaxIntForTest(properties), options, extra); + } + addEventMiddleware(middleware: Middleware): void { this.middlewares.push(middleware); } diff --git a/browser/typescript/v2/react-app/src/ampli/index.ts b/browser/typescript/v2/react-app/src/ampli/index.ts index 6a0a14d0..b4db3593 100644 --- a/browser/typescript/v2/react-app/src/ampli/index.ts +++ b/browser/typescript/v2/react-app/src/ampli/index.ts @@ -7,7 +7,7 @@ * To update run 'ampli pull browser-ts-ampli-v2' * * Required dependencies: @amplitude/analytics-browser@^1.3.0 - * Tracking Plan Version: 0 + * Tracking Plan Version: 1 * Build: 1.0.0 * Runtime: browser:typescript-ampli-v2 * @@ -30,7 +30,7 @@ export const ApiKey: Record = { */ export const DefaultConfiguration: BrowserOptions = { plan: { - version: '0', + version: '1', branch: 'main', source: 'browser-ts-ampli-v2', versionId: 'a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c' diff --git a/go/simple/v2/ampli.json b/go/simple/v2/ampli.json index 6e1687a0..1b49eb91 100644 --- a/go/simple/v2/ampli.json +++ b/go/simple/v2/ampli.json @@ -5,8 +5,8 @@ "SourceId": "4499da75-082f-4b5f-ae0e-95356fbc7740", "Runtime": "go:go-ampli", "Branch": "main", - "Version": "0.0.0", - "VersionId": "79154a50-f057-4db5-9755-775e4e9f05e6", + "Version": "1.0.0", + "VersionId": "a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c", "Path": "./ampli", "OmitApiKeys": true, "Platform": "Go", diff --git a/go/simple/v2/ampli/ampli.go b/go/simple/v2/ampli/ampli.go index bc8094a9..5632fbe8 100644 --- a/go/simple/v2/ampli/ampli.go +++ b/go/simple/v2/ampli/ampli.go @@ -6,7 +6,7 @@ // To update run 'ampli pull go-ampli' // // Required dependencies: github.com/amplitude/analytics-go@latest -// Tracking Plan Version: 0 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: go-ampli // @@ -418,9 +418,11 @@ func (b *eventWithAllPropertiesBuilder) Build() EventWithAllPropertiesEvent { var EventWithArrayTypes = struct { Builder func() interface { RequiredBooleanArray(requiredBooleanArray []bool) interface { - RequiredNumberArray(requiredNumberArray []float64) interface { - RequiredObjectArray(requiredObjectArray []interface{}) interface { - RequiredStringArray(requiredStringArray []string) EventWithArrayTypesBuilder + RequiredEnumArray(requiredEnumArray []string) interface { + RequiredNumberArray(requiredNumberArray []float64) interface { + RequiredObjectArray(requiredObjectArray []interface{}) interface { + RequiredStringArray(requiredStringArray []string) EventWithArrayTypesBuilder + } } } } @@ -428,9 +430,11 @@ var EventWithArrayTypes = struct { }{ Builder: func() interface { RequiredBooleanArray(requiredBooleanArray []bool) interface { - RequiredNumberArray(requiredNumberArray []float64) interface { - RequiredObjectArray(requiredObjectArray []interface{}) interface { - RequiredStringArray(requiredStringArray []string) EventWithArrayTypesBuilder + RequiredEnumArray(requiredEnumArray []string) interface { + RequiredNumberArray(requiredNumberArray []float64) interface { + RequiredObjectArray(requiredObjectArray []interface{}) interface { + RequiredStringArray(requiredStringArray []string) EventWithArrayTypesBuilder + } } } } @@ -462,13 +466,27 @@ type eventWithArrayTypesBuilder struct { } func (b *eventWithArrayTypesBuilder) RequiredBooleanArray(requiredBooleanArray []bool) interface { + RequiredEnumArray(requiredEnumArray []string) interface { + RequiredNumberArray(requiredNumberArray []float64) interface { + RequiredObjectArray(requiredObjectArray []interface{}) interface { + RequiredStringArray(requiredStringArray []string) EventWithArrayTypesBuilder + } + } + } +} { + b.properties[`requiredBooleanArray`] = requiredBooleanArray + + return b +} + +func (b *eventWithArrayTypesBuilder) RequiredEnumArray(requiredEnumArray []string) interface { RequiredNumberArray(requiredNumberArray []float64) interface { RequiredObjectArray(requiredObjectArray []interface{}) interface { RequiredStringArray(requiredStringArray []string) EventWithArrayTypesBuilder } } } { - b.properties[`requiredBooleanArray`] = requiredBooleanArray + b.properties[`requiredEnumArray`] = requiredEnumArray return b } @@ -661,6 +679,7 @@ func (e eventWithOptionalArrayTypesEvent) eventWithOptionalArrayTypes() { type EventWithOptionalArrayTypesBuilder interface { Build() EventWithOptionalArrayTypesEvent OptionalBooleanArray(optionalBooleanArray []bool) EventWithOptionalArrayTypesBuilder + OptionalEnumArray(optionalEnumArray []string) EventWithOptionalArrayTypesBuilder OptionalJsonArray(optionalJsonArray []interface{}) EventWithOptionalArrayTypesBuilder OptionalNumberArray(optionalNumberArray []float64) EventWithOptionalArrayTypesBuilder OptionalStringArray(optionalStringArray []string) EventWithOptionalArrayTypesBuilder @@ -676,6 +695,12 @@ func (b *eventWithOptionalArrayTypesBuilder) OptionalBooleanArray(optionalBoolea return b } +func (b *eventWithOptionalArrayTypesBuilder) OptionalEnumArray(optionalEnumArray []string) EventWithOptionalArrayTypesBuilder { + b.properties[`optionalEnumArray`] = optionalEnumArray + + return b +} + func (b *eventWithOptionalArrayTypesBuilder) OptionalJsonArray(optionalJsonArray []interface{}) EventWithOptionalArrayTypesBuilder { b.properties[`optionalJSONArray`] = optionalJsonArray @@ -1138,8 +1163,8 @@ func (a *Ampli) Load(options LoadOptions) { clientConfig.Plan = &litude.Plan{ Branch: `main`, Source: `go-ampli`, - Version: `0`, - VersionID: `79154a50-f057-4db5-9755-775e4e9f05e6`, + Version: `1`, + VersionID: `a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c`, } } diff --git a/go/simple/v2/examples/simple_example/simple_example.go b/go/simple/v2/examples/simple_example/simple_example.go index a7f34fc8..ab73f6cc 100644 --- a/go/simple/v2/examples/simple_example/simple_example.go +++ b/go/simple/v2/examples/simple_example/simple_example.go @@ -79,6 +79,7 @@ func main() { ampli.Instance.EventWithArrayTypes(userID, ampli.EventWithArrayTypes.Builder(). RequiredBooleanArray([]bool{true, false}). + RequiredEnumArray([]string{"enum1"}). RequiredNumberArray([]float64{1.2, 3, 4.56}). RequiredObjectArray([]interface{}{ map[string]interface{}{"key-1": "value-1"}, diff --git a/ios/objective-c/AmpliObjectiveCSampleApp/AmpliObjectiveCSampleApp/Ampli/Ampli.h b/ios/objective-c/AmpliObjectiveCSampleApp/AmpliObjectiveCSampleApp/Ampli/Ampli.h index 913fa212..e25b3438 100644 --- a/ios/objective-c/AmpliObjectiveCSampleApp/AmpliObjectiveCSampleApp/Ampli/Ampli.h +++ b/ios/objective-c/AmpliObjectiveCSampleApp/AmpliObjectiveCSampleApp/Ampli/Ampli.h @@ -5,7 +5,7 @@ * To update run 'ampli pull obj-c-ampli' * * Required dependencies: Amplitude ~> 8.10 - * Tracking Plan Version: 0 + * Tracking Plan Version: 1 * Build: 1.0.0 * Runtime: ios:obj-c-ampli * diff --git a/ios/objective-c/AmpliObjectiveCSampleApp/AmpliObjectiveCSampleApp/Ampli/Ampli.m b/ios/objective-c/AmpliObjectiveCSampleApp/AmpliObjectiveCSampleApp/Ampli/Ampli.m index 4d10e549..07ec3da3 100644 --- a/ios/objective-c/AmpliObjectiveCSampleApp/AmpliObjectiveCSampleApp/Ampli/Ampli.m +++ b/ios/objective-c/AmpliObjectiveCSampleApp/AmpliObjectiveCSampleApp/Ampli/Ampli.m @@ -5,7 +5,7 @@ * To update run 'ampli pull obj-c-ampli' * * Required dependencies: Amplitude ~> 8.10 - * Tracking Plan Version: 0 + * Tracking Plan Version: 1 * Build: 1.0.0 * Runtime: ios:obj-c-ampli * @@ -645,7 +645,7 @@ - (void)load:(LoadOptions *)options { } if (_client != nil) { _isLoaded = YES; - AMPPlan *AmpliObservePlan = [[[[[AMPPlan plan] setBranch:@"main"] setSource:@"obj-c-ampli"] setVersion:@"0"] setVersionId:@"79154a50-f057-4db5-9755-775e4e9f05e6"]; + AMPPlan *AmpliObservePlan = [[[[[AMPPlan plan] setBranch:@"main"] setSource:@"obj-c-ampli"] setVersion:@"1"] setVersionId:@"a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c"]; [_client setPlan:AmpliObservePlan]; // set ingestionMetadata information diff --git a/ios/objective-c/AmpliObjectiveCSampleApp/ampli.json b/ios/objective-c/AmpliObjectiveCSampleApp/ampli.json index 8ef6d11c..27ebecf4 100644 --- a/ios/objective-c/AmpliObjectiveCSampleApp/ampli.json +++ b/ios/objective-c/AmpliObjectiveCSampleApp/ampli.json @@ -4,9 +4,9 @@ "SourceId": "496058f1-31a7-402d-9834-35ccd50879ae", "Path": "./AmpliObjectiveCSampleApp/Ampli", "Branch": "main", - "Version": "0.0.0", + "Version": "1.0.0", "Runtime": "ios:obj-c-ampli", - "VersionId": "79154a50-f057-4db5-9755-775e4e9f05e6", + "VersionId": "a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c", "OmitApiKeys": true, "Platform": "iOS", "Language": "Obj-C", diff --git a/ios/swift/AmpliSwiftSampleApp/Shared/Ampli/Ampli.swift b/ios/swift/AmpliSwiftSampleApp/Shared/Ampli/Ampli.swift index cf31c005..228782f0 100644 --- a/ios/swift/AmpliSwiftSampleApp/Shared/Ampli/Ampli.swift +++ b/ios/swift/AmpliSwiftSampleApp/Shared/Ampli/Ampli.swift @@ -5,7 +5,7 @@ * To update run 'ampli pull swift-ampli' * * Required dependencies: Amplitude ~> 8.10 - * Tracking Plan Version: 0 + * Tracking Plan Version: 1 * Build: 1.0.0 * Runtime: ios:swift-ampli * @@ -31,8 +31,8 @@ let ApiKey: [AmpliEnvironment: String] = [ let AmpliObservePlan = AMPPlan() .setBranch("main") .setSource("swift-ampli") - .setVersion("0") - .setVersionId("79154a50-f057-4db5-9755-775e4e9f05e6"); + .setVersion("1") + .setVersionId("a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c"); public class Event { public let eventType: String diff --git a/ios/swift/AmpliSwiftSampleApp/ampli.json b/ios/swift/AmpliSwiftSampleApp/ampli.json index 2896f4d7..b2c22d5e 100644 --- a/ios/swift/AmpliSwiftSampleApp/ampli.json +++ b/ios/swift/AmpliSwiftSampleApp/ampli.json @@ -4,11 +4,11 @@ "SourceId": "2c9d4579-657b-4eac-a989-cdb3e3daf39f", "Path": "./Shared/Ampli", "Branch": "main", - "Version": "0.0.0", + "Version": "1.0.0", "Runtime": "ios:swift-ampli", - "VersionId": "79154a50-f057-4db5-9755-775e4e9f05e6", + "VersionId": "a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c", "OmitApiKeys": true, "Platform": "iOS", "Language": "Swift", "SDK": "Amplitude ~> 8.8.0" -} +} \ No newline at end of file diff --git a/jre/java/AmpliApp/ampli.json b/jre/java/AmpliApp/ampli.json index 6b8ed9b7..a25c120d 100644 --- a/jre/java/AmpliApp/ampli.json +++ b/jre/java/AmpliApp/ampli.json @@ -4,8 +4,11 @@ "SourceId": "1b2ab6d2-929c-41f7-ad95-60f034b67f81", "Path": "./src/main/java/com/amplitude/ampli", "Branch": "main", - "Version": "0.0.0", + "Version": "1.0.0", "Runtime": "jre:java-ampli", - "VersionId": "79154a50-f057-4db5-9755-775e4e9f05e6", - "OmitApiKeys": true + "VersionId": "a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c", + "OmitApiKeys": true, + "Platform": "JRE", + "Language": "Java", + "SDK": "com.amplitude:java-sdk:1.+" } \ No newline at end of file diff --git a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/Ampli.java b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/Ampli.java index c8601be5..f85457b5 100644 --- a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/Ampli.java +++ b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/Ampli.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull jre-java-ampli' // -// Required dependencies: com.amplitude:java-sdk:1.8.0, org.json:json:20201115 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:java-sdk:[1.8.0,2.0), org.json:json:20201115 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: jre:java-ampli // @@ -43,15 +43,15 @@ private synchronized static void createSingleton() { } public enum Environment { - DEV, - PROD + PROD, + DEV } public static final Map API_KEY = new HashMap<>(); static { - API_KEY.put(Environment.DEV, ""); API_KEY.put(Environment.PROD, ""); + API_KEY.put(Environment.DEV, ""); } private boolean disabled = false; @@ -70,8 +70,8 @@ public Amplitude getClient() { private final Plan observePlan = new Plan() .setBranch("main") .setSource("jre-java-ampli") - .setVersion("0") - .setVersionId("79154a50-f057-4db5-9755-775e4e9f05e6"); + .setVersion("1") + .setVersionId("a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c"); // Options should have 'environment', 'client.api_key' or 'client.instance' public void load(LoadOptions options) { @@ -187,74 +187,6 @@ public void flush() { this.client.flushEvents(); } - /** - * EventMaxIntForTest - *

- * View in Tracking Plan - *

- * Event to test schema validation - *

- * Owner: Test codegen - * - * @param userId The user's ID - * @param event The event - */ - public void eventMaxIntForTest(String userId, EventMaxIntForTest event) { - this.eventMaxIntForTest(userId, event, null, null); - } - - /** - * EventMaxIntForTest - *

- * View in Tracking Plan - *

- * Event to test schema validation - *

- * Owner: Test codegen - * - * @param userId The user's ID - * @param event The event - * @param options The event's options - */ - public void eventMaxIntForTest(String userId, EventMaxIntForTest event, EventOptions options) { - this.eventMaxIntForTest(userId, event, options, null); - } - - /** - * EventMaxIntForTest - *

- * View in Tracking Plan - *

- * Event to test schema validation - *

- * Owner: Test codegen - * - * @param userId The user's ID - * @param event The event - * @param extra Extra untyped parameters for use in middleware - */ - public void eventMaxIntForTest(String userId, EventMaxIntForTest event, MiddlewareExtra extra) { - this.eventMaxIntForTest(userId, event, null, extra); - } - - /** - * EventMaxIntForTest - *

- * View in Tracking Plan - *

- * Event to test schema validation - *

- * Owner: Test codegen - * - * @param userId The user's ID - * @param event The event - * @param options The event's options - * @param extra Extra untyped parameters for use in middleware - */ - public void eventMaxIntForTest(String userId, EventMaxIntForTest event, EventOptions options, MiddlewareExtra extra) { - this.track(userId, event, options, extra); - } - /** * Event No Properties *

@@ -587,74 +519,6 @@ public void eventWithConstTypes(String userId, EventOptions options, MiddlewareE this.track(userId, EventWithConstTypes.builder().build(), options, extra); } - /** - * event withDifferent_CasingTypes - *

- * View in Tracking Plan - *

- * Description for case with space - *

- * Owner: Test codegen - * - * @param userId The user's ID - * @param event The event - */ - public void eventWithDifferentCasingTypes(String userId, EventWithDifferentCasingTypes event) { - this.eventWithDifferentCasingTypes(userId, event, null, null); - } - - /** - * event withDifferent_CasingTypes - *

- * View in Tracking Plan - *

- * Description for case with space - *

- * Owner: Test codegen - * - * @param userId The user's ID - * @param event The event - * @param options The event's options - */ - public void eventWithDifferentCasingTypes(String userId, EventWithDifferentCasingTypes event, EventOptions options) { - this.eventWithDifferentCasingTypes(userId, event, options, null); - } - - /** - * event withDifferent_CasingTypes - *

- * View in Tracking Plan - *

- * Description for case with space - *

- * Owner: Test codegen - * - * @param userId The user's ID - * @param event The event - * @param extra Extra untyped parameters for use in middleware - */ - public void eventWithDifferentCasingTypes(String userId, EventWithDifferentCasingTypes event, MiddlewareExtra extra) { - this.eventWithDifferentCasingTypes(userId, event, null, extra); - } - - /** - * event withDifferent_CasingTypes - *

- * View in Tracking Plan - *

- * Description for case with space - *

- * Owner: Test codegen - * - * @param userId The user's ID - * @param event The event - * @param options The event's options - * @param extra Extra untyped parameters for use in middleware - */ - public void eventWithDifferentCasingTypes(String userId, EventWithDifferentCasingTypes event, EventOptions options, MiddlewareExtra extra) { - this.track(userId, event, options, extra); - } - /** * Event With Enum Types *

@@ -927,6 +791,142 @@ public void eventWithTemplateProperties(String userId, EventWithTemplateProperti this.track(userId, event, options, extra); } + /** + * event withDifferent_CasingTypes + *

+ * View in Tracking Plan + *

+ * Description for case with space + *

+ * Owner: Test codegen + * + * @param userId The user's ID + * @param event The event + */ + public void eventWithDifferentCasingTypes(String userId, EventWithDifferentCasingTypes event) { + this.eventWithDifferentCasingTypes(userId, event, null, null); + } + + /** + * event withDifferent_CasingTypes + *

+ * View in Tracking Plan + *

+ * Description for case with space + *

+ * Owner: Test codegen + * + * @param userId The user's ID + * @param event The event + * @param options The event's options + */ + public void eventWithDifferentCasingTypes(String userId, EventWithDifferentCasingTypes event, EventOptions options) { + this.eventWithDifferentCasingTypes(userId, event, options, null); + } + + /** + * event withDifferent_CasingTypes + *

+ * View in Tracking Plan + *

+ * Description for case with space + *

+ * Owner: Test codegen + * + * @param userId The user's ID + * @param event The event + * @param extra Extra untyped parameters for use in middleware + */ + public void eventWithDifferentCasingTypes(String userId, EventWithDifferentCasingTypes event, MiddlewareExtra extra) { + this.eventWithDifferentCasingTypes(userId, event, null, extra); + } + + /** + * event withDifferent_CasingTypes + *

+ * View in Tracking Plan + *

+ * Description for case with space + *

+ * Owner: Test codegen + * + * @param userId The user's ID + * @param event The event + * @param options The event's options + * @param extra Extra untyped parameters for use in middleware + */ + public void eventWithDifferentCasingTypes(String userId, EventWithDifferentCasingTypes event, EventOptions options, MiddlewareExtra extra) { + this.track(userId, event, options, extra); + } + + /** + * EventMaxIntForTest + *

+ * View in Tracking Plan + *

+ * Event to test schema validation + *

+ * Owner: Test codegen + * + * @param userId The user's ID + * @param event The event + */ + public void eventMaxIntForTest(String userId, EventMaxIntForTest event) { + this.eventMaxIntForTest(userId, event, null, null); + } + + /** + * EventMaxIntForTest + *

+ * View in Tracking Plan + *

+ * Event to test schema validation + *

+ * Owner: Test codegen + * + * @param userId The user's ID + * @param event The event + * @param options The event's options + */ + public void eventMaxIntForTest(String userId, EventMaxIntForTest event, EventOptions options) { + this.eventMaxIntForTest(userId, event, options, null); + } + + /** + * EventMaxIntForTest + *

+ * View in Tracking Plan + *

+ * Event to test schema validation + *

+ * Owner: Test codegen + * + * @param userId The user's ID + * @param event The event + * @param extra Extra untyped parameters for use in middleware + */ + public void eventMaxIntForTest(String userId, EventMaxIntForTest event, MiddlewareExtra extra) { + this.eventMaxIntForTest(userId, event, null, extra); + } + + /** + * EventMaxIntForTest + *

+ * View in Tracking Plan + *

+ * Event to test schema validation + *

+ * Owner: Test codegen + * + * @param userId The user's ID + * @param event The event + * @param options The event's options + * @param extra Extra untyped parameters for use in middleware + */ + public void eventMaxIntForTest(String userId, EventMaxIntForTest event, EventOptions options, MiddlewareExtra extra) { + this.track(userId, event, options, extra); + } + private com.amplitude.Event createAmplitudeEvent(String eventType, EventOptions options, String userId) { com.amplitude.Event event = new com.amplitude.Event( eventType, diff --git a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/Event.java b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/Event.java index 15b3eadf..75acd7be 100644 --- a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/Event.java +++ b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/Event.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull jre-java-ampli' // -// Required dependencies: com.amplitude:java-sdk:1.8.0, org.json:json:20201115 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:java-sdk:[1.8.0,2.0), org.json:json:20201115 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: jre:java-ampli // diff --git a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventMaxIntForTest.java b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventMaxIntForTest.java index 87a30523..2b7d305f 100644 --- a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventMaxIntForTest.java +++ b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventMaxIntForTest.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull jre-java-ampli' // -// Required dependencies: com.amplitude:java-sdk:1.8.0, org.json:json:20201115 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:java-sdk:[1.8.0,2.0), org.json:json:20201115 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: jre:java-ampli // diff --git a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventNoProperties.java b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventNoProperties.java index 996c5ee4..731eeba1 100644 --- a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventNoProperties.java +++ b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventNoProperties.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull jre-java-ampli' // -// Required dependencies: com.amplitude:java-sdk:1.8.0, org.json:json:20201115 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:java-sdk:[1.8.0,2.0), org.json:json:20201115 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: jre:java-ampli // diff --git a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventObjectTypes.java b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventObjectTypes.java index 3685310a..ecdfeaac 100644 --- a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventObjectTypes.java +++ b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventObjectTypes.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull jre-java-ampli' // -// Required dependencies: com.amplitude:java-sdk:1.8.0, org.json:json:20201115 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:java-sdk:[1.8.0,2.0), org.json:json:20201115 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: jre:java-ampli // diff --git a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventOptions.java b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventOptions.java index fa34077b..709686e5 100644 --- a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventOptions.java +++ b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventOptions.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull jre-java-ampli' // -// Required dependencies: com.amplitude:java-sdk:1.8.0, org.json:json:20201115 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:java-sdk:[1.8.0,2.0), org.json:json:20201115 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: jre:java-ampli // diff --git a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithAllProperties.java b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithAllProperties.java index 6be7b286..0eb4609f 100644 --- a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithAllProperties.java +++ b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithAllProperties.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull jre-java-ampli' // -// Required dependencies: com.amplitude:java-sdk:1.8.0, org.json:json:20201115 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:java-sdk:[1.8.0,2.0), org.json:json:20201115 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: jre:java-ampli // diff --git a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithArrayTypes.java b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithArrayTypes.java index 977d1be2..404830c3 100644 --- a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithArrayTypes.java +++ b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithArrayTypes.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull jre-java-ampli' // -// Required dependencies: com.amplitude:java-sdk:1.8.0, org.json:json:20201115 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:java-sdk:[1.8.0,2.0), org.json:json:20201115 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: jre:java-ampli // @@ -25,7 +25,7 @@ private EventWithArrayTypes(Builder builder) { public static IRequiredBooleanArray builder() { return new Builder(); } // Inner Builder class with required properties - public static class Builder implements IRequiredBooleanArray, IRequiredNumberArray, IRequiredObjectArray, IRequiredStringArray, IBuild { + public static class Builder implements IRequiredBooleanArray, IRequiredEnumArray, IRequiredNumberArray, IRequiredObjectArray, IRequiredStringArray, IBuild { private final HashMap properties = new HashMap<>(); private Builder() { @@ -35,13 +35,23 @@ private Builder() { /** * description for required boolean array *

- * Must be followed by {@link IRequiredNumberArray#requiredNumberArray(Double[]) + * Must be followed by {@link IRequiredEnumArray#requiredEnumArray(String[]) */ - public IRequiredNumberArray requiredBooleanArray(Boolean[] requiredBooleanArray) { + public IRequiredEnumArray requiredBooleanArray(Boolean[] requiredBooleanArray) { this.properties.put("requiredBooleanArray", requiredBooleanArray); return this; } + /** + * Description for enum array property + *

+ * Must be followed by {@link IRequiredNumberArray#requiredNumberArray(Double[]) + */ + public IRequiredNumberArray requiredEnumArray(String[] requiredEnumArray) { + this.properties.put("requiredEnumArray", requiredEnumArray); + return this; + } + /** * Description for required number array *

@@ -79,7 +89,11 @@ public EventWithArrayTypes build() { // Required property interfaces public interface IRequiredBooleanArray { - IRequiredNumberArray requiredBooleanArray(Boolean[] requiredBooleanArray); + IRequiredEnumArray requiredBooleanArray(Boolean[] requiredBooleanArray); + } + + public interface IRequiredEnumArray { + IRequiredNumberArray requiredEnumArray(String[] requiredEnumArray); } public interface IRequiredNumberArray { diff --git a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithConstTypes.java b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithConstTypes.java index 4c1256de..869a7e50 100644 --- a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithConstTypes.java +++ b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithConstTypes.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull jre-java-ampli' // -// Required dependencies: com.amplitude:java-sdk:1.8.0, org.json:json:20201115 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:java-sdk:[1.8.0,2.0), org.json:json:20201115 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: jre:java-ampli // diff --git a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithDifferentCasingTypes.java b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithDifferentCasingTypes.java index 8b52a8a8..3b5b2e89 100644 --- a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithDifferentCasingTypes.java +++ b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithDifferentCasingTypes.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull jre-java-ampli' // -// Required dependencies: com.amplitude:java-sdk:1.8.0, org.json:json:20201115 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:java-sdk:[1.8.0,2.0), org.json:json:20201115 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: jre:java-ampli // @@ -18,8 +18,8 @@ import java.util.HashMap; public class EventWithDifferentCasingTypes extends Event { - public enum EnumCamelCase { - ENUMCAMELCASE("enumCamelCase"); + public enum EnumWithSpace { + ENUM_WITH_SPACE("enum with space"); private final String value; @@ -28,14 +28,14 @@ public String getValue() return this.value; } - EnumCamelCase(String value) + EnumWithSpace(String value) { this.value = value; } } - public enum EnumPascalCase { - ENUMPASCALCASE("EnumPascalCase"); + public enum EnumSnakeCase { + ENUM_SNAKE_CASE("enum_snake_case"); private final String value; @@ -44,14 +44,14 @@ public String getValue() return this.value; } - EnumPascalCase(String value) + EnumSnakeCase(String value) { this.value = value; } } - public enum EnumSnakeCase { - ENUM_SNAKE_CASE("enum_snake_case"); + public enum EnumCamelCase { + ENUMCAMELCASE("enumCamelCase"); private final String value; @@ -60,14 +60,14 @@ public String getValue() return this.value; } - EnumSnakeCase(String value) + EnumCamelCase(String value) { this.value = value; } } - public enum EnumWithSpace { - ENUM_WITH_SPACE("enum with space"); + public enum EnumPascalCase { + ENUMPASCALCASE("EnumPascalCase"); private final String value; @@ -76,7 +76,7 @@ public String getValue() return this.value; } - EnumWithSpace(String value) + EnumPascalCase(String value) { this.value = value; } diff --git a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithEnumTypes.java b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithEnumTypes.java index 28551a9d..a43416f6 100644 --- a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithEnumTypes.java +++ b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithEnumTypes.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull jre-java-ampli' // -// Required dependencies: com.amplitude:java-sdk:1.8.0, org.json:json:20201115 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:java-sdk:[1.8.0,2.0), org.json:json:20201115 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: jre:java-ampli // diff --git a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithOptionalArrayTypes.java b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithOptionalArrayTypes.java index 9c82b5e3..8f612040 100644 --- a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithOptionalArrayTypes.java +++ b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithOptionalArrayTypes.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull jre-java-ampli' // -// Required dependencies: com.amplitude:java-sdk:1.8.0, org.json:json:20201115 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:java-sdk:[1.8.0,2.0), org.json:json:20201115 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: jre:java-ampli // @@ -40,6 +40,14 @@ public IBuild optionalBooleanArray(Boolean[] optionalBooleanArray) { return this; } + /** + * Description for optional enum array + */ + public IBuild optionalEnumArray(String[] optionalEnumArray) { + this.properties.put("optionalEnumArray", optionalEnumArray); + return this; + } + /** * Description for optional object array */ @@ -72,6 +80,7 @@ public EventWithOptionalArrayTypes build() { /** Build interface with optional properties */ public interface IBuild { IBuild optionalBooleanArray(Boolean[] optionalBooleanArray); + IBuild optionalEnumArray(String[] optionalEnumArray); IBuild optionalJsonArray(Object[] optionalJsonArray); IBuild optionalNumberArray(Double[] optionalNumberArray); IBuild optionalStringArray(String[] optionalStringArray); diff --git a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithOptionalProperties.java b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithOptionalProperties.java index cb58cd84..b887eb4e 100644 --- a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithOptionalProperties.java +++ b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithOptionalProperties.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull jre-java-ampli' // -// Required dependencies: com.amplitude:java-sdk:1.8.0, org.json:json:20201115 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:java-sdk:[1.8.0,2.0), org.json:json:20201115 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: jre:java-ampli // diff --git a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithTemplateProperties.java b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithTemplateProperties.java index d84ccf3a..b509fbba 100644 --- a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithTemplateProperties.java +++ b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/EventWithTemplateProperties.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull jre-java-ampli' // -// Required dependencies: com.amplitude:java-sdk:1.8.0, org.json:json:20201115 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:java-sdk:[1.8.0,2.0), org.json:json:20201115 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: jre:java-ampli // diff --git a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/Identify.java b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/Identify.java index 9e0600db..3baa225f 100644 --- a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/Identify.java +++ b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/Identify.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull jre-java-ampli' // -// Required dependencies: com.amplitude:java-sdk:1.8.0, org.json:json:20201115 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:java-sdk:[1.8.0,2.0), org.json:json:20201115 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: jre:java-ampli // @@ -19,7 +19,7 @@ public class Identify extends Event { private Identify(Builder builder) { - super("Identify", builder.properties); + super("$identify", builder.properties); } public static IRequiredNumber builder() { return new Builder(); } diff --git a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/LoadClientOptions.java b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/LoadClientOptions.java index 9c571f7e..0a7db65b 100644 --- a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/LoadClientOptions.java +++ b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/LoadClientOptions.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull jre-java-ampli' // -// Required dependencies: com.amplitude:java-sdk:1.8.0, org.json:json:20201115 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:java-sdk:[1.8.0,2.0), org.json:json:20201115 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: jre:java-ampli // diff --git a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/LoadOptions.java b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/LoadOptions.java index b3ada294..e75f546a 100644 --- a/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/LoadOptions.java +++ b/jre/java/AmpliApp/src/main/java/com/amplitude/ampli/LoadOptions.java @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull jre-java-ampli' // -// Required dependencies: com.amplitude:java-sdk:1.8.0, org.json:json:20201115 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:java-sdk:[1.8.0,2.0), org.json:json:20201115 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: jre:java-ampli // diff --git a/jre/java/AmpliApp/src/main/java/org/example/App.java b/jre/java/AmpliApp/src/main/java/org/example/App.java index edd7e74c..5802a07c 100644 --- a/jre/java/AmpliApp/src/main/java/org/example/App.java +++ b/jre/java/AmpliApp/src/main/java/org/example/App.java @@ -131,6 +131,7 @@ public static void sendEvents() { Ampli.getInstance().track(userId, EventWithArrayTypes.builder() .requiredBooleanArray(new Boolean[]{true, false, true}) + .requiredEnumArray(new String[]{"enum1"}) .requiredNumberArray(new Double[]{1.1, 2.2, 3.3}) .requiredObjectArray(new Object[]{1, "a", true}) .requiredStringArray(new String[]{"a", "bc", "def"}) diff --git a/jre/kotlin/AmpliApp/ampli.json b/jre/kotlin/AmpliApp/ampli.json index 29e650cd..8008e4f4 100644 --- a/jre/kotlin/AmpliApp/ampli.json +++ b/jre/kotlin/AmpliApp/ampli.json @@ -4,8 +4,11 @@ "SourceId": "30ec8a23-466d-42bd-a3eb-e688ce13b557", "Path": "./src/main/kotlin/com/amplitude/ampli", "Branch": "main", - "Version": "0.0.0", + "Version": "1.0.0", "Runtime": "jre:kotlin-ampli", - "VersionId": "79154a50-f057-4db5-9755-775e4e9f05e6", - "OmitApiKeys": true + "VersionId": "a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c", + "OmitApiKeys": true, + "Platform": "JRE", + "Language": "Kotlin", + "SDK": "com.amplitude:java-sdk:1.+" } \ No newline at end of file diff --git a/jre/kotlin/AmpliApp/src/main/kotlin/Main.kt b/jre/kotlin/AmpliApp/src/main/kotlin/Main.kt index 2a418a03..ce56d763 100644 --- a/jre/kotlin/AmpliApp/src/main/kotlin/Main.kt +++ b/jre/kotlin/AmpliApp/src/main/kotlin/Main.kt @@ -117,6 +117,7 @@ fun sendEvents() { ampli.eventWithArrayTypes(userId, EventWithArrayTypes( requiredBooleanArray = arrayOf(true, false, true), + requiredEnumArray = arrayOf("enum1"), requiredNumberArray = arrayOf(1.1, 2.2, 3.3), requiredStringArray = arrayOf("a", "bc", "def"), requiredObjectArray = arrayOf(1, "a", true) diff --git a/jre/kotlin/AmpliApp/src/main/kotlin/com/amplitude/ampli/Ampli.kt b/jre/kotlin/AmpliApp/src/main/kotlin/com/amplitude/ampli/Ampli.kt index a70295f6..5b2ed503 100644 --- a/jre/kotlin/AmpliApp/src/main/kotlin/com/amplitude/ampli/Ampli.kt +++ b/jre/kotlin/AmpliApp/src/main/kotlin/com/amplitude/ampli/Ampli.kt @@ -4,8 +4,8 @@ // This file is generated by Amplitude. // To update run 'ampli pull jre-kotlin-ampli' // -// Required dependencies: com.amplitude:java-sdk:1.8.0, org.json:json:20201115 -// Tracking Plan Version: 0 +// Required dependencies: com.amplitude:java-sdk:[1.8.0,2.0), org.json:json:20201115 +// Tracking Plan Version: 1 // Build: 1.0.0 // Runtime: jre:kotlin-ampli // @@ -83,28 +83,6 @@ class Identify private constructor( ), null as EventOptions?) } -class EventMaxIntForTest private constructor( - eventProperties: Map?, - options: EventOptions? = null -) : Event("EventMaxIntForTest", eventProperties, options, ::EventMaxIntForTest) { - /** - * EventMaxIntForTest - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) - * - * Event to test schema validation - * - * Owner: Test codegen - * - * @param intMax10 property to test schema validation - */ - constructor( - intMax10: Int - ) : this(mapOf( - "intMax10" to intMax10 - ), null as EventOptions?) -} - class EventNoProperties private constructor( eventProperties: Map?, options: EventOptions? = null @@ -206,17 +184,20 @@ class EventWithArrayTypes private constructor( * Owner: Test codegen * * @param requiredBooleanArray description for required boolean array + * @param requiredEnumArray Description for enum array property * @param requiredNumberArray Description for required number array * @param requiredObjectArray Description for required object array * @param requiredStringArray description for required string array */ constructor( requiredBooleanArray: Array, + requiredEnumArray: Array, requiredNumberArray: Array, requiredObjectArray: Array, requiredStringArray: Array ) : this(mapOf( "requiredBooleanArray" to requiredBooleanArray, + "requiredEnumArray" to requiredEnumArray, "requiredNumberArray" to requiredNumberArray, "requiredObjectArray" to requiredObjectArray, "requiredStringArray" to requiredStringArray @@ -246,65 +227,6 @@ class EventWithConstTypes private constructor( ), null as EventOptions?) } -class EventWithDifferentCasingTypes private constructor( - eventProperties: Map?, - options: EventOptions? = null -) : Event("event withDifferent_CasingTypes", eventProperties, options, ::EventWithDifferentCasingTypes) { - /** - * event withDifferent_CasingTypes - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) - * - * Description for case with space - * - * Owner: Test codegen - * - * @param enumCamelCase descriptionForEnumCamelCase - * @param enumPascalCase DescirptionForEnumPascalCase - * @param enumSnakeCase description_for_enum_snake_case - * @param enumWithSpace Description for enum with space - * @param propertyWithCamelCase descriptionForCamelCase - * @param propertyWithPascalCase DescriptionForPascalCase - * @param propertyWithSnakeCase Description_for_snake_case - * @param propertyWithSpace Description for case with space - */ - constructor( - enumCamelCase: EnumCamelCase, - enumPascalCase: EnumPascalCase, - enumSnakeCase: EnumSnakeCase, - enumWithSpace: EnumWithSpace, - propertyWithCamelCase: String, - propertyWithPascalCase: String, - propertyWithSnakeCase: String, - propertyWithSpace: String - ) : this(mapOf( - "enumCamelCase" to enumCamelCase.value, - "EnumPascalCase" to enumPascalCase.value, - "enum_snake_case" to enumSnakeCase.value, - "enum with space" to enumWithSpace.value, - "propertyWithCamelCase" to propertyWithCamelCase, - "PropertyWithPascalCase" to propertyWithPascalCase, - "property_with_snake_case" to propertyWithSnakeCase, - "property with space" to propertyWithSpace - ), null as EventOptions?) - - enum class EnumCamelCase(val value: String) { - ENUM_CAMEL_CASE("enumCamelCase") - } - - enum class EnumPascalCase(val value: String) { - ENUM_PASCAL_CASE("EnumPascalCase") - } - - enum class EnumSnakeCase(val value: String) { - ENUM_SNAKE_CASE("enum_snake_case") - } - - enum class EnumWithSpace(val value: String) { - ENUM_WITH_SPACE("enum with space") - } -} - class EventWithEnumTypes private constructor( eventProperties: Map?, options: EventOptions? = null @@ -354,17 +276,20 @@ class EventWithOptionalArrayTypes private constructor( * Owner: Test codegen * * @param optionalBooleanArray Description for optional boolean array + * @param optionalEnumArray Description for optional enum array * @param optionalJsonArray Description for optional object array * @param optionalNumberArray Description for optional number array * @param optionalStringArray Description for optional string array */ constructor( optionalBooleanArray: Array? = null, + optionalEnumArray: Array? = null, optionalJsonArray: Array? = null, optionalNumberArray: Array? = null, optionalStringArray: Array? = null ) : this(mapOf( *(if (optionalBooleanArray != null) arrayOf("optionalBooleanArray" to optionalBooleanArray) else arrayOf()), + *(if (optionalEnumArray != null) arrayOf("optionalEnumArray" to optionalEnumArray) else arrayOf()), *(if (optionalJsonArray != null) arrayOf("optionalJSONArray" to optionalJsonArray) else arrayOf()), *(if (optionalNumberArray != null) arrayOf("optionalNumberArray" to optionalNumberArray) else arrayOf()), *(if (optionalStringArray != null) arrayOf("optionalStringArray" to optionalStringArray) else arrayOf()) @@ -436,25 +361,106 @@ class EventWithTemplateProperties private constructor( ), null as EventOptions?) } +class EventWithDifferentCasingTypes private constructor( + eventProperties: Map?, + options: EventOptions? = null +) : Event("event withDifferent_CasingTypes", eventProperties, options, ::EventWithDifferentCasingTypes) { + /** + * event withDifferent_CasingTypes + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) + * + * Description for case with space + * + * Owner: Test codegen + * + * @param enumWithSpace Description for enum with space + * @param enumSnakeCase description_for_enum_snake_case + * @param enumCamelCase descriptionForEnumCamelCase + * @param enumPascalCase DescirptionForEnumPascalCase + * @param propertyWithSpace Description for case with space + * @param propertyWithSnakeCase Description_for_snake_case + * @param propertyWithCamelCase descriptionForCamelCase + * @param propertyWithPascalCase DescriptionForPascalCase + */ + constructor( + enumWithSpace: EnumWithSpace, + enumSnakeCase: EnumSnakeCase, + enumCamelCase: EnumCamelCase, + enumPascalCase: EnumPascalCase, + propertyWithSpace: String, + propertyWithSnakeCase: String, + propertyWithCamelCase: String, + propertyWithPascalCase: String + ) : this(mapOf( + "enum with space" to enumWithSpace.value, + "enum_snake_case" to enumSnakeCase.value, + "enumCamelCase" to enumCamelCase.value, + "EnumPascalCase" to enumPascalCase.value, + "property with space" to propertyWithSpace, + "property_with_snake_case" to propertyWithSnakeCase, + "propertyWithCamelCase" to propertyWithCamelCase, + "PropertyWithPascalCase" to propertyWithPascalCase + ), null as EventOptions?) + + enum class EnumWithSpace(val value: String) { + ENUM_WITH_SPACE("enum with space") + } + + enum class EnumSnakeCase(val value: String) { + ENUM_SNAKE_CASE("enum_snake_case") + } + + enum class EnumCamelCase(val value: String) { + ENUM_CAMEL_CASE("enumCamelCase") + } + + enum class EnumPascalCase(val value: String) { + ENUM_PASCAL_CASE("EnumPascalCase") + } +} + +class EventMaxIntForTest private constructor( + eventProperties: Map?, + options: EventOptions? = null +) : Event("EventMaxIntForTest", eventProperties, options, ::EventMaxIntForTest) { + /** + * EventMaxIntForTest + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) + * + * Event to test schema validation + * + * Owner: Test codegen + * + * @param intMax10 property to test schema validation + */ + constructor( + intMax10: Int + ) : this(mapOf( + "intMax10" to intMax10 + ), null as EventOptions?) +} + val ampli = Ampli() open class Ampli { companion object { val API_KEY: Map = mapOf( - Environment.DEV to "", - Environment.PROD to "" + Environment.PROD to "", + Environment.DEV to "" ) private val observePlan: Plan = Plan() .setBranch("main") .setSource("jre-kotlin-ampli") - .setVersion("0") - .setVersionId("79154a50-f057-4db5-9755-775e4e9f05e6") + .setVersion("1") + .setVersionId("a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c") } enum class Environment { - DEV, - PROD + PROD, + DEV } private var disabled: Boolean = false @@ -553,24 +559,6 @@ open class Ampli { this._client?.flushEvents() } - /** - * EventMaxIntForTest - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) - * - * Event to test schema validation - * - * Owner: Test codegen - * - * @param userId The user's ID - * @param event The event - * @param options Amplitude event options - * @param extra Extra untyped parameters for use in middleware - */ - fun eventMaxIntForTest(userId: String?, event: EventMaxIntForTest, options: EventOptions? = null, extra: MiddlewareExtra? = null) { - this.track(userId, event, options, extra) - } - /** * Event No Properties * @@ -659,24 +647,6 @@ open class Ampli { this.track(userId, EventWithConstTypes(), options, extra) } - /** - * event withDifferent_CasingTypes - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) - * - * Description for case with space - * - * Owner: Test codegen - * - * @param userId The user's ID - * @param event The event - * @param options Amplitude event options - * @param extra Extra untyped parameters for use in middleware - */ - fun eventWithDifferentCasingTypes(userId: String?, event: EventWithDifferentCasingTypes, options: EventOptions? = null, extra: MiddlewareExtra? = null) { - this.track(userId, event, options, extra) - } - /** * Event With Enum Types * @@ -749,6 +719,42 @@ open class Ampli { this.track(userId, event, options, extra) } + /** + * event withDifferent_CasingTypes + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) + * + * Description for case with space + * + * Owner: Test codegen + * + * @param userId The user's ID + * @param event The event + * @param options Amplitude event options + * @param extra Extra untyped parameters for use in middleware + */ + fun eventWithDifferentCasingTypes(userId: String?, event: EventWithDifferentCasingTypes, options: EventOptions? = null, extra: MiddlewareExtra? = null) { + this.track(userId, event, options, extra) + } + + /** + * EventMaxIntForTest + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) + * + * Event to test schema validation + * + * Owner: Test codegen + * + * @param userId The user's ID + * @param event The event + * @param options Amplitude event options + * @param extra Extra untyped parameters for use in middleware + */ + fun eventMaxIntForTest(userId: String?, event: EventMaxIntForTest, options: EventOptions? = null, extra: MiddlewareExtra? = null) { + this.track(userId, event, options, extra) + } + private fun createAmplitudeEvent(eventType: String, options: EventOptions?, overrideOptions: EventOptions?, overrideUserId: String?): com.amplitude.Event { val event = com.amplitude.Event( eventType, diff --git a/node/javascript/v1/AmpliApp/ampli.json b/node/javascript/v1/AmpliApp/ampli.json index d77c6342..2d3fb0f2 100644 --- a/node/javascript/v1/AmpliApp/ampli.json +++ b/node/javascript/v1/AmpliApp/ampli.json @@ -4,8 +4,11 @@ "SourceId": "c0d6d4bb-193c-4a16-9544-62a1f589baa9", "Path": "./src/ampli", "Branch": "main", - "Version": "0.0.0", + "Version": "1.0.0", "Runtime": "node.js:javascript-ampli", - "VersionId": "79154a50-f057-4db5-9755-775e4e9f05e6", - "OmitApiKeys": true + "VersionId": "a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c", + "OmitApiKeys": true, + "Platform": "Node.js", + "Language": "JavaScript", + "SDK": "@amplitude/node@^1.0" } \ No newline at end of file diff --git a/node/javascript/v1/AmpliApp/src/ampli/index.js b/node/javascript/v1/AmpliApp/src/ampli/index.js index 881e9005..4efc0f47 100644 --- a/node/javascript/v1/AmpliApp/src/ampli/index.js +++ b/node/javascript/v1/AmpliApp/src/ampli/index.js @@ -7,7 +7,7 @@ * To update run 'ampli pull node-js-ampli' * * Required dependencies: @amplitude/node@^1.10.2 - * Tracking Plan Version: 0 + * Tracking Plan Version: 1 * Build: 1.0.0 * Runtime: node.js:javascript-ampli * @@ -36,7 +36,7 @@ const { init: initNodeClient, NodeClient, Status, Options } = require('@amplitud /** * @typedef LoadOptions * @type {object} - * @property {'dev'|'prod'} [environment] + * @property {'prod'|'dev'} [environment] * @property {boolean} [disabled] * @property {LoadClientOptions} [client] */ @@ -64,12 +64,12 @@ const { init: initNodeClient, NodeClient, Status, Options } = require('@amplitud /** * @typedef ApiKey * @type {object} - * @property {string} dev * @property {string} prod + * @property {string} dev */ const ApiKey = { - dev: '', - prod: '' + prod: '', + dev: '' }; /** @@ -89,10 +89,10 @@ const ApiKey = { */ const DefaultOptions = { plan: { - version: '0', + version: '1', branch: 'main', source: 'node-js-ampli', - versionId: '79154a50-f057-4db5-9755-775e4e9f05e6' + versionId: 'a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c' }, ...{ ingestionMetadata: { @@ -109,13 +109,6 @@ class Identify { } } -class EventMaxIntForTest { - constructor(properties) { - this.event_type = 'EventMaxIntForTest'; - this.event_properties = properties; - } -} - class EventNoProperties { constructor() { this.event_type = 'Event No Properties'; @@ -160,13 +153,6 @@ class EventWithConstTypes { } } -class EventWithDifferentCasingTypes { - constructor(properties) { - this.event_type = 'event withDifferent_CasingTypes'; - this.event_properties = properties; - } -} - class EventWithEnumTypes { constructor(properties) { this.event_type = 'Event With Enum Types'; @@ -195,6 +181,20 @@ class EventWithTemplateProperties { } } +class EventWithDifferentCasingTypes { + constructor(properties) { + this.event_type = 'event withDifferent_CasingTypes'; + this.event_properties = properties; + } +} + +class EventMaxIntForTest { + constructor(properties) { + this.event_type = 'EventMaxIntForTest'; + this.event_properties = properties; + } +} + const getDefaultPromiseResponse = () => Promise.resolve({ status: Status.Skipped, statusCode: 200, @@ -308,27 +308,6 @@ class Ampli { return { promise }; } - /** - * EventMaxIntForTest - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) - * - * Event to test schema validation - * - * Owner: Test codegen - * - * @param {string} userId The user's ID. - * @param {Object} properties The event's properties. - * @param {number} properties.intMax10 property to test schema validation - * @param {EventOptions} [options] Options for this track call. - * @param {MiddlewareExtra} [extra] Extra untyped parameters for use in middleware. - * - * @return {{promise: Promise}} - */ - eventMaxIntForTest(userId, properties, options, extra) { - return this.track(userId, new EventMaxIntForTest(properties), options, extra); - } - /** * Event No Properties * @@ -409,6 +388,7 @@ class Ampli { * @param {string} userId The user's ID. * @param {Object} properties The event's properties. * @param {boolean[]} properties.requiredBooleanArray description for required boolean array + * @param {string[]} properties.requiredEnumArray Description for enum array property * @param {number[]} properties.requiredNumberArray Description for required number array * @param {*[]} properties.requiredObjectArray Description for required object array * @param {string[]} properties.requiredStringArray description for required string array @@ -440,34 +420,6 @@ class Ampli { return this.track(userId, new EventWithConstTypes(), options, extra); } - /** - * event withDifferent_CasingTypes - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) - * - * Description for case with space - * - * Owner: Test codegen - * - * @param {string} userId The user's ID. - * @param {Object} properties The event's properties. - * @param {'enumCamelCase'} properties.enumCamelCase descriptionForEnumCamelCase - * @param {'EnumPascalCase'} properties.EnumPascalCase DescirptionForEnumPascalCase - * @param {'enum_snake_case'} properties.enum_snake_case description_for_enum_snake_case - * @param {'enum with space'} properties.enum with space Description for enum with space - * @param {string} properties.propertyWithCamelCase descriptionForCamelCase - * @param {string} properties.PropertyWithPascalCase DescriptionForPascalCase - * @param {string} properties.property_with_snake_case Description_for_snake_case - * @param {string} properties.property with space Description for case with space - * @param {EventOptions} [options] Options for this track call. - * @param {MiddlewareExtra} [extra] Extra untyped parameters for use in middleware. - * - * @return {{promise: Promise}} - */ - eventWithDifferentCasingTypes(userId, properties, options, extra) { - return this.track(userId, new EventWithDifferentCasingTypes(properties), options, extra); - } - /** * Event With Enum Types * @@ -502,6 +454,7 @@ class Ampli { * @param {string} userId The user's ID. * @param {Object} [properties] The event's properties. * @param {boolean[]} [properties.optionalBooleanArray] Description for optional boolean array + * @param {string[]} [properties.optionalEnumArray] Description for optional enum array * @param {*[]} [properties.optionalJSONArray] Description for optional object array * @param {number[]} [properties.optionalNumberArray] Description for optional number array * @param {string[]} [properties.optionalStringArray] Description for optional string array @@ -563,6 +516,55 @@ class Ampli { return this.track(userId, new EventWithTemplateProperties(properties), options, extra); } + /** + * event withDifferent_CasingTypes + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) + * + * Description for case with space + * + * Owner: Test codegen + * + * @param {string} userId The user's ID. + * @param {Object} properties The event's properties. + * @param {'enum with space'} properties.enum with space Description for enum with space + * @param {'enum_snake_case'} properties.enum_snake_case description_for_enum_snake_case + * @param {'enumCamelCase'} properties.enumCamelCase descriptionForEnumCamelCase + * @param {'EnumPascalCase'} properties.EnumPascalCase DescirptionForEnumPascalCase + * @param {string} properties.property with space Description for case with space + * @param {string} properties.property_with_snake_case Description_for_snake_case + * @param {string} properties.propertyWithCamelCase descriptionForCamelCase + * @param {string} properties.PropertyWithPascalCase DescriptionForPascalCase + * @param {EventOptions} [options] Options for this track call. + * @param {MiddlewareExtra} [extra] Extra untyped parameters for use in middleware. + * + * @return {{promise: Promise}} + */ + eventWithDifferentCasingTypes(userId, properties, options, extra) { + return this.track(userId, new EventWithDifferentCasingTypes(properties), options, extra); + } + + /** + * EventMaxIntForTest + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) + * + * Event to test schema validation + * + * Owner: Test codegen + * + * @param {string} userId The user's ID. + * @param {Object} properties The event's properties. + * @param {number} properties.intMax10 property to test schema validation + * @param {EventOptions} [options] Options for this track call. + * @param {MiddlewareExtra} [extra] Extra untyped parameters for use in middleware. + * + * @return {{promise: Promise}} + */ + eventMaxIntForTest(userId, properties, options, extra) { + return this.track(userId, new EventMaxIntForTest(properties), options, extra); + } + /** * Track any event. * @param {string|undefined} userId The user's ID. @@ -597,15 +599,15 @@ class Ampli { module.exports.Ampli = Ampli; module.exports.ApiKey = ApiKey; module.exports.DefaultOptions = DefaultOptions; -module.exports.EventMaxIntForTest = EventMaxIntForTest; module.exports.EventNoProperties = EventNoProperties; module.exports.EventObjectTypes = EventObjectTypes; module.exports.EventWithAllProperties = EventWithAllProperties; module.exports.EventWithArrayTypes = EventWithArrayTypes; module.exports.EventWithConstTypes = EventWithConstTypes; -module.exports.EventWithDifferentCasingTypes = EventWithDifferentCasingTypes; module.exports.EventWithEnumTypes = EventWithEnumTypes; module.exports.EventWithOptionalArrayTypes = EventWithOptionalArrayTypes; module.exports.EventWithOptionalProperties = EventWithOptionalProperties; module.exports.EventWithTemplateProperties = EventWithTemplateProperties; +module.exports.EventWithDifferentCasingTypes = EventWithDifferentCasingTypes; +module.exports.EventMaxIntForTest = EventMaxIntForTest; module.exports.ampli = new Ampli(); diff --git a/node/javascript/v1/AmpliApp/src/app.js b/node/javascript/v1/AmpliApp/src/app.js index 7ffa3d5c..adb66e21 100644 --- a/node/javascript/v1/AmpliApp/src/app.js +++ b/node/javascript/v1/AmpliApp/src/app.js @@ -153,6 +153,7 @@ ampli.eventObjectTypes(userId, { ampli.eventWithArrayTypes(userId, { requiredBooleanArray: [true, false], + requiredEnumArray: ['enum1'], requiredNumberArray: [1.2, 3, 4.56], requiredObjectArray: [{ 'key-1': 'value-1' }, { 'key-2': 'value-2' }], requiredStringArray: ['string-1', 'string-2', 'string-3'], diff --git a/node/javascript/v2/AmpliApp/src/ampli/index.js b/node/javascript/v2/AmpliApp/src/ampli/index.js index 8eb964ec..92a53813 100644 --- a/node/javascript/v2/AmpliApp/src/ampli/index.js +++ b/node/javascript/v2/AmpliApp/src/ampli/index.js @@ -7,7 +7,7 @@ * To update run 'ampli pull node-js-ampli-v2' * * Required dependencies: @amplitude/analytics-node@^1.0.0 - * Tracking Plan Version: 0 + * Tracking Plan Version: 1 * Build: 1.0.0 * Runtime: node.js:javascript-ampli-v2 * @@ -83,7 +83,7 @@ const ApiKey = { */ const DefaultConfiguration = { plan: { - version: '0', + version: '1', branch: 'main', source: 'node-js-ampli-v2', versionId: 'a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c' diff --git a/node/nextjs/ampli-app/ampli.json b/node/nextjs/ampli-app/ampli.json index 28f02417..77cf29f8 100644 --- a/node/nextjs/ampli-app/ampli.json +++ b/node/nextjs/ampli-app/ampli.json @@ -2,10 +2,13 @@ "SourceId": "cab2bd4d-ee45-4d5d-a40d-49ed31feee6a", "Path": "./lib/ampli", "Branch": "main", - "Version": "0.0.0", + "Version": "1.0.0", "WorkspaceId": "77b37977-cb3a-42eb-bce3-09f5f7c3adb7", "OrgId": "132559", "Runtime": "node.js:typescript-ampli", - "VersionId": "79154a50-f057-4db5-9755-775e4e9f05e6", - "OmitApiKeys": true + "VersionId": "a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c", + "OmitApiKeys": true, + "Platform": "Node.js", + "Language": "TypeScript", + "SDK": "@amplitude/node@^1.0" } \ No newline at end of file diff --git a/node/nextjs/ampli-app/lib/ampli/index.ts b/node/nextjs/ampli-app/lib/ampli/index.ts index 73dc5956..23ac5c14 100644 --- a/node/nextjs/ampli-app/lib/ampli/index.ts +++ b/node/nextjs/ampli-app/lib/ampli/index.ts @@ -7,7 +7,7 @@ * To update run 'ampli pull node-ts-ampli' * * Required dependencies: @amplitude/node@^1.10.2 - * Tracking Plan Version: 0 + * Tracking Plan Version: 1 * Build: 1.0.0 * Runtime: node.js:typescript-ampli * @@ -22,11 +22,11 @@ import { BaseEvent, Event, EventOptions, GroupOptions, IdentifyEvent, IdentifyOptions, Options, MiddlewareExtra, } from '@amplitude/types'; -export type Environment = 'dev' | 'prod'; +export type Environment = 'prod' | 'dev'; export const ApiKey: Record = { - dev: '', - prod: '' + prod: '', + dev: '' }; /** @@ -34,10 +34,10 @@ export const ApiKey: Record = { */ export const DefaultOptions: Partial = { plan: { - version: '0', + version: '1', branch: 'main', source: 'node-ts-ampli', - versionId: '79154a50-f057-4db5-9755-775e4e9f05e6' + versionId: 'a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c' }, ...{ ingestionMetadata: { @@ -75,25 +75,11 @@ export interface IdentifyProperties { requiredNumber: number; } -export interface EventMaxIntForTestProperties { - /** - * property to test schema validation - * - * | Rule | Value | - * |---|---| - * | Type | integer | - * | Max Value | 10 | - */ - intMax10: number; -} - export interface EventObjectTypesProperties { /** * Property Object Type */ - requiredObject: { - [k: string]: any; - }; + requiredObject: any; /** * Property Object Array Type */ @@ -159,6 +145,14 @@ export interface EventWithArrayTypesProperties { * | Item Type | boolean | */ requiredBooleanArray: boolean[]; + /** + * Description for enum array property + * + * | Rule | Value | + * |---|---| + * | Item Type | string | + */ + requiredEnumArray: ("enum1" | "enum2")[]; /** * Description for required number array * @@ -181,57 +175,6 @@ export interface EventWithArrayTypesProperties { requiredStringArray: string[]; } -export interface EventWithDifferentCasingTypesProperties { - /** - * descriptionForEnumCamelCase - * - * | Rule | Value | - * |---|---| - * | Enum Values | enumCamelCase | - */ - enumCamelCase: "enumCamelCase"; - /** - * DescirptionForEnumPascalCase - * - * | Rule | Value | - * |---|---| - * | Enum Values | EnumPascalCase | - */ - EnumPascalCase: "EnumPascalCase"; - /** - * description_for_enum_snake_case - * - * | Rule | Value | - * |---|---| - * | Enum Values | enum_snake_case | - */ - enum_snake_case: "enum_snake_case"; - /** - * Description for enum with space - * - * | Rule | Value | - * |---|---| - * | Enum Values | enum with space | - */ - "enum with space": "enum with space"; - /** - * descriptionForCamelCase - */ - propertyWithCamelCase: string; - /** - * DescriptionForPascalCase - */ - PropertyWithPascalCase: string; - /** - * Description_for_snake_case - */ - property_with_snake_case: string; - /** - * Description for case with space - */ - "property with space": string; -} - export interface EventWithEnumTypesProperties { /** * Description for required enum @@ -260,6 +203,14 @@ export interface EventWithOptionalArrayTypesProperties { * | Item Type | boolean | */ optionalBooleanArray?: boolean[]; + /** + * Description for optional enum array + * + * | Rule | Value | + * |---|---| + * | Item Type | string | + */ + optionalEnumArray?: ("enum1" | "enum2")[]; /** * Description for optional object array */ @@ -335,6 +286,69 @@ export interface EventWithTemplatePropertiesProperties { required_template_property: string; } +export interface EventWithDifferentCasingTypesProperties { + /** + * Description for enum with space + * + * | Rule | Value | + * |---|---| + * | Enum Values | enum with space | + */ + "enum with space": "enum with space"; + /** + * description_for_enum_snake_case + * + * | Rule | Value | + * |---|---| + * | Enum Values | enum_snake_case | + */ + enum_snake_case: "enum_snake_case"; + /** + * descriptionForEnumCamelCase + * + * | Rule | Value | + * |---|---| + * | Enum Values | enumCamelCase | + */ + enumCamelCase: "enumCamelCase"; + /** + * DescirptionForEnumPascalCase + * + * | Rule | Value | + * |---|---| + * | Enum Values | EnumPascalCase | + */ + EnumPascalCase: "EnumPascalCase"; + /** + * Description for case with space + */ + "property with space": string; + /** + * Description_for_snake_case + */ + property_with_snake_case: string; + /** + * descriptionForCamelCase + */ + propertyWithCamelCase: string; + /** + * DescriptionForPascalCase + */ + PropertyWithPascalCase: string; +} + +export interface EventMaxIntForTestProperties { + /** + * property to test schema validation + * + * | Rule | Value | + * |---|---| + * | Type | integer | + * | Max Value | 10 | + */ + intMax10: number; +} + export interface EventTemplateProperties { /** * optional_template_property description @@ -375,16 +389,6 @@ export class Identify implements BaseEvent { } } -export class EventMaxIntForTest implements BaseEvent { - event_type = 'EventMaxIntForTest'; - - constructor( - public event_properties: EventMaxIntForTestProperties, - ) { - this.event_properties = event_properties; - } -} - export class EventNoProperties implements BaseEvent { event_type = 'Event No Properties'; } @@ -437,16 +441,6 @@ export class EventWithConstTypes implements BaseEvent { }; } -export class EventWithDifferentCasingTypes implements BaseEvent { - event_type = 'event withDifferent_CasingTypes'; - - constructor( - public event_properties: EventWithDifferentCasingTypesProperties, - ) { - this.event_properties = event_properties; - } -} - export class EventWithEnumTypes implements BaseEvent { event_type = 'Event With Enum Types'; @@ -487,6 +481,26 @@ export class EventWithTemplateProperties implements BaseEvent { } } +export class EventWithDifferentCasingTypes implements BaseEvent { + event_type = 'event withDifferent_CasingTypes'; + + constructor( + public event_properties: EventWithDifferentCasingTypesProperties, + ) { + this.event_properties = event_properties; + } +} + +export class EventMaxIntForTest implements BaseEvent { + event_type = 'EventMaxIntForTest'; + + constructor( + public event_properties: EventMaxIntForTestProperties, + ) { + this.event_properties = event_properties; + } +} + const getDefaultPromiseResponse = () => Promise.resolve({ status: Status.Skipped, statusCode: 200, @@ -589,29 +603,6 @@ export class Ampli { return { promise }; } - /** - * EventMaxIntForTest - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) - * - * Event to test schema validation - * - * Owner: Test codegen - * - * @param userId The user's ID. - * @param properties The event's properties (e.g. intMax10) - * @param options Amplitude event options. - * @param extra Extra untyped parameters for use in middleware. - */ - eventMaxIntForTest( - userId: string | undefined, - properties: EventMaxIntForTestProperties, - options?: EventOptions, - extra?: MiddlewareExtra, - ) { - return this.track(userId, new EventMaxIntForTest(properties), options, extra); - } - /** * Event No Properties * @@ -723,29 +714,6 @@ export class Ampli { return this.track(userId, new EventWithConstTypes(), options, extra); } - /** - * event withDifferent_CasingTypes - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) - * - * Description for case with space - * - * Owner: Test codegen - * - * @param userId The user's ID. - * @param properties The event's properties (e.g. enumCamelCase) - * @param options Amplitude event options. - * @param extra Extra untyped parameters for use in middleware. - */ - eventWithDifferentCasingTypes( - userId: string | undefined, - properties: EventWithDifferentCasingTypesProperties, - options?: EventOptions, - extra?: MiddlewareExtra, - ) { - return this.track(userId, new EventWithDifferentCasingTypes(properties), options, extra); - } - /** * Event With Enum Types * @@ -837,6 +805,52 @@ export class Ampli { ) { return this.track(userId, new EventWithTemplateProperties(properties), options, extra); } + + /** + * event withDifferent_CasingTypes + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) + * + * Description for case with space + * + * Owner: Test codegen + * + * @param userId The user's ID. + * @param properties The event's properties (e.g. enum with space) + * @param options Amplitude event options. + * @param extra Extra untyped parameters for use in middleware. + */ + eventWithDifferentCasingTypes( + userId: string | undefined, + properties: EventWithDifferentCasingTypesProperties, + options?: EventOptions, + extra?: MiddlewareExtra, + ) { + return this.track(userId, new EventWithDifferentCasingTypes(properties), options, extra); + } + + /** + * EventMaxIntForTest + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) + * + * Event to test schema validation + * + * Owner: Test codegen + * + * @param userId The user's ID. + * @param properties The event's properties (e.g. intMax10) + * @param options Amplitude event options. + * @param extra Extra untyped parameters for use in middleware. + */ + eventMaxIntForTest( + userId: string | undefined, + properties: EventMaxIntForTestProperties, + options?: EventOptions, + extra?: MiddlewareExtra, + ) { + return this.track(userId, new EventMaxIntForTest(properties), options, extra); + } } /** diff --git a/node/typescript/v1/AmpliApp/ampli.json b/node/typescript/v1/AmpliApp/ampli.json index 5331d816..2598c870 100644 --- a/node/typescript/v1/AmpliApp/ampli.json +++ b/node/typescript/v1/AmpliApp/ampli.json @@ -2,10 +2,13 @@ "SourceId": "cab2bd4d-ee45-4d5d-a40d-49ed31feee6a", "Path": "./src/ampli", "Branch": "main", - "Version": "0.0.0", + "Version": "1.0.0", "WorkspaceId": "77b37977-cb3a-42eb-bce3-09f5f7c3adb7", "OrgId": "132559", "Runtime": "node.js:typescript-ampli", - "VersionId": "79154a50-f057-4db5-9755-775e4e9f05e6", - "OmitApiKeys": true + "VersionId": "a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c", + "OmitApiKeys": true, + "Platform": "Node.js", + "Language": "TypeScript", + "SDK": "@amplitude/node@^1.0" } \ No newline at end of file diff --git a/node/typescript/v1/AmpliApp/src/ampli/index.ts b/node/typescript/v1/AmpliApp/src/ampli/index.ts index 73dc5956..23ac5c14 100644 --- a/node/typescript/v1/AmpliApp/src/ampli/index.ts +++ b/node/typescript/v1/AmpliApp/src/ampli/index.ts @@ -7,7 +7,7 @@ * To update run 'ampli pull node-ts-ampli' * * Required dependencies: @amplitude/node@^1.10.2 - * Tracking Plan Version: 0 + * Tracking Plan Version: 1 * Build: 1.0.0 * Runtime: node.js:typescript-ampli * @@ -22,11 +22,11 @@ import { BaseEvent, Event, EventOptions, GroupOptions, IdentifyEvent, IdentifyOptions, Options, MiddlewareExtra, } from '@amplitude/types'; -export type Environment = 'dev' | 'prod'; +export type Environment = 'prod' | 'dev'; export const ApiKey: Record = { - dev: '', - prod: '' + prod: '', + dev: '' }; /** @@ -34,10 +34,10 @@ export const ApiKey: Record = { */ export const DefaultOptions: Partial = { plan: { - version: '0', + version: '1', branch: 'main', source: 'node-ts-ampli', - versionId: '79154a50-f057-4db5-9755-775e4e9f05e6' + versionId: 'a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c' }, ...{ ingestionMetadata: { @@ -75,25 +75,11 @@ export interface IdentifyProperties { requiredNumber: number; } -export interface EventMaxIntForTestProperties { - /** - * property to test schema validation - * - * | Rule | Value | - * |---|---| - * | Type | integer | - * | Max Value | 10 | - */ - intMax10: number; -} - export interface EventObjectTypesProperties { /** * Property Object Type */ - requiredObject: { - [k: string]: any; - }; + requiredObject: any; /** * Property Object Array Type */ @@ -159,6 +145,14 @@ export interface EventWithArrayTypesProperties { * | Item Type | boolean | */ requiredBooleanArray: boolean[]; + /** + * Description for enum array property + * + * | Rule | Value | + * |---|---| + * | Item Type | string | + */ + requiredEnumArray: ("enum1" | "enum2")[]; /** * Description for required number array * @@ -181,57 +175,6 @@ export interface EventWithArrayTypesProperties { requiredStringArray: string[]; } -export interface EventWithDifferentCasingTypesProperties { - /** - * descriptionForEnumCamelCase - * - * | Rule | Value | - * |---|---| - * | Enum Values | enumCamelCase | - */ - enumCamelCase: "enumCamelCase"; - /** - * DescirptionForEnumPascalCase - * - * | Rule | Value | - * |---|---| - * | Enum Values | EnumPascalCase | - */ - EnumPascalCase: "EnumPascalCase"; - /** - * description_for_enum_snake_case - * - * | Rule | Value | - * |---|---| - * | Enum Values | enum_snake_case | - */ - enum_snake_case: "enum_snake_case"; - /** - * Description for enum with space - * - * | Rule | Value | - * |---|---| - * | Enum Values | enum with space | - */ - "enum with space": "enum with space"; - /** - * descriptionForCamelCase - */ - propertyWithCamelCase: string; - /** - * DescriptionForPascalCase - */ - PropertyWithPascalCase: string; - /** - * Description_for_snake_case - */ - property_with_snake_case: string; - /** - * Description for case with space - */ - "property with space": string; -} - export interface EventWithEnumTypesProperties { /** * Description for required enum @@ -260,6 +203,14 @@ export interface EventWithOptionalArrayTypesProperties { * | Item Type | boolean | */ optionalBooleanArray?: boolean[]; + /** + * Description for optional enum array + * + * | Rule | Value | + * |---|---| + * | Item Type | string | + */ + optionalEnumArray?: ("enum1" | "enum2")[]; /** * Description for optional object array */ @@ -335,6 +286,69 @@ export interface EventWithTemplatePropertiesProperties { required_template_property: string; } +export interface EventWithDifferentCasingTypesProperties { + /** + * Description for enum with space + * + * | Rule | Value | + * |---|---| + * | Enum Values | enum with space | + */ + "enum with space": "enum with space"; + /** + * description_for_enum_snake_case + * + * | Rule | Value | + * |---|---| + * | Enum Values | enum_snake_case | + */ + enum_snake_case: "enum_snake_case"; + /** + * descriptionForEnumCamelCase + * + * | Rule | Value | + * |---|---| + * | Enum Values | enumCamelCase | + */ + enumCamelCase: "enumCamelCase"; + /** + * DescirptionForEnumPascalCase + * + * | Rule | Value | + * |---|---| + * | Enum Values | EnumPascalCase | + */ + EnumPascalCase: "EnumPascalCase"; + /** + * Description for case with space + */ + "property with space": string; + /** + * Description_for_snake_case + */ + property_with_snake_case: string; + /** + * descriptionForCamelCase + */ + propertyWithCamelCase: string; + /** + * DescriptionForPascalCase + */ + PropertyWithPascalCase: string; +} + +export interface EventMaxIntForTestProperties { + /** + * property to test schema validation + * + * | Rule | Value | + * |---|---| + * | Type | integer | + * | Max Value | 10 | + */ + intMax10: number; +} + export interface EventTemplateProperties { /** * optional_template_property description @@ -375,16 +389,6 @@ export class Identify implements BaseEvent { } } -export class EventMaxIntForTest implements BaseEvent { - event_type = 'EventMaxIntForTest'; - - constructor( - public event_properties: EventMaxIntForTestProperties, - ) { - this.event_properties = event_properties; - } -} - export class EventNoProperties implements BaseEvent { event_type = 'Event No Properties'; } @@ -437,16 +441,6 @@ export class EventWithConstTypes implements BaseEvent { }; } -export class EventWithDifferentCasingTypes implements BaseEvent { - event_type = 'event withDifferent_CasingTypes'; - - constructor( - public event_properties: EventWithDifferentCasingTypesProperties, - ) { - this.event_properties = event_properties; - } -} - export class EventWithEnumTypes implements BaseEvent { event_type = 'Event With Enum Types'; @@ -487,6 +481,26 @@ export class EventWithTemplateProperties implements BaseEvent { } } +export class EventWithDifferentCasingTypes implements BaseEvent { + event_type = 'event withDifferent_CasingTypes'; + + constructor( + public event_properties: EventWithDifferentCasingTypesProperties, + ) { + this.event_properties = event_properties; + } +} + +export class EventMaxIntForTest implements BaseEvent { + event_type = 'EventMaxIntForTest'; + + constructor( + public event_properties: EventMaxIntForTestProperties, + ) { + this.event_properties = event_properties; + } +} + const getDefaultPromiseResponse = () => Promise.resolve({ status: Status.Skipped, statusCode: 200, @@ -589,29 +603,6 @@ export class Ampli { return { promise }; } - /** - * EventMaxIntForTest - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) - * - * Event to test schema validation - * - * Owner: Test codegen - * - * @param userId The user's ID. - * @param properties The event's properties (e.g. intMax10) - * @param options Amplitude event options. - * @param extra Extra untyped parameters for use in middleware. - */ - eventMaxIntForTest( - userId: string | undefined, - properties: EventMaxIntForTestProperties, - options?: EventOptions, - extra?: MiddlewareExtra, - ) { - return this.track(userId, new EventMaxIntForTest(properties), options, extra); - } - /** * Event No Properties * @@ -723,29 +714,6 @@ export class Ampli { return this.track(userId, new EventWithConstTypes(), options, extra); } - /** - * event withDifferent_CasingTypes - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) - * - * Description for case with space - * - * Owner: Test codegen - * - * @param userId The user's ID. - * @param properties The event's properties (e.g. enumCamelCase) - * @param options Amplitude event options. - * @param extra Extra untyped parameters for use in middleware. - */ - eventWithDifferentCasingTypes( - userId: string | undefined, - properties: EventWithDifferentCasingTypesProperties, - options?: EventOptions, - extra?: MiddlewareExtra, - ) { - return this.track(userId, new EventWithDifferentCasingTypes(properties), options, extra); - } - /** * Event With Enum Types * @@ -837,6 +805,52 @@ export class Ampli { ) { return this.track(userId, new EventWithTemplateProperties(properties), options, extra); } + + /** + * event withDifferent_CasingTypes + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) + * + * Description for case with space + * + * Owner: Test codegen + * + * @param userId The user's ID. + * @param properties The event's properties (e.g. enum with space) + * @param options Amplitude event options. + * @param extra Extra untyped parameters for use in middleware. + */ + eventWithDifferentCasingTypes( + userId: string | undefined, + properties: EventWithDifferentCasingTypesProperties, + options?: EventOptions, + extra?: MiddlewareExtra, + ) { + return this.track(userId, new EventWithDifferentCasingTypes(properties), options, extra); + } + + /** + * EventMaxIntForTest + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) + * + * Event to test schema validation + * + * Owner: Test codegen + * + * @param userId The user's ID. + * @param properties The event's properties (e.g. intMax10) + * @param options Amplitude event options. + * @param extra Extra untyped parameters for use in middleware. + */ + eventMaxIntForTest( + userId: string | undefined, + properties: EventMaxIntForTestProperties, + options?: EventOptions, + extra?: MiddlewareExtra, + ) { + return this.track(userId, new EventMaxIntForTest(properties), options, extra); + } } /** diff --git a/node/typescript/v1/AmpliApp/src/app.ts b/node/typescript/v1/AmpliApp/src/app.ts index b0a8e3fd..459d4293 100644 --- a/node/typescript/v1/AmpliApp/src/app.ts +++ b/node/typescript/v1/AmpliApp/src/app.ts @@ -159,6 +159,7 @@ ampli.eventObjectTypes(userId, { ampli.eventWithArrayTypes(userId, { requiredBooleanArray: [true, false], + requiredEnumArray: ['enum1'], requiredNumberArray: [1.2, 3, 4.56], requiredObjectArray: [{ 'key-1': 'value-1' }, { 'key-2': 'value-2' }], requiredStringArray: ['string-1', 'string-2', 'string-3'], diff --git a/node/typescript/v2/AmpliApp/src/ampli/index.ts b/node/typescript/v2/AmpliApp/src/ampli/index.ts index 50bc2174..592b8770 100644 --- a/node/typescript/v2/AmpliApp/src/ampli/index.ts +++ b/node/typescript/v2/AmpliApp/src/ampli/index.ts @@ -7,7 +7,7 @@ * To update run 'ampli pull node-ts-ampli-v2' * * Required dependencies: @amplitude/analytics-node@^1.0.0 - * Tracking Plan Version: 0 + * Tracking Plan Version: 1 * Build: 1.0.0 * Runtime: node.js:typescript-ampli-v2 * @@ -37,7 +37,7 @@ export const ApiKey: Record = { */ export const DefaultConfiguration: NodeOptions = { plan: { - version: '0', + version: '1', branch: 'main', source: 'node-ts-ampli-v2', versionId: 'a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c' diff --git a/python/django/v1/ampli_app/ampli.json b/python/django/v1/ampli_app/ampli.json index cc2c701a..36935b59 100644 --- a/python/django/v1/ampli_app/ampli.json +++ b/python/django/v1/ampli_app/ampli.json @@ -5,8 +5,11 @@ "SourceId": "e7eb7d27-8ab4-4e8c-8595-f580be2fb69a", "Runtime": "python:python-ampli", "Branch": "main", - "Version": "0.0.0", - "VersionId": "79154a50-f057-4db5-9755-775e4e9f05e6", + "Version": "1.0.0", + "VersionId": "a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c", "Path": "./ampli", - "OmitApiKeys": true + "OmitApiKeys": true, + "Platform": "Python", + "Language": "Python", + "SDK": "amplitude-analytics >= 1.0" } \ No newline at end of file diff --git a/python/django/v1/ampli_app/ampli/__init__.py b/python/django/v1/ampli_app/ampli/__init__.py index 4e48f163..e7cde42e 100644 --- a/python/django/v1/ampli_app/ampli/__init__.py +++ b/python/django/v1/ampli_app/ampli/__init__.py @@ -5,8 +5,8 @@ # This file is generated by Amplitude. # To update run 'ampli pull python-ampli' # -# Required dependencies: amplitude-analytics -# Tracking Plan Version: 0 +# Required dependencies: amplitude-analytics >=1.0.0,==1.* +# Tracking Plan Version: 1 # Build: 1.0.0 # Runtime: python-ampli # @@ -23,15 +23,15 @@ from amplitude import Amplitude, BaseEvent, EventOptions, Revenue, IdentifyEvent, \ GroupIdentifyEvent, RevenueEvent, Plan, Config, PluginType, EventPlugin, DestinationPlugin from .ampli import Ampli, LoadOptions, LoadClientOptions, Environment, ampli, \ - EventMaxIntForTest, \ EventNoProperties, \ EventObjectTypes, \ EventWithAllProperties, \ EventWithArrayTypes, \ EventWithConstTypes, \ - EventWithDifferentCasingTypes, \ EventWithEnumTypes, \ EventWithOptionalArrayTypes, \ EventWithOptionalProperties, \ EventWithTemplateProperties, \ + EventWithDifferentCasingTypes, \ + EventMaxIntForTest, \ Identify diff --git a/python/django/v1/ampli_app/ampli/ampli.py b/python/django/v1/ampli_app/ampli/ampli.py index aab313b5..c675d4d7 100644 --- a/python/django/v1/ampli_app/ampli/ampli.py +++ b/python/django/v1/ampli_app/ampli/ampli.py @@ -5,8 +5,8 @@ # This file is generated by Amplitude. # To update run 'ampli pull python-ampli' # -# Required dependencies: amplitude-analytics -# Tracking Plan Version: 0 +# Required dependencies: amplitude-analytics >=1.0.0,==1.* +# Tracking Plan Version: 1 # Build: 1.0.0 # Runtime: python-ampli # @@ -28,21 +28,21 @@ class Environment(enum.Enum): - DEV = 'dev' PROD = 'prod' + DEV = 'dev' API_KEY: Dict[Environment, str] = { - Environment("dev"): "", - Environment("prod"): "" + Environment("prod"): "", + Environment("dev"): "" } DEFAULT_CONFIGURATION = Config( plan=Plan( branch="main", source="python-ampli", - version="0", - version_id="79154a50-f057-4db5-9755-775e4e9f05e6" + version="1", + version_id="a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c" ) ) @@ -96,32 +96,11 @@ def __init__( optional_array: Optional[List[str]] = None ): super().__init__() - self.user_properties = { + properties = { "optionalArray": optional_array, "requiredNumber": required_number } - - -class EventMaxIntForTest(BaseEvent): - """EventMaxIntForTest - - [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) - - Event to test schema validation - - Owner: Test codegen - - :param int_max_10: property to test schema validation - """ - - def __init__( - self, - int_max_10: int - ): - super().__init__(event_type="EventMaxIntForTest") - self.event_properties = { - "intMax10": int_max_10 - } + self.user_properties = {k: v for k, v in properties.items() if v is not None} class EventNoProperties(BaseEvent): @@ -159,10 +138,11 @@ def __init__( required_object_array: List[Any] ): super().__init__(event_type="Event Object Types") - self.event_properties = { + properties = { "requiredObject": required_object, "requiredObjectArray": required_object_array } + self.event_properties = {k: v for k, v in properties.items() if v is not None} class EventWithAllProperties(BaseEvent): @@ -198,7 +178,7 @@ def __init__( optional_string: Optional[str] = None ): super().__init__(event_type="Event With All Properties") - self.event_properties = { + properties = { "optionalString": optional_string, "requiredArray": required_array, "requiredBoolean": required_boolean, @@ -208,6 +188,7 @@ def __init__( "requiredNumber": required_number, "requiredString": required_string } + self.event_properties = {k: v for k, v in properties.items() if v is not None} class EventWithArrayTypes(BaseEvent): @@ -220,6 +201,7 @@ class EventWithArrayTypes(BaseEvent): Owner: Test codegen :param required_boolean_array: description for required boolean array + :param required_enum_array: Description for enum array property :param required_number_array: Description for required number array :param required_object_array: Description for required object array :param required_string_array: description for required string array @@ -228,17 +210,20 @@ class EventWithArrayTypes(BaseEvent): def __init__( self, required_boolean_array: List[bool], + required_enum_array: List[str], required_number_array: List[float], required_object_array: List[Any], required_string_array: List[str] ): super().__init__(event_type="Event With Array Types") - self.event_properties = { + properties = { "requiredBooleanArray": required_boolean_array, + "requiredEnumArray": required_enum_array, "requiredNumberArray": required_number_array, "requiredObjectArray": required_object_array, "requiredStringArray": required_string_array } + self.event_properties = {k: v for k, v in properties.items() if v is not None} class EventWithConstTypes(BaseEvent): @@ -255,7 +240,7 @@ def __init__( self ): super().__init__(event_type="Event With Const Types") - self.event_properties = { + properties = { "Boolean Const": True, "Integer Const": 10, "Number Const": 2.2, @@ -263,61 +248,7 @@ def __init__( "String Const WIth Quotes": "\"String \"Const With\" Quotes\"", "String Int Const": 0 } - - -class EventWithDifferentCasingTypes(BaseEvent): - """event withDifferent_CasingTypes - - [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) - - Description for case with space - - Owner: Test codegen - - :param enum_camel_case: descriptionForEnumCamelCase - :param enum_pascal_case: DescirptionForEnumPascalCase - :param enum_snake_case: description_for_enum_snake_case - :param enum_with_space: Description for enum with space - :param property_with_camel_case: descriptionForCamelCase - :param property_with_pascal_case: DescriptionForPascalCase - :param property_with_snake_case: Description_for_snake_case - :param property_with_space: Description for case with space - """ - - class EnumCamelCase(enum.Enum): - ENUM_CAMEL_CASE = "enumCamelCase" - - class EnumPascalCase(enum.Enum): - ENUM_PASCAL_CASE = "EnumPascalCase" - - class EnumSnakeCase(enum.Enum): - ENUM_SNAKE_CASE = "enum_snake_case" - - class EnumWithSpace(enum.Enum): - ENUM_WITH_SPACE = "enum with space" - - def __init__( - self, - enum_camel_case: "EventWithDifferentCasingTypes.EnumCamelCase", - enum_pascal_case: "EventWithDifferentCasingTypes.EnumPascalCase", - enum_snake_case: "EventWithDifferentCasingTypes.EnumSnakeCase", - enum_with_space: "EventWithDifferentCasingTypes.EnumWithSpace", - property_with_camel_case: str, - property_with_pascal_case: str, - property_with_snake_case: str, - property_with_space: str - ): - super().__init__(event_type="event withDifferent_CasingTypes") - self.event_properties = { - "enumCamelCase": enum_camel_case, - "EnumPascalCase": enum_pascal_case, - "enum_snake_case": enum_snake_case, - "enum with space": enum_with_space, - "propertyWithCamelCase": property_with_camel_case, - "PropertyWithPascalCase": property_with_pascal_case, - "property_with_snake_case": property_with_snake_case, - "property with space": property_with_space - } + self.event_properties = {k: v for k, v in properties.items() if v is not None} class EventWithEnumTypes(BaseEvent): @@ -347,10 +278,11 @@ def __init__( optional_enum: Optional["EventWithEnumTypes.OptionalEnum"] = None ): super().__init__(event_type="Event With Enum Types") - self.event_properties = { + properties = { "optional enum": optional_enum, "required enum": required_enum } + self.event_properties = {k: v for k, v in properties.items() if v is not None} class EventWithOptionalArrayTypes(BaseEvent): @@ -363,6 +295,7 @@ class EventWithOptionalArrayTypes(BaseEvent): Owner: Test codegen :param optional_boolean_array: Description for optional boolean array + :param optional_enum_array: Description for optional enum array :param optional_json_array: Description for optional object array :param optional_number_array: Description for optional number array :param optional_string_array: Description for optional string array @@ -371,17 +304,20 @@ class EventWithOptionalArrayTypes(BaseEvent): def __init__( self, optional_boolean_array: Optional[List[bool]] = None, + optional_enum_array: Optional[List[str]] = None, optional_json_array: Optional[List[Any]] = None, optional_number_array: Optional[List[float]] = None, optional_string_array: Optional[List[str]] = None ): super().__init__(event_type="Event With Optional Array Types") - self.event_properties = { + properties = { "optionalBooleanArray": optional_boolean_array, + "optionalEnumArray": optional_enum_array, "optionalJSONArray": optional_json_array, "optionalNumberArray": optional_number_array, "optionalStringArray": optional_string_array } + self.event_properties = {k: v for k, v in properties.items() if v is not None} class EventWithOptionalProperties(BaseEvent): @@ -409,13 +345,14 @@ def __init__( optional_string: Optional[str] = None ): super().__init__(event_type="Event With Optional Properties") - self.event_properties = { + properties = { "optionalArrayNumber": optional_array_number, "optionalArrayString": optional_array_string, "optionalBoolean": optional_boolean, "optionalNumber": optional_number, "optionalString": optional_string } + self.event_properties = {k: v for k, v in properties.items() if v is not None} class EventWithTemplateProperties(BaseEvent): @@ -441,12 +378,92 @@ def __init__( optional_template_property: Optional[float] = None ): super().__init__(event_type="Event With Template Properties") - self.event_properties = { + properties = { "optional_event_property": optional_event_property, "optional_template_property": optional_template_property, "required_event_property": required_event_property, "required_template_property": required_template_property } + self.event_properties = {k: v for k, v in properties.items() if v is not None} + + +class EventWithDifferentCasingTypes(BaseEvent): + """event withDifferent_CasingTypes + + [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) + + Description for case with space + + Owner: Test codegen + + :param enum_with_space: Description for enum with space + :param enum_snake_case: description_for_enum_snake_case + :param enum_camel_case: descriptionForEnumCamelCase + :param enum_pascal_case: DescirptionForEnumPascalCase + :param property_with_space: Description for case with space + :param property_with_snake_case: Description_for_snake_case + :param property_with_camel_case: descriptionForCamelCase + :param property_with_pascal_case: DescriptionForPascalCase + """ + + class EnumWithSpace(enum.Enum): + ENUM_WITH_SPACE = "enum with space" + + class EnumSnakeCase(enum.Enum): + ENUM_SNAKE_CASE = "enum_snake_case" + + class EnumCamelCase(enum.Enum): + ENUM_CAMEL_CASE = "enumCamelCase" + + class EnumPascalCase(enum.Enum): + ENUM_PASCAL_CASE = "EnumPascalCase" + + def __init__( + self, + enum_with_space: "EventWithDifferentCasingTypes.EnumWithSpace", + enum_snake_case: "EventWithDifferentCasingTypes.EnumSnakeCase", + enum_camel_case: "EventWithDifferentCasingTypes.EnumCamelCase", + enum_pascal_case: "EventWithDifferentCasingTypes.EnumPascalCase", + property_with_space: str, + property_with_snake_case: str, + property_with_camel_case: str, + property_with_pascal_case: str + ): + super().__init__(event_type="event withDifferent_CasingTypes") + properties = { + "enum with space": enum_with_space, + "enum_snake_case": enum_snake_case, + "enumCamelCase": enum_camel_case, + "EnumPascalCase": enum_pascal_case, + "property with space": property_with_space, + "property_with_snake_case": property_with_snake_case, + "propertyWithCamelCase": property_with_camel_case, + "PropertyWithPascalCase": property_with_pascal_case + } + self.event_properties = {k: v for k, v in properties.items() if v is not None} + + +class EventMaxIntForTest(BaseEvent): + """EventMaxIntForTest + + [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) + + Event to test schema validation + + Owner: Test codegen + + :param int_max_10: property to test schema validation + """ + + def __init__( + self, + int_max_10: int + ): + super().__init__(event_type="EventMaxIntForTest") + properties = { + "intMax10": int_max_10 + } + self.event_properties = {k: v for k, v in properties.items() if v is not None} class Ampli: @@ -546,26 +563,6 @@ def shutdown(self): self.client.shutdown() self.disabled = True - def event_max_int_for_test( - self, - user_id: Optional[str], - event: EventMaxIntForTest, - event_options: Optional[EventOptions] = None - ): - """Track event 'EventMaxIntForTest' - - [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/Track%20event%20'EventMaxIntForTest') - - Event to test schema validation - - Owner: Test codegen - - :param user_id: The user's ID. - :param event: The event to track. - :param event_options: Extra optional event attributes options. - """ - self.track(user_id, event, event_options) - def event_no_properties( self, user_id: Optional[str], @@ -662,26 +659,6 @@ def event_with_const_types( """ self.track(user_id, EventWithConstTypes(), event_options) - def event_with_different_casing_types( - self, - user_id: Optional[str], - event: EventWithDifferentCasingTypes, - event_options: Optional[EventOptions] = None - ): - """Track event 'event withDifferent_CasingTypes' - - [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/Track%20event%20'event%20withDifferent_CasingTypes') - - Description for case with space - - Owner: Test codegen - - :param user_id: The user's ID. - :param event: The event to track. - :param event_options: Extra optional event attributes options. - """ - self.track(user_id, event, event_options) - def event_with_enum_types( self, user_id: Optional[str], @@ -762,5 +739,45 @@ def event_with_template_properties( """ self.track(user_id, event, event_options) + def event_with_different_casing_types( + self, + user_id: Optional[str], + event: EventWithDifferentCasingTypes, + event_options: Optional[EventOptions] = None + ): + """Track event 'event withDifferent_CasingTypes' + + [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/Track%20event%20'event%20withDifferent_CasingTypes') + + Description for case with space + + Owner: Test codegen + + :param user_id: The user's ID. + :param event: The event to track. + :param event_options: Extra optional event attributes options. + """ + self.track(user_id, event, event_options) + + def event_max_int_for_test( + self, + user_id: Optional[str], + event: EventMaxIntForTest, + event_options: Optional[EventOptions] = None + ): + """Track event 'EventMaxIntForTest' + + [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/Track%20event%20'EventMaxIntForTest') + + Event to test schema validation + + Owner: Test codegen + + :param user_id: The user's ID. + :param event: The event to track. + :param event_options: Extra optional event attributes options. + """ + self.track(user_id, event, event_options) + ampli = Ampli() diff --git a/python/django/v1/ampli_app/ampli/requirements.txt b/python/django/v1/ampli_app/ampli/requirements.txt index 3730a2e9..381e5d6f 100644 --- a/python/django/v1/ampli_app/ampli/requirements.txt +++ b/python/django/v1/ampli_app/ampli/requirements.txt @@ -5,8 +5,8 @@ # This file is generated by Amplitude. # To update run 'ampli pull python-ampli' # -# Required dependencies: amplitude-analytics -# Tracking Plan Version: 0 +# Required dependencies: amplitude-analytics >=1.0.0,==1.* +# Tracking Plan Version: 1 # Build: 1.0.0 # Runtime: python-ampli # @@ -23,4 +23,4 @@ # (not inside this directory) # Add '-r ampli/requirements.txt' to your ~/my/project/requirements.txt -amplitude-analytics +amplitude-analytics >=1.0.0,==1.* diff --git a/python/simple/v1/ampli.json b/python/simple/v1/ampli.json index cc2c701a..36935b59 100644 --- a/python/simple/v1/ampli.json +++ b/python/simple/v1/ampli.json @@ -5,8 +5,11 @@ "SourceId": "e7eb7d27-8ab4-4e8c-8595-f580be2fb69a", "Runtime": "python:python-ampli", "Branch": "main", - "Version": "0.0.0", - "VersionId": "79154a50-f057-4db5-9755-775e4e9f05e6", + "Version": "1.0.0", + "VersionId": "a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c", "Path": "./ampli", - "OmitApiKeys": true + "OmitApiKeys": true, + "Platform": "Python", + "Language": "Python", + "SDK": "amplitude-analytics >= 1.0" } \ No newline at end of file diff --git a/python/simple/v1/ampli/__init__.py b/python/simple/v1/ampli/__init__.py index 4e48f163..e7cde42e 100644 --- a/python/simple/v1/ampli/__init__.py +++ b/python/simple/v1/ampli/__init__.py @@ -5,8 +5,8 @@ # This file is generated by Amplitude. # To update run 'ampli pull python-ampli' # -# Required dependencies: amplitude-analytics -# Tracking Plan Version: 0 +# Required dependencies: amplitude-analytics >=1.0.0,==1.* +# Tracking Plan Version: 1 # Build: 1.0.0 # Runtime: python-ampli # @@ -23,15 +23,15 @@ from amplitude import Amplitude, BaseEvent, EventOptions, Revenue, IdentifyEvent, \ GroupIdentifyEvent, RevenueEvent, Plan, Config, PluginType, EventPlugin, DestinationPlugin from .ampli import Ampli, LoadOptions, LoadClientOptions, Environment, ampli, \ - EventMaxIntForTest, \ EventNoProperties, \ EventObjectTypes, \ EventWithAllProperties, \ EventWithArrayTypes, \ EventWithConstTypes, \ - EventWithDifferentCasingTypes, \ EventWithEnumTypes, \ EventWithOptionalArrayTypes, \ EventWithOptionalProperties, \ EventWithTemplateProperties, \ + EventWithDifferentCasingTypes, \ + EventMaxIntForTest, \ Identify diff --git a/python/simple/v1/ampli/ampli.py b/python/simple/v1/ampli/ampli.py index aab313b5..c675d4d7 100644 --- a/python/simple/v1/ampli/ampli.py +++ b/python/simple/v1/ampli/ampli.py @@ -5,8 +5,8 @@ # This file is generated by Amplitude. # To update run 'ampli pull python-ampli' # -# Required dependencies: amplitude-analytics -# Tracking Plan Version: 0 +# Required dependencies: amplitude-analytics >=1.0.0,==1.* +# Tracking Plan Version: 1 # Build: 1.0.0 # Runtime: python-ampli # @@ -28,21 +28,21 @@ class Environment(enum.Enum): - DEV = 'dev' PROD = 'prod' + DEV = 'dev' API_KEY: Dict[Environment, str] = { - Environment("dev"): "", - Environment("prod"): "" + Environment("prod"): "", + Environment("dev"): "" } DEFAULT_CONFIGURATION = Config( plan=Plan( branch="main", source="python-ampli", - version="0", - version_id="79154a50-f057-4db5-9755-775e4e9f05e6" + version="1", + version_id="a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c" ) ) @@ -96,32 +96,11 @@ def __init__( optional_array: Optional[List[str]] = None ): super().__init__() - self.user_properties = { + properties = { "optionalArray": optional_array, "requiredNumber": required_number } - - -class EventMaxIntForTest(BaseEvent): - """EventMaxIntForTest - - [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) - - Event to test schema validation - - Owner: Test codegen - - :param int_max_10: property to test schema validation - """ - - def __init__( - self, - int_max_10: int - ): - super().__init__(event_type="EventMaxIntForTest") - self.event_properties = { - "intMax10": int_max_10 - } + self.user_properties = {k: v for k, v in properties.items() if v is not None} class EventNoProperties(BaseEvent): @@ -159,10 +138,11 @@ def __init__( required_object_array: List[Any] ): super().__init__(event_type="Event Object Types") - self.event_properties = { + properties = { "requiredObject": required_object, "requiredObjectArray": required_object_array } + self.event_properties = {k: v for k, v in properties.items() if v is not None} class EventWithAllProperties(BaseEvent): @@ -198,7 +178,7 @@ def __init__( optional_string: Optional[str] = None ): super().__init__(event_type="Event With All Properties") - self.event_properties = { + properties = { "optionalString": optional_string, "requiredArray": required_array, "requiredBoolean": required_boolean, @@ -208,6 +188,7 @@ def __init__( "requiredNumber": required_number, "requiredString": required_string } + self.event_properties = {k: v for k, v in properties.items() if v is not None} class EventWithArrayTypes(BaseEvent): @@ -220,6 +201,7 @@ class EventWithArrayTypes(BaseEvent): Owner: Test codegen :param required_boolean_array: description for required boolean array + :param required_enum_array: Description for enum array property :param required_number_array: Description for required number array :param required_object_array: Description for required object array :param required_string_array: description for required string array @@ -228,17 +210,20 @@ class EventWithArrayTypes(BaseEvent): def __init__( self, required_boolean_array: List[bool], + required_enum_array: List[str], required_number_array: List[float], required_object_array: List[Any], required_string_array: List[str] ): super().__init__(event_type="Event With Array Types") - self.event_properties = { + properties = { "requiredBooleanArray": required_boolean_array, + "requiredEnumArray": required_enum_array, "requiredNumberArray": required_number_array, "requiredObjectArray": required_object_array, "requiredStringArray": required_string_array } + self.event_properties = {k: v for k, v in properties.items() if v is not None} class EventWithConstTypes(BaseEvent): @@ -255,7 +240,7 @@ def __init__( self ): super().__init__(event_type="Event With Const Types") - self.event_properties = { + properties = { "Boolean Const": True, "Integer Const": 10, "Number Const": 2.2, @@ -263,61 +248,7 @@ def __init__( "String Const WIth Quotes": "\"String \"Const With\" Quotes\"", "String Int Const": 0 } - - -class EventWithDifferentCasingTypes(BaseEvent): - """event withDifferent_CasingTypes - - [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) - - Description for case with space - - Owner: Test codegen - - :param enum_camel_case: descriptionForEnumCamelCase - :param enum_pascal_case: DescirptionForEnumPascalCase - :param enum_snake_case: description_for_enum_snake_case - :param enum_with_space: Description for enum with space - :param property_with_camel_case: descriptionForCamelCase - :param property_with_pascal_case: DescriptionForPascalCase - :param property_with_snake_case: Description_for_snake_case - :param property_with_space: Description for case with space - """ - - class EnumCamelCase(enum.Enum): - ENUM_CAMEL_CASE = "enumCamelCase" - - class EnumPascalCase(enum.Enum): - ENUM_PASCAL_CASE = "EnumPascalCase" - - class EnumSnakeCase(enum.Enum): - ENUM_SNAKE_CASE = "enum_snake_case" - - class EnumWithSpace(enum.Enum): - ENUM_WITH_SPACE = "enum with space" - - def __init__( - self, - enum_camel_case: "EventWithDifferentCasingTypes.EnumCamelCase", - enum_pascal_case: "EventWithDifferentCasingTypes.EnumPascalCase", - enum_snake_case: "EventWithDifferentCasingTypes.EnumSnakeCase", - enum_with_space: "EventWithDifferentCasingTypes.EnumWithSpace", - property_with_camel_case: str, - property_with_pascal_case: str, - property_with_snake_case: str, - property_with_space: str - ): - super().__init__(event_type="event withDifferent_CasingTypes") - self.event_properties = { - "enumCamelCase": enum_camel_case, - "EnumPascalCase": enum_pascal_case, - "enum_snake_case": enum_snake_case, - "enum with space": enum_with_space, - "propertyWithCamelCase": property_with_camel_case, - "PropertyWithPascalCase": property_with_pascal_case, - "property_with_snake_case": property_with_snake_case, - "property with space": property_with_space - } + self.event_properties = {k: v for k, v in properties.items() if v is not None} class EventWithEnumTypes(BaseEvent): @@ -347,10 +278,11 @@ def __init__( optional_enum: Optional["EventWithEnumTypes.OptionalEnum"] = None ): super().__init__(event_type="Event With Enum Types") - self.event_properties = { + properties = { "optional enum": optional_enum, "required enum": required_enum } + self.event_properties = {k: v for k, v in properties.items() if v is not None} class EventWithOptionalArrayTypes(BaseEvent): @@ -363,6 +295,7 @@ class EventWithOptionalArrayTypes(BaseEvent): Owner: Test codegen :param optional_boolean_array: Description for optional boolean array + :param optional_enum_array: Description for optional enum array :param optional_json_array: Description for optional object array :param optional_number_array: Description for optional number array :param optional_string_array: Description for optional string array @@ -371,17 +304,20 @@ class EventWithOptionalArrayTypes(BaseEvent): def __init__( self, optional_boolean_array: Optional[List[bool]] = None, + optional_enum_array: Optional[List[str]] = None, optional_json_array: Optional[List[Any]] = None, optional_number_array: Optional[List[float]] = None, optional_string_array: Optional[List[str]] = None ): super().__init__(event_type="Event With Optional Array Types") - self.event_properties = { + properties = { "optionalBooleanArray": optional_boolean_array, + "optionalEnumArray": optional_enum_array, "optionalJSONArray": optional_json_array, "optionalNumberArray": optional_number_array, "optionalStringArray": optional_string_array } + self.event_properties = {k: v for k, v in properties.items() if v is not None} class EventWithOptionalProperties(BaseEvent): @@ -409,13 +345,14 @@ def __init__( optional_string: Optional[str] = None ): super().__init__(event_type="Event With Optional Properties") - self.event_properties = { + properties = { "optionalArrayNumber": optional_array_number, "optionalArrayString": optional_array_string, "optionalBoolean": optional_boolean, "optionalNumber": optional_number, "optionalString": optional_string } + self.event_properties = {k: v for k, v in properties.items() if v is not None} class EventWithTemplateProperties(BaseEvent): @@ -441,12 +378,92 @@ def __init__( optional_template_property: Optional[float] = None ): super().__init__(event_type="Event With Template Properties") - self.event_properties = { + properties = { "optional_event_property": optional_event_property, "optional_template_property": optional_template_property, "required_event_property": required_event_property, "required_template_property": required_template_property } + self.event_properties = {k: v for k, v in properties.items() if v is not None} + + +class EventWithDifferentCasingTypes(BaseEvent): + """event withDifferent_CasingTypes + + [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) + + Description for case with space + + Owner: Test codegen + + :param enum_with_space: Description for enum with space + :param enum_snake_case: description_for_enum_snake_case + :param enum_camel_case: descriptionForEnumCamelCase + :param enum_pascal_case: DescirptionForEnumPascalCase + :param property_with_space: Description for case with space + :param property_with_snake_case: Description_for_snake_case + :param property_with_camel_case: descriptionForCamelCase + :param property_with_pascal_case: DescriptionForPascalCase + """ + + class EnumWithSpace(enum.Enum): + ENUM_WITH_SPACE = "enum with space" + + class EnumSnakeCase(enum.Enum): + ENUM_SNAKE_CASE = "enum_snake_case" + + class EnumCamelCase(enum.Enum): + ENUM_CAMEL_CASE = "enumCamelCase" + + class EnumPascalCase(enum.Enum): + ENUM_PASCAL_CASE = "EnumPascalCase" + + def __init__( + self, + enum_with_space: "EventWithDifferentCasingTypes.EnumWithSpace", + enum_snake_case: "EventWithDifferentCasingTypes.EnumSnakeCase", + enum_camel_case: "EventWithDifferentCasingTypes.EnumCamelCase", + enum_pascal_case: "EventWithDifferentCasingTypes.EnumPascalCase", + property_with_space: str, + property_with_snake_case: str, + property_with_camel_case: str, + property_with_pascal_case: str + ): + super().__init__(event_type="event withDifferent_CasingTypes") + properties = { + "enum with space": enum_with_space, + "enum_snake_case": enum_snake_case, + "enumCamelCase": enum_camel_case, + "EnumPascalCase": enum_pascal_case, + "property with space": property_with_space, + "property_with_snake_case": property_with_snake_case, + "propertyWithCamelCase": property_with_camel_case, + "PropertyWithPascalCase": property_with_pascal_case + } + self.event_properties = {k: v for k, v in properties.items() if v is not None} + + +class EventMaxIntForTest(BaseEvent): + """EventMaxIntForTest + + [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) + + Event to test schema validation + + Owner: Test codegen + + :param int_max_10: property to test schema validation + """ + + def __init__( + self, + int_max_10: int + ): + super().__init__(event_type="EventMaxIntForTest") + properties = { + "intMax10": int_max_10 + } + self.event_properties = {k: v for k, v in properties.items() if v is not None} class Ampli: @@ -546,26 +563,6 @@ def shutdown(self): self.client.shutdown() self.disabled = True - def event_max_int_for_test( - self, - user_id: Optional[str], - event: EventMaxIntForTest, - event_options: Optional[EventOptions] = None - ): - """Track event 'EventMaxIntForTest' - - [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/Track%20event%20'EventMaxIntForTest') - - Event to test schema validation - - Owner: Test codegen - - :param user_id: The user's ID. - :param event: The event to track. - :param event_options: Extra optional event attributes options. - """ - self.track(user_id, event, event_options) - def event_no_properties( self, user_id: Optional[str], @@ -662,26 +659,6 @@ def event_with_const_types( """ self.track(user_id, EventWithConstTypes(), event_options) - def event_with_different_casing_types( - self, - user_id: Optional[str], - event: EventWithDifferentCasingTypes, - event_options: Optional[EventOptions] = None - ): - """Track event 'event withDifferent_CasingTypes' - - [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/Track%20event%20'event%20withDifferent_CasingTypes') - - Description for case with space - - Owner: Test codegen - - :param user_id: The user's ID. - :param event: The event to track. - :param event_options: Extra optional event attributes options. - """ - self.track(user_id, event, event_options) - def event_with_enum_types( self, user_id: Optional[str], @@ -762,5 +739,45 @@ def event_with_template_properties( """ self.track(user_id, event, event_options) + def event_with_different_casing_types( + self, + user_id: Optional[str], + event: EventWithDifferentCasingTypes, + event_options: Optional[EventOptions] = None + ): + """Track event 'event withDifferent_CasingTypes' + + [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/Track%20event%20'event%20withDifferent_CasingTypes') + + Description for case with space + + Owner: Test codegen + + :param user_id: The user's ID. + :param event: The event to track. + :param event_options: Extra optional event attributes options. + """ + self.track(user_id, event, event_options) + + def event_max_int_for_test( + self, + user_id: Optional[str], + event: EventMaxIntForTest, + event_options: Optional[EventOptions] = None + ): + """Track event 'EventMaxIntForTest' + + [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/Track%20event%20'EventMaxIntForTest') + + Event to test schema validation + + Owner: Test codegen + + :param user_id: The user's ID. + :param event: The event to track. + :param event_options: Extra optional event attributes options. + """ + self.track(user_id, event, event_options) + ampli = Ampli() diff --git a/python/simple/v1/ampli/requirements.txt b/python/simple/v1/ampli/requirements.txt index 3730a2e9..381e5d6f 100644 --- a/python/simple/v1/ampli/requirements.txt +++ b/python/simple/v1/ampli/requirements.txt @@ -5,8 +5,8 @@ # This file is generated by Amplitude. # To update run 'ampli pull python-ampli' # -# Required dependencies: amplitude-analytics -# Tracking Plan Version: 0 +# Required dependencies: amplitude-analytics >=1.0.0,==1.* +# Tracking Plan Version: 1 # Build: 1.0.0 # Runtime: python-ampli # @@ -23,4 +23,4 @@ # (not inside this directory) # Add '-r ampli/requirements.txt' to your ~/my/project/requirements.txt -amplitude-analytics +amplitude-analytics >=1.0.0,==1.* diff --git a/python/simple/v1/app.py b/python/simple/v1/app.py index 8c848802..fb3551bf 100644 --- a/python/simple/v1/app.py +++ b/python/simple/v1/app.py @@ -68,6 +68,7 @@ "user_id", EventWithArrayTypes( required_boolean_array=[True, False], + required_enum_array=["enum1"], required_object_array=[{"k": "v"}], required_number_array=[1, 4, 6.6], required_string_array=["a", "b"] diff --git a/react-native/javascript/v1/AmpliApp/ampli.json b/react-native/javascript/v1/AmpliApp/ampli.json index 9b1ab257..3e6a8643 100644 --- a/react-native/javascript/v1/AmpliApp/ampli.json +++ b/react-native/javascript/v1/AmpliApp/ampli.json @@ -5,7 +5,10 @@ "Runtime": "react-native:javascript-ampli", "Path": "./src/ampli", "Branch": "main", - "Version": "0.0.0", - "VersionId": "79154a50-f057-4db5-9755-775e4e9f05e6", - "OmitApiKeys": true + "Version": "1.0.0", + "VersionId": "a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c", + "OmitApiKeys": true, + "Platform": "React Native", + "Language": "JavaScript", + "SDK": "@amplitude/react-native@^2.0" } \ No newline at end of file diff --git a/react-native/javascript/v1/AmpliApp/src/App.js b/react-native/javascript/v1/AmpliApp/src/App.js index f2f3a74e..b9da7a61 100644 --- a/react-native/javascript/v1/AmpliApp/src/App.js +++ b/react-native/javascript/v1/AmpliApp/src/App.js @@ -179,6 +179,7 @@ function App() { ampli.eventWithArrayTypes({ requiredBooleanArray: [true, false], + requiredEnumArray: ['enum1'], requiredNumberArray: [1.2, 3, 4.56], requiredObjectArray: [{'key-1': 'value-1'}, {'key-2': 'value-2'}], requiredStringArray: ['string-1', 'string-2', 'string-3'], diff --git a/react-native/javascript/v1/AmpliApp/src/ampli/index.js b/react-native/javascript/v1/AmpliApp/src/ampli/index.js index 7b97ecfc..3fa66ae7 100644 --- a/react-native/javascript/v1/AmpliApp/src/ampli/index.js +++ b/react-native/javascript/v1/AmpliApp/src/ampli/index.js @@ -8,7 +8,7 @@ * To update run 'ampli pull react-native-javascript-ampli' * * Required dependencies: @amplitude/react-native@^2.15.0 - * Tracking Plan Version: 0 + * Tracking Plan Version: 1 * Build: 1.0.0 * Runtime: react-native:javascript-ampli * @@ -47,7 +47,7 @@ import { /** * @typedef LoadOptions * @type {object} - * @property {'development'|'production'} [environment] + * @property {'prod'|'dev'} [environment] * @property {boolean} [disabled] * @property {LoadClientOptions} [client] */ @@ -62,20 +62,20 @@ import { /** * @typedef ApiKey * @type {object} - * @property {string} development - * @property {string} production + * @property {string} prod + * @property {string} dev */ export const ApiKey = { - development: '', - production: '' + prod: '', + dev: '' }; export const DefaultOptions = { plan: { branch: 'main', source: 'react-native-javascript-ampli', - version: '0', - versionId: '79154a50-f057-4db5-9755-775e4e9f05e6', + version: '1', + versionId: 'a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c', }, ingestionMetadata: { sourceName: 'react-native-javascript-ampli', @@ -102,13 +102,6 @@ export class Identify { } } -export class EventMaxIntForTest { - constructor(properties) { - this.eventType = 'EventMaxIntForTest'; - this.eventProperties = properties; - } -} - export class EventNoProperties { constructor() { this.eventType = 'Event No Properties'; @@ -153,13 +146,6 @@ export class EventWithConstTypes { } } -export class EventWithDifferentCasingTypes { - constructor(properties) { - this.eventType = 'event withDifferent_CasingTypes'; - this.eventProperties = properties; - } -} - export class EventWithEnumTypes { constructor(properties) { this.eventType = 'Event With Enum Types'; @@ -188,6 +174,20 @@ export class EventWithTemplateProperties { } } +export class EventWithDifferentCasingTypes { + constructor(properties) { + this.eventType = 'event withDifferent_CasingTypes'; + this.eventProperties = properties; + } +} + +export class EventMaxIntForTest { + constructor(properties) { + this.eventType = 'EventMaxIntForTest'; + this.eventProperties = properties; + } +} + const getPromiseResponse = result => Promise.resolve(result); // prettier-ignore @@ -227,7 +227,7 @@ export class Ampli { /** * Initialize the Ampli SDK. Call once when your application starts. - * @param {LoadOptions} [options] Configuration options to initialize the Ampli SDK with. + * @param {LoadOptions} options Configuration options to initialize the Ampli SDK with. 'environment', 'client.apiKey' or 'client.instance' is required. */ load(options) { this.disabled = options?.disabled ?? false; @@ -329,26 +329,6 @@ export class Ampli { return { promise }; } - /** - * EventMaxIntForTest - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) - * - * Event to test schema validation - * - * Owner: Test codegen - * - * @param {Object} properties The event's properties. - * @param {number} properties.intMax10 property to test schema validation - * @param {EventOptions} [options] Options for this track call. - * @param {MiddlewareExtra} [extra] Extra untyped parameters for use in middleware. - * - * @return {{promise: Promise}} - */ - eventMaxIntForTest(properties, options, extra) { - return this.track(new EventMaxIntForTest(properties), options, extra); - } - /** * Event No Properties * @@ -425,6 +405,7 @@ export class Ampli { * * @param {Object} properties The event's properties. * @param {boolean[]} properties.requiredBooleanArray description for required boolean array + * @param {string[]} properties.requiredEnumArray Description for enum array property * @param {number[]} properties.requiredNumberArray Description for required number array * @param {*[]} properties.requiredObjectArray Description for required object array * @param {string[]} properties.requiredStringArray description for required string array @@ -455,33 +436,6 @@ export class Ampli { return this.track(new EventWithConstTypes(), options, extra); } - /** - * event withDifferent_CasingTypes - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) - * - * Description for case with space - * - * Owner: Test codegen - * - * @param {Object} properties The event's properties. - * @param {'enumCamelCase'} properties.enumCamelCase descriptionForEnumCamelCase - * @param {'EnumPascalCase'} properties.EnumPascalCase DescirptionForEnumPascalCase - * @param {'enum_snake_case'} properties.enum_snake_case description_for_enum_snake_case - * @param {'enum with space'} properties.enum with space Description for enum with space - * @param {string} properties.propertyWithCamelCase descriptionForCamelCase - * @param {string} properties.PropertyWithPascalCase DescriptionForPascalCase - * @param {string} properties.property_with_snake_case Description_for_snake_case - * @param {string} properties.property with space Description for case with space - * @param {EventOptions} [options] Options for this track call. - * @param {MiddlewareExtra} [extra] Extra untyped parameters for use in middleware. - * - * @return {{promise: Promise}} - */ - eventWithDifferentCasingTypes(properties, options, extra) { - return this.track(new EventWithDifferentCasingTypes(properties), options, extra); - } - /** * Event With Enum Types * @@ -514,6 +468,7 @@ export class Ampli { * * @param {Object} [properties] The event's properties. * @param {boolean[]} [properties.optionalBooleanArray] Description for optional boolean array + * @param {string[]} [properties.optionalEnumArray] Description for optional enum array * @param {*[]} [properties.optionalJSONArray] Description for optional object array * @param {number[]} [properties.optionalNumberArray] Description for optional number array * @param {string[]} [properties.optionalStringArray] Description for optional string array @@ -573,6 +528,53 @@ export class Ampli { return this.track(new EventWithTemplateProperties(properties), options, extra); } + /** + * event withDifferent_CasingTypes + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) + * + * Description for case with space + * + * Owner: Test codegen + * + * @param {Object} properties The event's properties. + * @param {'enum with space'} properties.enum with space Description for enum with space + * @param {'enum_snake_case'} properties.enum_snake_case description_for_enum_snake_case + * @param {'enumCamelCase'} properties.enumCamelCase descriptionForEnumCamelCase + * @param {'EnumPascalCase'} properties.EnumPascalCase DescirptionForEnumPascalCase + * @param {string} properties.property with space Description for case with space + * @param {string} properties.property_with_snake_case Description_for_snake_case + * @param {string} properties.propertyWithCamelCase descriptionForCamelCase + * @param {string} properties.PropertyWithPascalCase DescriptionForPascalCase + * @param {EventOptions} [options] Options for this track call. + * @param {MiddlewareExtra} [extra] Extra untyped parameters for use in middleware. + * + * @return {{promise: Promise}} + */ + eventWithDifferentCasingTypes(properties, options, extra) { + return this.track(new EventWithDifferentCasingTypes(properties), options, extra); + } + + /** + * EventMaxIntForTest + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) + * + * Event to test schema validation + * + * Owner: Test codegen + * + * @param {Object} properties The event's properties. + * @param {number} properties.intMax10 property to test schema validation + * @param {EventOptions} [options] Options for this track call. + * @param {MiddlewareExtra} [extra] Extra untyped parameters for use in middleware. + * + * @return {{promise: Promise}} + */ + eventMaxIntForTest(properties, options, extra) { + return this.track(new EventMaxIntForTest(properties), options, extra); + } + /** @private * @param {EventOptions} [options] diff --git a/react-native/javascript/v2/AmpliApp/ampli.json b/react-native/javascript/v2/AmpliApp/ampli.json index 8d65f17c..34dbac03 100644 --- a/react-native/javascript/v2/AmpliApp/ampli.json +++ b/react-native/javascript/v2/AmpliApp/ampli.json @@ -5,7 +5,10 @@ "Runtime": "react-native:javascript-ampli-v2", "Path": "./src/ampli", "Branch": "main", - "Version": "0.0.0", - "VersionId": "79154a50-f057-4db5-9755-775e4e9f05e6", - "OmitApiKeys": true + "Version": "1.0.0", + "VersionId": "a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c", + "OmitApiKeys": true, + "Platform": "React Native", + "Language": "JavaScript", + "SDK": "@amplitude/analytics-react-native@^1.0" } \ No newline at end of file diff --git a/react-native/javascript/v2/AmpliApp/src/App.js b/react-native/javascript/v2/AmpliApp/src/App.js index 7e6d09e1..7e0e4919 100644 --- a/react-native/javascript/v2/AmpliApp/src/App.js +++ b/react-native/javascript/v2/AmpliApp/src/App.js @@ -169,6 +169,7 @@ function App() { ampli.eventWithArrayTypes({ requiredBooleanArray: [true, false], + requiredEnumArray: ['enum1'], requiredNumberArray: [1.2, 3, 4.56], requiredObjectArray: [{'key-1': 'value-1'}, {'key-2': 'value-2'}], requiredStringArray: ['string-1', 'string-2', 'string-3'], diff --git a/react-native/javascript/v2/AmpliApp/src/ampli/index.js b/react-native/javascript/v2/AmpliApp/src/ampli/index.js index c037ded3..c249b000 100644 --- a/react-native/javascript/v2/AmpliApp/src/ampli/index.js +++ b/react-native/javascript/v2/AmpliApp/src/ampli/index.js @@ -7,8 +7,8 @@ * This file is generated by Amplitude. * To update run 'ampli pull react-native-js-ampli-v2' * - * Required dependencies: @amplitude/analytics-react-native@^0.4.0 @react-native-async-storage/async-storage@^1.17.9 - * Tracking Plan Version: 0 + * Required dependencies: @amplitude/analytics-react-native@^0.4.0, @react-native-async-storage/async-storage@^1.17.9 + * Tracking Plan Version: 1 * Build: 1.0.0 * Runtime: react-native:javascript-ampli-v2 * @@ -46,7 +46,7 @@ import * as amplitude from '@amplitude/analytics-react-native'; /** * @typedef LoadOptions * @type {object} - * @property {'development'|'production'} [environment] + * @property {'prod'|'dev'} [environment] * @property {boolean} [disabled] * @property {LoadClientOptions} [client] */ @@ -59,12 +59,12 @@ import * as amplitude from '@amplitude/analytics-react-native'; /** * @typedef ApiKey * @type {object} - * @property {string} development - * @property {string} production + * @property {string} prod + * @property {string} dev */ export const ApiKey = { - development: '', - production: '' + prod: '', + dev: '' }; /** @@ -84,10 +84,10 @@ export const ApiKey = { */ export const DefaultConfiguration = { plan: { - version: '0', + version: '1', branch: 'main', source: 'react-native-js-ampli-v2', - versionId: '79154a50-f057-4db5-9755-775e4e9f05e6' + versionId: 'a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c' }, ingestionMetadata: { sourceName: 'react-native-javascript-ampli', @@ -102,13 +102,6 @@ export class Identify { } } -export class EventMaxIntForTest { - constructor(properties) { - this.event_type = 'EventMaxIntForTest'; - this.event_properties = properties; - } -} - export class EventNoProperties { constructor() { this.event_type = 'Event No Properties'; @@ -153,13 +146,6 @@ export class EventWithConstTypes { } } -export class EventWithDifferentCasingTypes { - constructor(properties) { - this.event_type = 'event withDifferent_CasingTypes'; - this.event_properties = properties; - } -} - export class EventWithEnumTypes { constructor(properties) { this.event_type = 'Event With Enum Types'; @@ -188,6 +174,20 @@ export class EventWithTemplateProperties { } } +export class EventWithDifferentCasingTypes { + constructor(properties) { + this.event_type = 'event withDifferent_CasingTypes'; + this.event_properties = properties; + } +} + +export class EventMaxIntForTest { + constructor(properties) { + this.event_type = 'EventMaxIntForTest'; + this.event_properties = properties; + } +} + /** * @typedef PromiseResult * @type {object} @@ -234,7 +234,7 @@ export class Ampli { /** * Initialize the Ampli SDK. Call once when your application starts. * - * @param {LoadOptions} [options] Configuration options to initialize the Ampli SDK with. + * @param {LoadOptions} options Configuration options to initialize the Ampli SDK with. 'environment', 'client.apiKey' or 'client.instance' is required. * * @return {PromiseResult} */ @@ -246,8 +246,12 @@ export class Ampli { return getVoidPromiseResult(); } - const env = options?.environment ?? 'development'; - const apiKey = options?.client?.apiKey ?? ApiKey[env]; + let apiKey; + if (options?.client?.apiKey) { + apiKey = options.client.apiKey; + } else if (options?.environment) { + apiKey = ApiKey[options.environment]; + } if (options?.client?.instance) { this.amplitude = options?.client?.instance; @@ -321,25 +325,6 @@ export class Ampli { return this.amplitude.flush(); } - /** - * EventMaxIntForTest - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) - * - * Event to test schema validation - * - * Owner: Test codegen - * - * @param {Object} properties The event's properties. - * @param {number} properties.intMax10 property to test schema validation - * @param {EventOptions} [options] Options for this track call. - * - * @return {PromiseResult} - */ - eventMaxIntForTest(properties, options) { - return this.track(new EventMaxIntForTest(properties), options); - } - /** * Event No Properties * @@ -413,6 +398,7 @@ export class Ampli { * * @param {Object} properties The event's properties. * @param {boolean[]} properties.requiredBooleanArray description for required boolean array + * @param {string[]} properties.requiredEnumArray Description for enum array property * @param {number[]} properties.requiredNumberArray Description for required number array * @param {*[]} properties.requiredObjectArray Description for required object array * @param {string[]} properties.requiredStringArray description for required string array @@ -441,32 +427,6 @@ export class Ampli { return this.track(new EventWithConstTypes(), options); } - /** - * event withDifferent_CasingTypes - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) - * - * Description for case with space - * - * Owner: Test codegen - * - * @param {Object} properties The event's properties. - * @param {'enumCamelCase'} properties.enumCamelCase descriptionForEnumCamelCase - * @param {'EnumPascalCase'} properties.EnumPascalCase DescirptionForEnumPascalCase - * @param {'enum_snake_case'} properties.enum_snake_case description_for_enum_snake_case - * @param {'enum with space'} properties.enum with space Description for enum with space - * @param {string} properties.propertyWithCamelCase descriptionForCamelCase - * @param {string} properties.PropertyWithPascalCase DescriptionForPascalCase - * @param {string} properties.property_with_snake_case Description_for_snake_case - * @param {string} properties.property with space Description for case with space - * @param {EventOptions} [options] Options for this track call. - * - * @return {PromiseResult} - */ - eventWithDifferentCasingTypes(properties, options) { - return this.track(new EventWithDifferentCasingTypes(properties), options); - } - /** * Event With Enum Types * @@ -498,6 +458,7 @@ export class Ampli { * * @param {Object} [properties] The event's properties. * @param {boolean[]} [properties.optionalBooleanArray] Description for optional boolean array + * @param {string[]} [properties.optionalEnumArray] Description for optional enum array * @param {*[]} [properties.optionalJSONArray] Description for optional object array * @param {number[]} [properties.optionalNumberArray] Description for optional number array * @param {string[]} [properties.optionalStringArray] Description for optional string array @@ -553,6 +514,51 @@ export class Ampli { eventWithTemplateProperties(properties, options) { return this.track(new EventWithTemplateProperties(properties), options); } + + /** + * event withDifferent_CasingTypes + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) + * + * Description for case with space + * + * Owner: Test codegen + * + * @param {Object} properties The event's properties. + * @param {'enum with space'} properties.enum with space Description for enum with space + * @param {'enum_snake_case'} properties.enum_snake_case description_for_enum_snake_case + * @param {'enumCamelCase'} properties.enumCamelCase descriptionForEnumCamelCase + * @param {'EnumPascalCase'} properties.EnumPascalCase DescirptionForEnumPascalCase + * @param {string} properties.property with space Description for case with space + * @param {string} properties.property_with_snake_case Description_for_snake_case + * @param {string} properties.propertyWithCamelCase descriptionForCamelCase + * @param {string} properties.PropertyWithPascalCase DescriptionForPascalCase + * @param {EventOptions} [options] Options for this track call. + * + * @return {PromiseResult} + */ + eventWithDifferentCasingTypes(properties, options) { + return this.track(new EventWithDifferentCasingTypes(properties), options); + } + + /** + * EventMaxIntForTest + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) + * + * Event to test schema validation + * + * Owner: Test codegen + * + * @param {Object} properties The event's properties. + * @param {number} properties.intMax10 property to test schema validation + * @param {EventOptions} [options] Options for this track call. + * + * @return {PromiseResult} + */ + eventMaxIntForTest(properties, options) { + return this.track(new EventMaxIntForTest(properties), options); + } } export const ampli = new Ampli(); diff --git a/react-native/typescript/v1/AmpliApp/ampli.json b/react-native/typescript/v1/AmpliApp/ampli.json index 3f6557bb..c4aaa36a 100644 --- a/react-native/typescript/v1/AmpliApp/ampli.json +++ b/react-native/typescript/v1/AmpliApp/ampli.json @@ -5,7 +5,10 @@ "Runtime": "react-native:typescript-ampli", "Path": "./src/ampli", "Branch": "main", - "Version": "0.0.0", - "VersionId": "79154a50-f057-4db5-9755-775e4e9f05e6", - "OmitApiKeys": true + "Version": "1.0.0", + "VersionId": "a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c", + "OmitApiKeys": true, + "Platform": "React Native", + "Language": "TypeScript", + "SDK": "@amplitude/react-native@^2.0" } \ No newline at end of file diff --git a/react-native/typescript/v1/AmpliApp/src/App.tsx b/react-native/typescript/v1/AmpliApp/src/App.tsx index 82ab0055..2c68f1d3 100644 --- a/react-native/typescript/v1/AmpliApp/src/App.tsx +++ b/react-native/typescript/v1/AmpliApp/src/App.tsx @@ -182,6 +182,7 @@ function App() { ampli.eventWithArrayTypes({ requiredBooleanArray: [true, false], + requiredEnumArray: ['enum1'], requiredNumberArray: [1.2, 3, 4.56], requiredObjectArray: [{'key-1': 'value-1'}, {'key-2': 'value-2'}], requiredStringArray: ['string-1', 'string-2', 'string-3'], diff --git a/react-native/typescript/v1/AmpliApp/src/ampli/index.ts b/react-native/typescript/v1/AmpliApp/src/ampli/index.ts index d4c4ec57..e3d29358 100644 --- a/react-native/typescript/v1/AmpliApp/src/ampli/index.ts +++ b/react-native/typescript/v1/AmpliApp/src/ampli/index.ts @@ -8,7 +8,7 @@ * To update run 'ampli pull react-native-typescript-ampli' * * Required dependencies: @amplitude/react-native@^2.15.0 - * Tracking Plan Version: 0 + * Tracking Plan Version: 1 * Build: 1.0.0 * Runtime: react-native:typescript-ampli * @@ -30,33 +30,31 @@ export type EventOptions = { deviceId?: string; } -export type Environment = 'development' | 'production'; +export type Environment = 'prod' | 'dev'; export const ApiKey: Record = { - development: '', - production: '' + prod: '', + dev: '' }; export type ClientOptions = { plan?: Plan, } -export interface LoadOptions { - environment?: Environment; - disabled?: boolean; - client?: { - apiKey?: string; - instance?: Amplitude; - options?: ClientOptions; - } -} +export interface LoadOptionsBase { disabled?: boolean } + +export type LoadOptionsWithEnvironment = LoadOptionsBase & { environment: Environment; client?: { options?: ClientOptions; }; }; +export type LoadOptionsWithApiKey = LoadOptionsBase & { client: { apiKey: string; options?: ClientOptions; } }; +export type LoadOptionsWithClientInstance = LoadOptionsBase & { client: { instance: Amplitude; } }; + +export type LoadOptions = LoadOptionsWithEnvironment | LoadOptionsWithApiKey | LoadOptionsWithClientInstance; export const DefaultOptions: ClientOptions = { plan: { branch: 'main', source: 'react-native-typescript-ampli', - version: '0', - versionId: '79154a50-f057-4db5-9755-775e4e9f05e6', + version: '1', + versionId: 'a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c', }, ...{ ingestionMetadata: { @@ -86,25 +84,11 @@ export interface IdentifyProperties { requiredNumber: number; } -export interface EventMaxIntForTestProperties { - /** - * property to test schema validation - * - * | Rule | Value | - * |---|---| - * | Type | integer | - * | Max Value | 10 | - */ - intMax10: number; -} - export interface EventObjectTypesProperties { /** * Property Object Type */ - requiredObject: { - [k: string]: any; - }; + requiredObject: any; /** * Property Object Array Type */ @@ -170,6 +154,14 @@ export interface EventWithArrayTypesProperties { * | Item Type | boolean | */ requiredBooleanArray: boolean[]; + /** + * Description for enum array property + * + * | Rule | Value | + * |---|---| + * | Item Type | string | + */ + requiredEnumArray: ("enum1" | "enum2")[]; /** * Description for required number array * @@ -192,57 +184,6 @@ export interface EventWithArrayTypesProperties { requiredStringArray: string[]; } -export interface EventWithDifferentCasingTypesProperties { - /** - * descriptionForEnumCamelCase - * - * | Rule | Value | - * |---|---| - * | Enum Values | enumCamelCase | - */ - enumCamelCase: "enumCamelCase"; - /** - * DescirptionForEnumPascalCase - * - * | Rule | Value | - * |---|---| - * | Enum Values | EnumPascalCase | - */ - EnumPascalCase: "EnumPascalCase"; - /** - * description_for_enum_snake_case - * - * | Rule | Value | - * |---|---| - * | Enum Values | enum_snake_case | - */ - enum_snake_case: "enum_snake_case"; - /** - * Description for enum with space - * - * | Rule | Value | - * |---|---| - * | Enum Values | enum with space | - */ - "enum with space": "enum with space"; - /** - * descriptionForCamelCase - */ - propertyWithCamelCase: string; - /** - * DescriptionForPascalCase - */ - PropertyWithPascalCase: string; - /** - * Description_for_snake_case - */ - property_with_snake_case: string; - /** - * Description for case with space - */ - "property with space": string; -} - export interface EventWithEnumTypesProperties { /** * Description for required enum @@ -271,6 +212,14 @@ export interface EventWithOptionalArrayTypesProperties { * | Item Type | boolean | */ optionalBooleanArray?: boolean[]; + /** + * Description for optional enum array + * + * | Rule | Value | + * |---|---| + * | Item Type | string | + */ + optionalEnumArray?: ("enum1" | "enum2")[]; /** * Description for optional object array */ @@ -346,6 +295,69 @@ export interface EventWithTemplatePropertiesProperties { required_template_property: string; } +export interface EventWithDifferentCasingTypesProperties { + /** + * Description for enum with space + * + * | Rule | Value | + * |---|---| + * | Enum Values | enum with space | + */ + "enum with space": "enum with space"; + /** + * description_for_enum_snake_case + * + * | Rule | Value | + * |---|---| + * | Enum Values | enum_snake_case | + */ + enum_snake_case: "enum_snake_case"; + /** + * descriptionForEnumCamelCase + * + * | Rule | Value | + * |---|---| + * | Enum Values | enumCamelCase | + */ + enumCamelCase: "enumCamelCase"; + /** + * DescirptionForEnumPascalCase + * + * | Rule | Value | + * |---|---| + * | Enum Values | EnumPascalCase | + */ + EnumPascalCase: "EnumPascalCase"; + /** + * Description for case with space + */ + "property with space": string; + /** + * Description_for_snake_case + */ + property_with_snake_case: string; + /** + * descriptionForCamelCase + */ + propertyWithCamelCase: string; + /** + * DescriptionForPascalCase + */ + PropertyWithPascalCase: string; +} + +export interface EventMaxIntForTestProperties { + /** + * property to test schema validation + * + * | Rule | Value | + * |---|---| + * | Type | integer | + * | Max Value | 10 | + */ + intMax10: number; +} + export interface EventTemplateProperties { /** * optional_template_property description @@ -386,16 +398,6 @@ export class Identify implements Event { } } -export class EventMaxIntForTest implements Event { - eventType = 'EventMaxIntForTest'; - - constructor( - public eventProperties: EventMaxIntForTestProperties, - ) { - this.eventProperties = eventProperties; - } -} - export class EventNoProperties implements Event { eventType = 'Event No Properties'; } @@ -448,16 +450,6 @@ export class EventWithConstTypes implements Event { }; } -export class EventWithDifferentCasingTypes implements Event { - eventType = 'event withDifferent_CasingTypes'; - - constructor( - public eventProperties: EventWithDifferentCasingTypesProperties, - ) { - this.eventProperties = eventProperties; - } -} - export class EventWithEnumTypes implements Event { eventType = 'Event With Enum Types'; @@ -498,6 +490,26 @@ export class EventWithTemplateProperties implements Event { } } +export class EventWithDifferentCasingTypes implements Event { + eventType = 'event withDifferent_CasingTypes'; + + constructor( + public eventProperties: EventWithDifferentCasingTypesProperties, + ) { + this.eventProperties = eventProperties; + } +} + +export class EventMaxIntForTest implements Event { + eventType = 'EventMaxIntForTest'; + + constructor( + public eventProperties: EventMaxIntForTestProperties, + ) { + this.eventProperties = eventProperties; + } +} + const getPromiseResponse = (result: boolean) => Promise.resolve(result); // prettier-ignore @@ -526,19 +538,23 @@ export class Ampli { * Initialize the Ampli SDK. Call once when your application starts. * @param options Configuration options to initialize the Ampli SDK with. */ - load(options?: LoadOptions) { - this.disabled = options?.disabled ?? false; + load(options: LoadOptions) { + this.disabled = options.disabled ?? false; if (this.isLoaded) { console.warn('WARNING: Ampli is already initialized. Ampli.load() should be called once at application startup.'); return { promise: getPromiseResponse(false) }; } - const env = options?.environment ?? 'development'; - const apiKey = options?.client?.apiKey ?? ApiKey[env]; + let apiKey: string | null = null; + if (options.client && 'apiKey' in options.client) { + apiKey = options.client.apiKey; + } else if ('environment' in options) { + apiKey = ApiKey[options.environment]; + } - if (options?.client?.instance) { - this.amplitude = options?.client?.instance; + if (options.client && 'instance' in options.client) { + this.amplitude = options.client.instance; return { promise: getPromiseResponse(true) }; } @@ -546,7 +562,7 @@ export class Ampli { this.amplitude = Amplitude.getInstance(); let promise = this.amplitude!.init(apiKey); - const clientOptions = { ...DefaultOptions, ...options?.client?.options }; + const clientOptions = { ...DefaultOptions, ...options.client?.options }; const plan = clientOptions.plan; if (plan) { promise = promise.then(ok => ok ? this.amplitude!.setPlan(plan) : false); @@ -620,27 +636,6 @@ export class Ampli { return { promise }; } - /** - * EventMaxIntForTest - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) - * - * Event to test schema validation - * - * Owner: Test codegen - * - * @param properties The event's properties (e.g. intMax10) - * @param options Amplitude event options. - * @param extra Extra untyped parameters for use in middleware. - */ - eventMaxIntForTest( - properties: EventMaxIntForTestProperties, - options?: EventOptions, - extra?: MiddlewareExtra, - ) { - return this.track(new EventMaxIntForTest(properties), options, extra); - } - /** * Event No Properties * @@ -742,27 +737,6 @@ export class Ampli { return this.track(new EventWithConstTypes(), options, extra); } - /** - * event withDifferent_CasingTypes - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) - * - * Description for case with space - * - * Owner: Test codegen - * - * @param properties The event's properties (e.g. enumCamelCase) - * @param options Amplitude event options. - * @param extra Extra untyped parameters for use in middleware. - */ - eventWithDifferentCasingTypes( - properties: EventWithDifferentCasingTypesProperties, - options?: EventOptions, - extra?: MiddlewareExtra, - ) { - return this.track(new EventWithDifferentCasingTypes(properties), options, extra); - } - /** * Event With Enum Types * @@ -847,6 +821,48 @@ export class Ampli { return this.track(new EventWithTemplateProperties(properties), options, extra); } + /** + * event withDifferent_CasingTypes + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) + * + * Description for case with space + * + * Owner: Test codegen + * + * @param properties The event's properties (e.g. enum with space) + * @param options Amplitude event options. + * @param extra Extra untyped parameters for use in middleware. + */ + eventWithDifferentCasingTypes( + properties: EventWithDifferentCasingTypesProperties, + options?: EventOptions, + extra?: MiddlewareExtra, + ) { + return this.track(new EventWithDifferentCasingTypes(properties), options, extra); + } + + /** + * EventMaxIntForTest + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) + * + * Event to test schema validation + * + * Owner: Test codegen + * + * @param properties The event's properties (e.g. intMax10) + * @param options Amplitude event options. + * @param extra Extra untyped parameters for use in middleware. + */ + eventMaxIntForTest( + properties: EventMaxIntForTestProperties, + options?: EventOptions, + extra?: MiddlewareExtra, + ) { + return this.track(new EventMaxIntForTest(properties), options, extra); + } + private handleEventOptions(options: EventOptions | undefined, userId?: string) { if (userId || options?.userId) { this.amplitude?.setUserId(userId ?? options?.userId ?? null); diff --git a/react-native/typescript/v2/AmpliApp/ampli.json b/react-native/typescript/v2/AmpliApp/ampli.json index 5a84ed99..9d10ea71 100644 --- a/react-native/typescript/v2/AmpliApp/ampli.json +++ b/react-native/typescript/v2/AmpliApp/ampli.json @@ -5,7 +5,10 @@ "Runtime": "react-native:typescript-ampli-v2", "Path": "./src/ampli", "Branch": "main", - "Version": "0.0.0", - "VersionId": "79154a50-f057-4db5-9755-775e4e9f05e6", - "OmitApiKeys": true + "Version": "1.0.0", + "VersionId": "a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c", + "OmitApiKeys": true, + "Platform": "React Native", + "Language": "TypeScript", + "SDK": "@amplitude/analytics-react-native@^1.0" } \ No newline at end of file diff --git a/react-native/typescript/v2/AmpliApp/src/ampli/index.ts b/react-native/typescript/v2/AmpliApp/src/ampli/index.ts index 9afe4416..78f7f5cd 100644 --- a/react-native/typescript/v2/AmpliApp/src/ampli/index.ts +++ b/react-native/typescript/v2/AmpliApp/src/ampli/index.ts @@ -7,8 +7,8 @@ * This file is generated by Amplitude. * To update run 'ampli pull react-native-ts-ampli-v2' * - * Required dependencies: @amplitude/analytics-react-native@^0.4.0 @react-native-async-storage/async-storage@^1.17.9 - * Tracking Plan Version: 0 + * Required dependencies: @amplitude/analytics-react-native@^0.4.0, @react-native-async-storage/async-storage@^1.17.9 + * Tracking Plan Version: 1 * Build: 1.0.0 * Runtime: react-native:typescript-ampli-v2 * @@ -26,11 +26,11 @@ export type EventOptions = amplitude.Types.EventOptions; export type Result = amplitude.Types.Result; export type ReactNativeOptions = amplitude.Types.ReactNativeOptions; -export type Environment = 'development' | 'production'; +export type Environment = 'prod' | 'dev'; export const ApiKey: Record = { - development: '', - production: '' + prod: '', + dev: '' }; /** @@ -38,10 +38,10 @@ export const ApiKey: Record = { */ export const DefaultConfiguration: ReactNativeOptions = { plan: { - version: '0', + version: '1', branch: 'main', source: 'react-native-ts-ampli-v2', - versionId: '79154a50-f057-4db5-9755-775e4e9f05e6' + versionId: 'a61c3908-ca4d-4c8d-8f81-54ad3ba17b9c' }, ...{ ingestionMetadata: { @@ -51,15 +51,13 @@ export const DefaultConfiguration: ReactNativeOptions = { } }; -export interface LoadOptions { - environment?: Environment; - disabled?: boolean; - client?: { - apiKey?: string; - configuration?: ReactNativeOptions; - instance?: ReactNativeClient; - } -} +export interface LoadOptionsBase { disabled?: boolean } + +export type LoadOptionsWithEnvironment = LoadOptionsBase & { environment: Environment; client?: { configuration?: ReactNativeOptions; }; }; +export type LoadOptionsWithApiKey = LoadOptionsBase & { client: { apiKey: string; configuration?: ReactNativeOptions; } }; +export type LoadOptionsWithClientInstance = LoadOptionsBase & { client: { instance: ReactNativeClient; } }; + +export type LoadOptions = LoadOptionsWithEnvironment | LoadOptionsWithApiKey | LoadOptionsWithClientInstance; export interface IdentifyProperties { /** @@ -81,25 +79,11 @@ export interface IdentifyProperties { requiredNumber: number; } -export interface EventMaxIntForTestProperties { - /** - * property to test schema validation - * - * | Rule | Value | - * |---|---| - * | Type | integer | - * | Max Value | 10 | - */ - intMax10: number; -} - export interface EventObjectTypesProperties { /** * Property Object Type */ - requiredObject: { - [k: string]: any; - }; + requiredObject: any; /** * Property Object Array Type */ @@ -165,6 +149,14 @@ export interface EventWithArrayTypesProperties { * | Item Type | boolean | */ requiredBooleanArray: boolean[]; + /** + * Description for enum array property + * + * | Rule | Value | + * |---|---| + * | Item Type | string | + */ + requiredEnumArray: ("enum1" | "enum2")[]; /** * Description for required number array * @@ -187,57 +179,6 @@ export interface EventWithArrayTypesProperties { requiredStringArray: string[]; } -export interface EventWithDifferentCasingTypesProperties { - /** - * descriptionForEnumCamelCase - * - * | Rule | Value | - * |---|---| - * | Enum Values | enumCamelCase | - */ - enumCamelCase: "enumCamelCase"; - /** - * DescirptionForEnumPascalCase - * - * | Rule | Value | - * |---|---| - * | Enum Values | EnumPascalCase | - */ - EnumPascalCase: "EnumPascalCase"; - /** - * description_for_enum_snake_case - * - * | Rule | Value | - * |---|---| - * | Enum Values | enum_snake_case | - */ - enum_snake_case: "enum_snake_case"; - /** - * Description for enum with space - * - * | Rule | Value | - * |---|---| - * | Enum Values | enum with space | - */ - "enum with space": "enum with space"; - /** - * descriptionForCamelCase - */ - propertyWithCamelCase: string; - /** - * DescriptionForPascalCase - */ - PropertyWithPascalCase: string; - /** - * Description_for_snake_case - */ - property_with_snake_case: string; - /** - * Description for case with space - */ - "property with space": string; -} - export interface EventWithEnumTypesProperties { /** * Description for required enum @@ -266,6 +207,14 @@ export interface EventWithOptionalArrayTypesProperties { * | Item Type | boolean | */ optionalBooleanArray?: boolean[]; + /** + * Description for optional enum array + * + * | Rule | Value | + * |---|---| + * | Item Type | string | + */ + optionalEnumArray?: ("enum1" | "enum2")[]; /** * Description for optional object array */ @@ -341,6 +290,69 @@ export interface EventWithTemplatePropertiesProperties { required_template_property: string; } +export interface EventWithDifferentCasingTypesProperties { + /** + * Description for enum with space + * + * | Rule | Value | + * |---|---| + * | Enum Values | enum with space | + */ + "enum with space": "enum with space"; + /** + * description_for_enum_snake_case + * + * | Rule | Value | + * |---|---| + * | Enum Values | enum_snake_case | + */ + enum_snake_case: "enum_snake_case"; + /** + * descriptionForEnumCamelCase + * + * | Rule | Value | + * |---|---| + * | Enum Values | enumCamelCase | + */ + enumCamelCase: "enumCamelCase"; + /** + * DescirptionForEnumPascalCase + * + * | Rule | Value | + * |---|---| + * | Enum Values | EnumPascalCase | + */ + EnumPascalCase: "EnumPascalCase"; + /** + * Description for case with space + */ + "property with space": string; + /** + * Description_for_snake_case + */ + property_with_snake_case: string; + /** + * descriptionForCamelCase + */ + propertyWithCamelCase: string; + /** + * DescriptionForPascalCase + */ + PropertyWithPascalCase: string; +} + +export interface EventMaxIntForTestProperties { + /** + * property to test schema validation + * + * | Rule | Value | + * |---|---| + * | Type | integer | + * | Max Value | 10 | + */ + intMax10: number; +} + export interface EventTemplateProperties { /** * optional_template_property description @@ -381,16 +393,6 @@ export class Identify implements BaseEvent { } } -export class EventMaxIntForTest implements BaseEvent { - event_type = 'EventMaxIntForTest'; - - constructor( - public event_properties: EventMaxIntForTestProperties, - ) { - this.event_properties = event_properties; - } -} - export class EventNoProperties implements BaseEvent { event_type = 'Event No Properties'; } @@ -443,16 +445,6 @@ export class EventWithConstTypes implements BaseEvent { }; } -export class EventWithDifferentCasingTypes implements BaseEvent { - event_type = 'event withDifferent_CasingTypes'; - - constructor( - public event_properties: EventWithDifferentCasingTypesProperties, - ) { - this.event_properties = event_properties; - } -} - export class EventWithEnumTypes implements BaseEvent { event_type = 'Event With Enum Types'; @@ -493,6 +485,26 @@ export class EventWithTemplateProperties implements BaseEvent { } } +export class EventWithDifferentCasingTypes implements BaseEvent { + event_type = 'event withDifferent_CasingTypes'; + + constructor( + public event_properties: EventWithDifferentCasingTypesProperties, + ) { + this.event_properties = event_properties; + } +} + +export class EventMaxIntForTest implements BaseEvent { + event_type = 'EventMaxIntForTest'; + + constructor( + public event_properties: EventMaxIntForTestProperties, + ) { + this.event_properties = event_properties; + } +} + export type PromiseResult = { promise: Promise }; const getVoidPromiseResult = () => ({ promise: Promise.resolve() }); @@ -524,22 +536,26 @@ export class Ampli { * * @param options Configuration options to initialize the Ampli SDK with. */ - load(options?: LoadOptions): PromiseResult { - this.disabled = options?.disabled ?? false; + load(options: LoadOptions): PromiseResult { + this.disabled = options.disabled ?? false; if (this.amplitude) { console.warn('WARNING: Ampli is already initialized. Ampli.load() should be called once at application startup.'); return getVoidPromiseResult(); } - const env = options?.environment ?? 'development'; - const apiKey = options?.client?.apiKey ?? ApiKey[env]; + let apiKey: string | null = null; + if (options.client && 'apiKey' in options.client) { + apiKey = options.client.apiKey; + } else if ('environment' in options) { + apiKey = ApiKey[options.environment]; + } - if (options?.client?.instance) { - this.amplitude = options?.client?.instance; + if (options.client && 'instance' in options.client) { + this.amplitude = options.client.instance; } else if (apiKey) { this.amplitude = amplitude.createInstance(); - return this.amplitude.init(apiKey, undefined, { ...DefaultConfiguration, ...options?.client?.configuration }); + return this.amplitude.init(apiKey, undefined, { ...DefaultConfiguration, ...options.client?.configuration }); } else { console.error("ERROR: ampli.load() requires 'environment', 'client.apiKey', or 'client.instance'"); } @@ -603,25 +619,6 @@ export class Ampli { return this.amplitude!.flush(); } - /** - * EventMaxIntForTest - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) - * - * Event to test schema validation - * - * Owner: Test codegen - * - * @param properties The event's properties (e.g. intMax10) - * @param options Amplitude event options. - */ - eventMaxIntForTest( - properties: EventMaxIntForTestProperties, - options?: EventOptions, - ) { - return this.track(new EventMaxIntForTest(properties), options); - } - /** * Event No Properties * @@ -713,25 +710,6 @@ export class Ampli { return this.track(new EventWithConstTypes(), options); } - /** - * event withDifferent_CasingTypes - * - * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) - * - * Description for case with space - * - * Owner: Test codegen - * - * @param properties The event's properties (e.g. enumCamelCase) - * @param options Amplitude event options. - */ - eventWithDifferentCasingTypes( - properties: EventWithDifferentCasingTypesProperties, - options?: EventOptions, - ) { - return this.track(new EventWithDifferentCasingTypes(properties), options); - } - /** * Event With Enum Types * @@ -807,6 +785,44 @@ export class Ampli { ) { return this.track(new EventWithTemplateProperties(properties), options); } + + /** + * event withDifferent_CasingTypes + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/event%20withDifferent_CasingTypes) + * + * Description for case with space + * + * Owner: Test codegen + * + * @param properties The event's properties (e.g. enum with space) + * @param options Amplitude event options. + */ + eventWithDifferentCasingTypes( + properties: EventWithDifferentCasingTypesProperties, + options?: EventOptions, + ) { + return this.track(new EventWithDifferentCasingTypes(properties), options); + } + + /** + * EventMaxIntForTest + * + * [View in Tracking Plan](https://data.amplitude.com/test-codegen/Test%20Codegen/events/main/latest/EventMaxIntForTest) + * + * Event to test schema validation + * + * Owner: Test codegen + * + * @param properties The event's properties (e.g. intMax10) + * @param options Amplitude event options. + */ + eventMaxIntForTest( + properties: EventMaxIntForTestProperties, + options?: EventOptions, + ) { + return this.track(new EventMaxIntForTest(properties), options); + } } export const ampli = new Ampli();