BigQuery

AIRSHIP MAINTAINED INTEGRATION

This integration is maintained by Airship. Please contact Airship for support.

Send Airship event data to BigQuery for storage and analysis.

BigQuery is a fully managed cloud-based data warehouse and analytics service for storing and analyzing data. This guide helps you integrate Airship Real-Time Data StreamingA service that delivers user-level events in real time to your backend or third-party systems using the Data Streaming API. event data into BigQuery using this process:

  1. Configure Data Export to Google Cloud Storage: Use Airship’s Data Export integration to send RTDS event data as batched CSV files to a Google Cloud Storage (GCS) bucket.

  2. Create tables and load data: Create BigQuery tables using the event schemas provided in this document, and then load the CSV files from GCS into BigQuery using Google’s Data Transfer Service, BigQuery’s LOAD DATA statements, or another data pipeline method.

    Airship provides event schemas for tables that correspond to each Airship event type. These schemas are included in this document to help you create the appropriate BigQuery tables and ensure your data loads correctly.

This approach gives you flexibility in designing your data pipeline while maintaining full control over your data. While the Data Export integration operates hourly, you can choose how frequently to load data into BigQuery and implement the data transfer method that best fits your infrastructure and requirements.

Requirements

This integration requires the following:

  • A Google Cloud Platform account with BigQuery and Cloud Storage enabled
  • Airship account that includes messaging and Real-Time Data Streaming

Set up the data pipeline

Follow the steps for the Data Export integration to send your RTDS event data to a Google Cloud Storage bucket. Select GCS as your storage provider and configure the integration according to your needs.

Create Airship tables in BigQuery

Use the provided schemas to create the BigQuery dataset and tables for your Airship event data. The table definitions match the structure of the CSV files exported by the Data Export integration.

File structure

The Data Export integration organizes CSV files in your GCS bucket according to the file layout you select. See the Data Export documentation for details on Standard, Simplified, and Flattened layouts. For the DTS pipeline, we recommend the Simplified layout to avoid namespace collisions.

Regardless of the layout you choose, files are generated hourly when events occur and include a header row. The file paths follow these patterns:

  • Standard layout: [folder_path]/appKey/integrationId/eventType/YYYY_MM_DD/YYYY_MM_DD_HH_mm_ss.csv
  • Simplified layout: [folder_path]/appKey/integrationId/eventType/YYYY_MM_DD_HH_mm_ss.csv
  • Flattened layout: [folder_path]/appKey/integrationId/eventType_YYYY_MM_DD_HH_mm_ss.csv

Example CSV
"id","offset","occurred","processed","app_key","channel","device_type","named_user","custom_identifiers","locale_variant","locale_country_code","locale_timezone","locale_language_code","iana_timezone","app_version","device_model","connection_type","ua_sdk_version","push_opt_in","device_os","carrier","location_enabled","location_permission","background_push_enabled","web_browser_name","web_browser_type","web_browser_version","web_user_agent_string","open_platform_name","alerting","campaigns","push_id","group_id","variant_id"
"f5e05251-b128-11ec-8a12-0242eb00e5a9","1000042149690","2022-03-31 19:30:02.357 +00:00","2022-03-31 19:30:14.867 +00:00","ISex_TTJRuarzs9-o_Gkhg","b1ab9a9e-9634-4fb4-875a-9a02dcd68e66","ANDROID","","","","FR","7200","fr","Europe/Paris","2022-02-09T000134-goat","VOG-L29","CELL","16.3.0","true","10","F SFR","false","NOT_ALLOWED","true","","","","","","true","","f5d2bdc0-b128-11ec-bae4-024205acadbe","ac4058f7-981b-4f0e-b9c4-8b7af3a647da",""
"f8fb4df1-b128-11ec-a0e3-0242e24c72c5","1000042149691","2022-03-31 19:30:07.567 +00:00","2022-03-31 19:30:16.760 +00:00","ISex_TTJRuarzs9-o_Gkhg","b1ab9a9e-9634-4fb4-875a-9a02dcd68e66","ANDROID","","","","FR","7200","fr","Europe/Paris","2022-02-09T000134-goat","VOG-L29","CELL","16.3.0","true","10","F SFR","false","NOT_ALLOWED","true","","","","","","true","","f6586880-b128-11ec-99dd-02423b3f5d45","879056c8-0b34-4c8c-8cdc-1df4f3d40b40",""
"9aa98182-e854-4fa7-9c9f-ddea2082cc4c","1000042149694","2022-03-31 19:33:51.225 +00:00","2022-03-31 19:33:51.416 +00:00","ISex_TTJRuarzs9-o_Gkhg","62d92a24-0ced-40d1-ad1d-e1ea953189b7","SMS","","{""sender"":""17372004196""}","","","","","","","","","","","","","","","","","","","","","true","","75fdde30-b129-11ec-99dd-02423b3f5d45","0e2a3d4b-b4b4-4208-838f-08eb7333aa5e",""

Load data into BigQuery tables

Once your tables are created and data is being exported to GCS, load the CSV files into your BigQuery tables. You can use any of the following methods:

  • Google Data Transfer Service — Automatically transfer data from GCS to BigQuery on a schedule
  • BigQuery LOAD DATA statements — Manually or programmatically load data using SQL
  • Other data pipeline tools — Use your preferred ETL tool or custom scripts

The frequency and method of data loading is up to you and should align with your analytics requirements.

Loading CSV files in BigQuery

BigQuery automatically handles CSV files when loading data. You can specify CSV options in the LOAD DATA statement or when creating external tables. When loading CSV files, BigQuery will:

  • Skip the header row if you specify skip_leading_rows = 1
  • Automatically detect timestamp formats
  • Handle quoted fields
  • Treat empty strings as NULL values

The example below shows how to load data using BigQuery’s LOAD DATA statement:

-- Load data from Cloud Storage into BigQuery
LOAD DATA INTO `PROJECT_ID.AIRSHIP_EVENTS.TAG_CHANGE`
FROM FILES (
  uris = ['gs://your-bucket/ISex_TTJRuarzs9-o_Gkhg/gcs/19c15b67-1dd5-46b9-a25a-dfbd5d60ce58/TAG_CHANGE/2022_03_31/*.csv'],
  format = 'CSV',
  skip_leading_rows = 1
);

Sample Airship setup script and event schemas

Use the following SQL script to create your BigQuery dataset and tables for Airship event data:

SQL setup script
CREATE SCHEMA IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS`;

-- Use PROJECT_ID.AIRSHIP_EVENTS

CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.ATTRIBUTE_OPERATION`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `web_browser_name` STRING OPTIONS(description="The name of the browser running the SDK."),
  `web_browser_type` STRING OPTIONS(description="Indicates whether the browser was running on a desktop or mobile device."),
  `web_browser_version` STRING OPTIONS(description="The version of the browser running the SDK."),
  `web_user_agent_string` STRING OPTIONS(description="The user agent string reported by the browser."),
  `attribute_set` JSON OPTIONS(description="The attributes set on the device as an array of attribute objects."),
  `attribute_remove` JSON OPTIONS(description="The attributes removed from the device as an array of attribute objects.")
)
OPTIONS(
  description="Attribute Operation events indicate a change in the device's attributes. Because attribute operations are related to a device, they will have a device field. If you set an attribute on a named user, Airship records events for each device associated with the named user."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.CLOSE`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `web_browser_name` STRING OPTIONS(description="The name of the browser running the SDK."),
  `web_browser_type` STRING OPTIONS(description="Indicates whether the browser was running on a desktop or mobile device."),
  `web_browser_version` STRING OPTIONS(description="The version of the browser running the SDK."),
  `web_user_agent_string` STRING OPTIONS(description="The user agent string reported by the browser."),
  `session_id` STRING OPTIONS(description="Represents the 'session' of user activity. Absent if the application was initialized while backgrounded.")
)
OPTIONS(
  description="Occurs when a user closes the app. Close events are often latent, as they aren't sent back to Airship until the user activates the app again."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.CONTROL`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `web_browser_name` STRING OPTIONS(description="The name of the browser running the SDK."),
  `web_browser_type` STRING OPTIONS(description="Indicates whether the browser was running on a desktop or mobile device."),
  `web_browser_version` STRING OPTIONS(description="The version of the browser running the SDK."),
  `web_user_agent_string` STRING OPTIONS(description="The user agent string reported by the browser."),
  `group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `push_id` STRING OPTIONS(description="A unique identifier for a push operation."),
  `campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.")
)
OPTIONS(
  description="Occurs when a device is excluded from a push because it was arbitrarily selected as a member of a control group. Membership in a control group indicates what would've happened if you did not send a message to a user at all. This occurs for A/B Test-related pushes only."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.CUSTOM`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING OPTIONS(description="The unique, platform-agnostic channel identifier for a device. Can be null if the event was sent to a named user."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `web_browser_name` STRING OPTIONS(description="The name of the browser running the SDK."),
  `web_browser_type` STRING OPTIONS(description="Indicates whether the browser was running on a desktop or mobile device."),
  `web_browser_version` STRING OPTIONS(description="The version of the browser running the SDK."),
  `web_user_agent_string` STRING OPTIONS(description="The user agent string reported by the browser."),
  `name` STRING OPTIONS(description="The name of the event."),
  `properties` JSON OPTIONS(description="A JSON object containing the properties of the event."),
  `session_id` STRING OPTIONS(description="Represents the 'session' of user activity. Absent if the application was initialized while backgrounded."),
  `value` NUMERIC OPTIONS(description="Populated if the event is associated with a count or amount. Airship treats this field as a representation of money. The `value` field respects six digits of precision to the right of the decimal point."),
  `source` STRING OPTIONS(description="The source of the event either API or SDK."),
  `triggering_push_push_id` STRING OPTIONS(description="The push ID of the push that triggered the custom event."),
  `triggering_push_group_id` STRING OPTIONS(description="The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s"),
  `triggering_push_campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `triggering_push_time` TIMESTAMP OPTIONS(description="The UTC time when the push occurred."),
  `triggering_push_variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment)."),
  `last_delivered_push_id` STRING OPTIONS(description="Identifies the last push notification the audience received before the event. Absent if the last push occurred more than 12 hours ago."),
  `last_delivered_group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `last_delivered_campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `last_delivered_time` TIMESTAMP OPTIONS(description="The UTC time when the push occurred."),
  `last_delivered_variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).")
)
OPTIONS(
  description="Represents custom events that are either emitted from the Airship SDK or submitted through the Custom Events API. You can configure custom events yourself. There are also several CUSTOM-type events for email and SMS that are defined by Airship.In general, you can expect device information if the event source is `SDK` or if the event is one of the defined email or SMS events (as defined by `event_type`)."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.FEATURE_FLAG_INTERACTION`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `web_browser_name` STRING OPTIONS(description="The name of the browser running the SDK."),
  `web_browser_type` STRING OPTIONS(description="Indicates whether the browser was running on a desktop or mobile device."),
  `web_browser_version` STRING OPTIONS(description="The version of the browser running the SDK."),
  `web_user_agent_string` STRING OPTIONS(description="The user agent string reported by the browser."),
  `eligible` BOOL OPTIONS(description="Indicates whether or not the user was in the Feature Flag audience and had access to the feature. true means the user was in the Feature Flag audience and had access to the feature."),
  `flag_name` STRING OPTIONS(description="The name of a feature flag."),
  `flag_id` STRING OPTIONS(description="A UUID that is associated with a feature flag."),
  `push_id` STRING OPTIONS(description="A unique identifier for a push operation."),
  `app_defined_id` STRING OPTIONS(description="An identifier defined by the application if the Feature Flag interaction was created by the application logic, not Airship. If this field is present, the event body will not contain `push_id`, `group_id`, `variant_id`, or `triggering_push` fields."),
  `group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `session_id` STRING OPTIONS(description="Represents the 'session' of user activity. Absent if the application was initialized while backgrounded."),
  `variant_id` STRING OPTIONS(description="The UUID of the A/B test variant, if available."),
  `campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `triggering_push_push_id` STRING OPTIONS(description="The push ID of the push that triggered the custom event."),
  `triggering_push_group_id` STRING OPTIONS(description="The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s"),
  `triggering_push_campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `triggering_push_time` TIMESTAMP OPTIONS(description="The UTC time when the push occurred."),
  `triggering_push_variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).")
)
OPTIONS(
  description="Occurs when a user interacts with a tracked flagged feature. See Feature Flags. The events have a flag ID and flag name, which identify which flagged feature a user interacted with. They also have a boolean eligible field, which indicates whether or not the user was in the Feature Flag audience and had access to the feature."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.FIRST_OPEN`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `web_browser_name` STRING OPTIONS(description="The name of the browser running the SDK."),
  `web_browser_type` STRING OPTIONS(description="Indicates whether the browser was running on a desktop or mobile device."),
  `web_browser_version` STRING OPTIONS(description="The version of the browser running the SDK."),
  `web_user_agent_string` STRING OPTIONS(description="The user agent string reported by the browser.")
)
OPTIONS(
  description="This event occurs when a user opens an Airship-integrated app for the first time."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.FIRST_OPT_IN`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `delivery_address` STRING OPTIONS(description="The address of the device."),
  `open_platform_name` STRING OPTIONS(description="If device_type is set to OPEN, this field shows the full name of the platform.")
)
OPTIONS(
  description="This event appears in the stream when a channel is first opted in. This event is specific to email (commercial), sms and open channels."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.IN_APP_BUTTON_TAP`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `app_defined_id` STRING OPTIONS(description="An identifier defined by the application if the In-App Button Tap was created by the application logic, not Airship. If this field is present, the event body will not contain push_id, group_id, variant_id, or triggering_push fields."),
  `button_id` STRING OPTIONS(description="A unique identifier for the button."),
  `context_reporting_context_content_types` JSON OPTIONS(description="The content types of the in-app automation."),
  `context_state_form_form_identifier` STRING OPTIONS(description="Is the form controller identifier."),
  `context_state_form_response_type` STRING OPTIONS(description="The form response type. Possible values: nps, user_feedback."),
  `context_state_form_submitted` BOOL OPTIONS(description="Whether the form has been submitted."),
  `context_state_form_type` STRING OPTIONS(description="The form type. Possible values: nps, form."),
  `context_state_pager_completed` BOOL OPTIONS(description="Whether the user reached the end of the pager."),
  `context_state_pager_identifier` STRING OPTIONS(description="The pager controller identifier."),
  `context_state_pager_page_count` NUMERIC OPTIONS(description="The total number of pages."),
  `context_state_pager_page_identifier` STRING OPTIONS(description="The current page identifier."),
  `context_state_pager_page_index` NUMERIC OPTIONS(description="The current pager index."),
  `group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `rendered_locale` STRING OPTIONS(description="Optional string that defines the country and language this in-app-automation was localized as by remote-config-api. country - (String) an ISO 3166-1 country code, set by device settings. language - (String) The ISO 639-1 two-letter language code reflecting the language the phone is set to."),
  `push_id` STRING OPTIONS(description="A unique identifier for a push operation."),
  `session_id` STRING OPTIONS(description="Represents the 'session' of user activity. Absent if the application was initialized while backgrounded."),
  `time_sent` TIMESTAMP OPTIONS(description="An ISO 8601 datetime indicating when the payload defining the In-App Message was sent to the device."),
  `triggering_push_push_id` STRING OPTIONS(description="The push ID of the push that triggered the custom event."),
  `triggering_push_group_id` STRING OPTIONS(description="The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s"),
  `triggering_push_campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `triggering_push_time` TIMESTAMP OPTIONS(description="The UTC time when the push occurred."),
  `triggering_push_variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).")
)
OPTIONS(
  description="Occurs when an in-app button is tapped within a scene."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.IN_APP_EXPERIENCES`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `push_id` STRING OPTIONS(description="A unique identifier for a push operation."),
  `group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment)."),
  `app_defined_id` STRING OPTIONS(description="An identifier defined by the application if the In-App Message was created by the application logic, not Airship. If this field is present, the event body will not contain push_id, group_id, variant_id, or triggering_push fields."),
  `event_name` STRING OPTIONS(description="Name of the experiences event. Possible values: scene_displayed, scene_completed, scene_incomplete, survey_displayed, survey_submitted, survey_not_submitted."),
  `session_id` STRING OPTIONS(description="Represents the 'session' of user activity. Absent if the application was initialized while backgrounded."),
  `survey_type` STRING OPTIONS(description="The survey type, only present for survey events. Possible values: nps, user_feedback."),
  `time_sent` TIMESTAMP OPTIONS(description="An ISO 8601 datetime indicating when the payload defining the In-App Message was sent to the device."),
  `triggering_push_push_id` STRING OPTIONS(description="The push ID of the push that triggered the custom event."),
  `triggering_push_group_id` STRING OPTIONS(description="The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s"),
  `triggering_push_campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `triggering_push_time` TIMESTAMP OPTIONS(description="The UTC time when the push occurred."),
  `triggering_push_variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).")
)
OPTIONS(
  description="Events that occur related to the display and completion behavior of a scene."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.IN_APP_FORM_DISPLAY`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `app_defined_id` STRING OPTIONS(description="An identifier defined by the application if the In-App Form was created by the application logic, not Airship. If this field is present, the event body will not contain push_id, group_id, variant_id, or triggering_push fields."),
  `context_reporting_context_content_types` JSON OPTIONS(description="The content types of the in-app automation."),
  `context_state_form_form_identifier` STRING OPTIONS(description="Is the form controller identifier."),
  `context_state_form_response_type` STRING OPTIONS(description="The form response type. Possible values: nps, user_feedback."),
  `context_state_form_submitted` BOOL OPTIONS(description="Whether the form has been submitted."),
  `context_state_form_type` STRING OPTIONS(description="The form type. Possible values: nps, form."),
  `context_state_pager_completed` BOOL OPTIONS(description="Whether the user reached the end of the pager."),
  `context_state_pager_identifier` STRING OPTIONS(description="The pager controller identifier."),
  `context_state_pager_page_count` NUMERIC OPTIONS(description="The total number of pages."),
  `context_state_pager_page_identifier` STRING OPTIONS(description="The current page identifier."),
  `context_state_pager_page_index` NUMERIC OPTIONS(description="The current pager index."),
  `forms` JSON OPTIONS(description="Information about the forms."),
  `group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `push_id` STRING OPTIONS(description="A unique identifier for a push operation."),
  `session_id` STRING OPTIONS(description="Represents the 'session' of user activity. Absent if the application was initialized while backgrounded."),
  `time_sent` TIMESTAMP OPTIONS(description="An ISO 8601 datetime indicating when the payload defining the In-App Message was sent to the device."),
  `triggering_push_push_id` STRING OPTIONS(description="The push ID of the push that triggered the custom event."),
  `triggering_push_group_id` STRING OPTIONS(description="The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s"),
  `triggering_push_campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `triggering_push_time` TIMESTAMP OPTIONS(description="The UTC time when the push occurred."),
  `triggering_push_variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment)."),
  `in_app_form_event_type` STRING OPTIONS(description="The In-App Form event type. The value is always DISPLAY.")
)
OPTIONS(
  description="Occurs when an in-app form (currently specific to surveys) is displayed."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.IN_APP_FORM_RESULT`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `app_defined_id` STRING OPTIONS(description="An identifier defined by the application if the In-App Form was created by the application logic, not Airship. If this field is present, the event body will not contain push_id, group_id, variant_id, or triggering_push fields."),
  `context_reporting_context_content_types` JSON OPTIONS(description="The content types of the in-app automation."),
  `context_state_form_form_identifier` STRING OPTIONS(description="Is the form controller identifier."),
  `context_state_form_response_type` STRING OPTIONS(description="The form response type. Possible values: nps, user_feedback."),
  `context_state_form_submitted` BOOL OPTIONS(description="Whether the form has been submitted."),
  `context_state_form_type` STRING OPTIONS(description="The form type. Possible values: nps, form."),
  `context_state_pager_completed` BOOL OPTIONS(description="Whether the user reached the end of the pager."),
  `context_state_pager_identifier` STRING OPTIONS(description="The pager controller identifier."),
  `context_state_pager_page_count` NUMERIC OPTIONS(description="The total number of pages."),
  `context_state_pager_page_identifier` STRING OPTIONS(description="The current page identifier."),
  `context_state_pager_page_index` NUMERIC OPTIONS(description="The current pager index."),
  `forms` JSON OPTIONS(description="Information about the forms."),
  `group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `push_id` STRING OPTIONS(description="A unique identifier for a push operation."),
  `session_id` STRING OPTIONS(description="Represents the 'session' of user activity. Absent if the application was initialized while backgrounded."),
  `time_sent` TIMESTAMP OPTIONS(description="An ISO 8601 datetime indicating when the payload defining the In-App Message was sent to the device."),
  `triggering_push_push_id` STRING OPTIONS(description="The push ID of the push that triggered the custom event."),
  `triggering_push_group_id` STRING OPTIONS(description="The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s"),
  `triggering_push_campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `triggering_push_time` TIMESTAMP OPTIONS(description="The UTC time when the push occurred."),
  `triggering_push_variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment)."),
  `in_app_form_event_type` STRING OPTIONS(description="The In-App Form event type. The value is always RESULT.")
)
OPTIONS(
  description="Occurs when an in-app form (currently specific to surveys) is submitted."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.IN_APP_MESSAGE_DISPLAY`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `web_browser_name` STRING OPTIONS(description="The name of the browser running the SDK."),
  `web_browser_type` STRING OPTIONS(description="Indicates whether the browser was running on a desktop or mobile device."),
  `web_browser_version` STRING OPTIONS(description="The version of the browser running the SDK."),
  `web_user_agent_string` STRING OPTIONS(description="The user agent string reported by the browser."),
  `push_id` STRING OPTIONS(description="A unique identifier for a push operation."),
  `app_defined_id` STRING OPTIONS(description="An identifier defined by the application if the In-App Message was created by the application logic, not Airship. If this field is present, the event body will not contain `push_id`, `group_id`,  `variant_id`, or `triggering_push` fields."),
  `group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `session_id` STRING OPTIONS(description="Represents the 'session' of user activity. Absent if the application was initialized while backgrounded."),
  `variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment)."),
  `triggering_push_push_id` STRING OPTIONS(description="The push ID of the push that triggered the custom event."),
  `triggering_push_group_id` STRING OPTIONS(description="The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s"),
  `triggering_push_campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `triggering_push_time` TIMESTAMP OPTIONS(description="The UTC time when the push occurred."),
  `triggering_push_variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment)."),
  `campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.")
)
OPTIONS(
  description="Occurs when an in-app message is displayed to a user. Because the event pertains to a specific device, the device information object will be populated."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.IN_APP_MESSAGE_EXPIRATION`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `web_browser_name` STRING OPTIONS(description="The name of the browser running the SDK."),
  `web_browser_type` STRING OPTIONS(description="Indicates whether the browser was running on a desktop or mobile device."),
  `web_browser_version` STRING OPTIONS(description="The version of the browser running the SDK."),
  `web_user_agent_string` STRING OPTIONS(description="The user agent string reported by the browser."),
  `app_defined_id` STRING OPTIONS(description="An identifier defined by the application if the In-App Message was created by the application logic, not Airship. If this field is present, the event body will not contain `push_id`, `group_id`,  `variant_id`, or `triggering_push` fields."),
  `group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `push_id` STRING OPTIONS(description="A unique identifier for a push operation."),
  `replacing_push_campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `replacing_push_group_id` STRING OPTIONS(description="The specific group_id associated with the new message."),
  `replacing_push_push_id` STRING OPTIONS(description="The specific push_id associated with the new message."),
  `replacing_push_variant_id` STRING OPTIONS(description="The specific variant_id associated with the new message."),
  `replacing_push_time` TIMESTAMP OPTIONS(description="The UTC time when the push occurred."),
  `session_id` STRING OPTIONS(description="Represents the 'session' of user activity. Absent if the application was initialized while backgrounded."),
  `variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment)."),
  `time_expired` TIMESTAMP OPTIONS(description="The date-time when the in-app message payload expires."),
  `time_sent` TIMESTAMP OPTIONS(description="The date-time when the in-app message payload was sent to the device."),
  `expiration_type` STRING OPTIONS(description="Indicates how the in-app message expired."),
  `triggering_push_push_id` STRING OPTIONS(description="The push ID of the push that triggered the custom event."),
  `triggering_push_group_id` STRING OPTIONS(description="The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s"),
  `triggering_push_campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `triggering_push_time` TIMESTAMP OPTIONS(description="The UTC time when the push occurred."),
  `triggering_push_variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).")
)
OPTIONS(
  description="Occurs when a new message has taken the place of another message, a message has passed its expiration, or because displaying the message in-app would be redundant. This event type may be latent; it is not emitted until the app becomes active."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.IN_APP_MESSAGE_RESOLUTION`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `web_browser_name` STRING OPTIONS(description="The name of the browser running the SDK."),
  `web_browser_type` STRING OPTIONS(description="Indicates whether the browser was running on a desktop or mobile device."),
  `web_browser_version` STRING OPTIONS(description="The version of the browser running the SDK."),
  `web_user_agent_string` STRING OPTIONS(description="The user agent string reported by the browser."),
  `push_id` STRING OPTIONS(description="A unique identifier for a push operation."),
  `app_defined_id` STRING OPTIONS(description="An identifier defined by the application if the In-App Message was created by the application logic, not Airship. If this field is present, the event body will not contain `push_id`, `group_id`,  `variant_id`, or `triggering_push` fields."),
  `button_description` STRING OPTIONS(description="The title of the button the user interacted with. Present if `type` is set to `BUTTON_CLICK`."),
  `button_group` STRING OPTIONS(description="A category associated with the button. Present if `type` is set to `BUTTON_CLICK`."),
  `button_id` STRING OPTIONS(description="A unique identifier for the button. Present if `type` is set to `BUTTON_CLICK`."),
  `duration` STRING OPTIONS(description="The number of milliseconds that the user was on the screen."),
  `time_sent` TIMESTAMP OPTIONS(description="The date-time when the in-app message payload was sent to the device."),
  `group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `session_id` STRING OPTIONS(description="Represents the 'session' of user activity. Absent if the application was initialized while backgrounded."),
  `variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment)."),
  `resolution_type` STRING OPTIONS(description="Indicates how the In-App Message was resolved."),
  `triggering_push_push_id` STRING OPTIONS(description="The push ID of the push that triggered the custom event."),
  `triggering_push_group_id` STRING OPTIONS(description="The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s"),
  `triggering_push_campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `triggering_push_time` TIMESTAMP OPTIONS(description="The UTC time when the push occurred."),
  `triggering_push_variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment)."),
  `campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit.")
)
OPTIONS(
  description="Occurs when an In-App Message is cleared from the display, either by user action or timeout. Because this event pertains to an individual device, the device information object will be present."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.IN_APP_PAGER_COMPLETED`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `app_defined_id` STRING OPTIONS(description="An identifier defined by the application if the In-App Pager was created by the application logic, not Airship. If this field is present, the event body will not contain push_id, group_id, variant_id, or triggering_push fields."),
  `context_reporting_context_content_types` JSON OPTIONS(description="The content types of the in-app automation."),
  `context_state_form_form_identifier` STRING OPTIONS(description="Is the form controller identifier."),
  `context_state_form_response_type` STRING OPTIONS(description="The form response type. Possible values: nps, user_feedback."),
  `context_state_form_submitted` BOOL OPTIONS(description="Whether the form has been submitted."),
  `context_state_form_type` STRING OPTIONS(description="The form type. Possible values: nps, form."),
  `context_state_pager_completed` BOOL OPTIONS(description="Whether the user reached the end of the pager."),
  `context_state_pager_identifier` STRING OPTIONS(description="The pager controller identifier."),
  `context_state_pager_page_count` NUMERIC OPTIONS(description="The total number of pages."),
  `context_state_pager_page_identifier` STRING OPTIONS(description="The current page identifier."),
  `context_state_pager_page_index` NUMERIC OPTIONS(description="The current pager index."),
  `group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `rendered_locale` STRING OPTIONS(description="Optional string that defines the country and language this in-app-automation was localized as by remote-config-api. country - (String) an ISO 3166-1 country code, set by device settings. language - (String) The ISO 639-1 two-letter language code reflecting the language the phone is set to."),
  `page_count` NUMERIC OPTIONS(description="The total number of pages."),
  `page_identifier` STRING OPTIONS(description="The current page identifier."),
  `page_index` NUMERIC OPTIONS(description="The current pager index."),
  `pager_identifier` STRING OPTIONS(description="The pager controller identifier."),
  `push_id` STRING OPTIONS(description="A unique identifier for a push operation."),
  `session_id` STRING OPTIONS(description="Represents the 'session' of user activity. Absent if the application was initialized while backgrounded."),
  `time_sent` TIMESTAMP OPTIONS(description="An ISO 8601 datetime indicating when the payload defining the In-App Message was sent to the device."),
  `triggering_push_push_id` STRING OPTIONS(description="The push ID of the push that triggered the custom event."),
  `triggering_push_group_id` STRING OPTIONS(description="The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s"),
  `triggering_push_campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `triggering_push_time` TIMESTAMP OPTIONS(description="The UTC time when the push occurred."),
  `triggering_push_variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).")
)
OPTIONS(
  description="Occurs when the last page (screen) of a pager is viewed for the first time (currently specific to Scenes & Surveys)."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.IN_APP_PAGER_SUMMARY`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `app_defined_id` STRING OPTIONS(description="An identifier defined by the application if the In-App Pager was created by the application logic, not Airship. If this field is present, the event body will not contain push_id, group_id, variant_id, or triggering_push fields."),
  `completed` BOOL OPTIONS(description="Whether the user has reached the end of the pager."),
  `context_reporting_context_content_types` JSON OPTIONS(description="The content types of the in-app automation."),
  `context_state_form_form_identifier` STRING OPTIONS(description="Is the form controller identifier."),
  `context_state_form_response_type` STRING OPTIONS(description="The form response type. Possible values: nps, user_feedback."),
  `context_state_form_submitted` BOOL OPTIONS(description="Whether the form has been submitted."),
  `context_state_form_type` STRING OPTIONS(description="The form type. Possible values: nps, form."),
  `context_state_pager_completed` BOOL OPTIONS(description="Whether the user reached the end of the pager."),
  `context_state_pager_identifier` STRING OPTIONS(description="The pager controller identifier."),
  `context_state_pager_page_count` NUMERIC OPTIONS(description="The total number of pages."),
  `context_state_pager_page_identifier` STRING OPTIONS(description="The current page identifier."),
  `context_state_pager_page_index` NUMERIC OPTIONS(description="The current pager index."),
  `group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `rendered_locale` STRING OPTIONS(description="Optional string that defines the country and language this in-app-automation was localized as by remote-config-api. country - (String) an ISO 3166-1 country code, set by device settings. language - (String) The ISO 639-1 two-letter language code reflecting the language the phone is set to."),
  `page_count` NUMERIC OPTIONS(description="The total number of pages."),
  `page_identifier` STRING OPTIONS(description="The current page identifier."),
  `pager_identifier` STRING OPTIONS(description="The pager controller identifier."),
  `push_id` STRING OPTIONS(description="A unique identifier for a push operation."),
  `session_id` STRING OPTIONS(description="Represents the 'session' of user activity. Absent if the application was initialized while backgrounded."),
  `time_sent` TIMESTAMP OPTIONS(description="An ISO 8601 datetime indicating when the payload defining the In-App Message was sent to the device."),
  `triggering_push_push_id` STRING OPTIONS(description="The push ID of the push that triggered the custom event."),
  `triggering_push_group_id` STRING OPTIONS(description="The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s"),
  `triggering_push_campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `triggering_push_time` TIMESTAMP OPTIONS(description="The UTC time when the push occurred."),
  `triggering_push_variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment)."),
  `viewed_pages` JSON OPTIONS(description="Information about each viewed page.")
)
OPTIONS(
  description="Describes the full path a user took within a pager (currently specific to Scenes), including the order of pages (screens) visited and time spent per page."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.IN_APP_PAGE_SWIPE`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `app_defined_id` STRING OPTIONS(description="An identifier defined by the application if the In-App Pager was created by the application logic, not Airship. If this field is present, the event body will not contain push_id, group_id, variant_id, or triggering_push fields."),
  `context_reporting_context_content_types` JSON OPTIONS(description="The content types of the in-app automation."),
  `context_state_form_form_identifier` STRING OPTIONS(description="Is the form controller identifier."),
  `context_state_form_response_type` STRING OPTIONS(description="The form response type. Possible values: nps, user_feedback."),
  `context_state_form_submitted` BOOL OPTIONS(description="Whether the form has been submitted."),
  `context_state_form_type` STRING OPTIONS(description="The form type. Possible values: nps, form."),
  `context_state_pager_completed` BOOL OPTIONS(description="Whether the user reached the end of the pager."),
  `context_state_pager_identifier` STRING OPTIONS(description="The pager controller identifier."),
  `context_state_pager_page_count` NUMERIC OPTIONS(description="The total number of pages."),
  `context_state_pager_page_identifier` STRING OPTIONS(description="The current page identifier."),
  `context_state_pager_page_index` NUMERIC OPTIONS(description="The current pager index."),
  `from_page_index` NUMERIC OPTIONS(description="The previous page index"),
  `from_page_identifier` STRING OPTIONS(description="The previous page identifier."),
  `group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `rendered_locale` STRING OPTIONS(description="Optional string that defines the country and language this in-app-automation was localized as by remote-config-api. country - (String) an ISO 3166-1 country code, set by device settings. language - (String) The ISO 639-1 two-letter language code reflecting the language the phone is set to."),
  `pager_identifier` STRING OPTIONS(description="The pager controller identifier."),
  `push_id` STRING OPTIONS(description="A unique identifier for a push operation."),
  `session_id` STRING OPTIONS(description="Represents the 'session' of user activity. Absent if the application was initialized while backgrounded."),
  `time_sent` TIMESTAMP OPTIONS(description="An ISO 8601 datetime indicating when the payload defining the In-App Message was sent to the device."),
  `to_page_identifier` STRING OPTIONS(description="The current page identifier"),
  `to_page_index` NUMERIC OPTIONS(description="The current page index"),
  `triggering_push_push_id` STRING OPTIONS(description="The push ID of the push that triggered the custom event."),
  `triggering_push_group_id` STRING OPTIONS(description="The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s"),
  `triggering_push_campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `triggering_push_time` TIMESTAMP OPTIONS(description="The UTC time when the push occurred."),
  `triggering_push_variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).")
)
OPTIONS(
  description="Occurs when a user swipes to the next or previous page (screen) in a pager (currently specific to Scenes)."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.IN_APP_PAGE_VIEW`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `app_defined_id` STRING OPTIONS(description="An identifier defined by the application if the In-App Pager was created by the application logic, not Airship. If this field is present, the event body will not contain push_id, group_id, variant_id, or triggering_push fields."),
  `completed` BOOL OPTIONS(description="Whether the user has reached the end of the pager."),
  `context_reporting_context_content_types` JSON OPTIONS(description="The content types of the in-app automation."),
  `context_state_form_form_identifier` STRING OPTIONS(description="Is the form controller identifier."),
  `context_state_form_response_type` STRING OPTIONS(description="The form response type. Possible values: nps, user_feedback."),
  `context_state_form_submitted` BOOL OPTIONS(description="Whether the form has been submitted."),
  `context_state_form_type` STRING OPTIONS(description="The form type. Possible values: nps, form."),
  `context_state_pager_completed` BOOL OPTIONS(description="Whether the user reached the end of the pager."),
  `context_state_pager_identifier` STRING OPTIONS(description="The pager controller identifier."),
  `context_state_pager_page_count` NUMERIC OPTIONS(description="The total number of pages."),
  `context_state_pager_page_identifier` STRING OPTIONS(description="The current page identifier."),
  `context_state_pager_page_index` NUMERIC OPTIONS(description="The current pager index."),
  `group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `rendered_locale` STRING OPTIONS(description="Optional string that defines the country and language this in-app-automation was localized as by remote-config-api. country - (String) an ISO 3166-1 country code, set by device settings. language - (String) The ISO 639-1 two-letter language code reflecting the language the phone is set to."),
  `page_count` NUMERIC OPTIONS(description="The total number of pages."),
  `page_identifier` STRING OPTIONS(description="The current page identifier."),
  `page_index` NUMERIC OPTIONS(description="The current pager index."),
  `pager_identifier` STRING OPTIONS(description="The pager controller identifier."),
  `push_id` STRING OPTIONS(description="A unique identifier for a push operation."),
  `session_id` STRING OPTIONS(description="Represents the 'session' of user activity. Absent if the application was initialized while backgrounded."),
  `time_sent` TIMESTAMP OPTIONS(description="An ISO 8601 datetime indicating when the payload defining the In-App Message was sent to the device."),
  `triggering_push_push_id` STRING OPTIONS(description="The push ID of the push that triggered the custom event."),
  `triggering_push_group_id` STRING OPTIONS(description="The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s"),
  `triggering_push_campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `triggering_push_time` TIMESTAMP OPTIONS(description="The UTC time when the push occurred."),
  `triggering_push_variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment)."),
  `viewed_count` NUMERIC OPTIONS(description="The number of times the current page has been viewed.")
)
OPTIONS(
  description="Occurs when a page (screen) is displayed within a pager (currently specific to Scenes & Surveys)."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.MOBILE_ORIGINATED`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `delivery_address` STRING OPTIONS(description="The address of the device."),
  `msisdn` STRING OPTIONS(description="The mobile number of the device."),
  `sender` STRING OPTIONS(description="The email address or number of the sender."),
  `keyword` STRING OPTIONS(description="The specific keyword used in the inbound message, if recognized; the keyword in the inbound_message determines the outbound_message sent to the device. If a keyword could not be matched in the inbound_message, this field is absent."),
  `inbound_message` STRING OPTIONS(description="The contents of the message received from an SMS device."),
  `outbound_message` STRING OPTIONS(description="The response sent to the SMS device, based on the inbound message and keyword.")
)
OPTIONS(
  description="Represents a message action that originated from a user — like an inbound SMS or email."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.OPEN`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `web_browser_name` STRING OPTIONS(description="The name of the browser running the SDK."),
  `web_browser_type` STRING OPTIONS(description="Indicates whether the browser was running on a desktop or mobile device."),
  `web_browser_version` STRING OPTIONS(description="The version of the browser running the SDK."),
  `web_user_agent_string` STRING OPTIONS(description="The user agent string reported by the browser."),
  `session_id` STRING OPTIONS(description="Represents the 'session' of user activity. Absent if the application was initialized while backgrounded."),
  `triggering_push_push_id` STRING OPTIONS(description="The push ID of the push that triggered the custom event."),
  `triggering_push_group_id` STRING OPTIONS(description="The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s"),
  `triggering_push_campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `triggering_push_time` TIMESTAMP OPTIONS(description="The UTC time when the push occurred."),
  `triggering_push_variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment)."),
  `last_delivered_push_id` STRING OPTIONS(description="Identifies the last push notification the audience received before the event. Absent if the last push occurred more than 12 hours ago."),
  `last_delivered_group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `last_delivered_campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `last_delivered_time` TIMESTAMP OPTIONS(description="The UTC time when the push occurred."),
  `last_delivered_variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).")
)
OPTIONS(
  description="Occurs when a user opens your app."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.PUSH_BODY`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `push_id` STRING OPTIONS(description="A unique identifier for a push operation."),
  `campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `trimmed` BOOL OPTIONS(description="If true, the push payload was trimmed from the event body."),
  `resource` STRING OPTIONS(description="Describes the type of push, helping you interpret the JSON response. Possible values: PIPELINES, SCHEDULES, PUSH, EXPERIMENTS, IN_APP_AUTOMATION"),
  `payload` STRING OPTIONS(description="The specification of the push as sent via the API, a Base64 encoded JSON value.")
)
OPTIONS(
  description="Occurs when you initiate a push, automation, or sequence.Airship fulfills delivery over a time interval with a number of child pushes, each with a unique Push ID and a common Group ID. There is no guarantee that push body events (defined in Push Body Event) for the child pushes fulfilling a group will appear in the stream.**Note:** When you start, pause, or publish a sequence, Airship emits a `push_body` event for the sequence itself, and each message contained within the sequence (i.e. messages +1). After you start a sequence, Airship does not issue subsequent `push_body` events for the sequence unless you pause or publish changes to the sequence."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.REGION`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `web_browser_name` STRING OPTIONS(description="The name of the browser running the SDK."),
  `web_browser_type` STRING OPTIONS(description="Indicates whether the browser was running on a desktop or mobile device."),
  `web_browser_version` STRING OPTIONS(description="The version of the browser running the SDK."),
  `web_user_agent_string` STRING OPTIONS(description="The user agent string reported by the browser."),
  `session_id` STRING OPTIONS(description="Represents the 'session' of user activity. Absent if the application was initialized while backgrounded."),
  `action` STRING OPTIONS(description="Indicates whether the event was the result of a user entering or exiting the region."),
  `name` STRING OPTIONS(description="A friendly name for the region; may be retrieved from a third-party location provider.  "),
  `region_id` STRING OPTIONS(description="A unique identifier for the region in Airship, UUID format."),
  `source_info_source` STRING OPTIONS(description="Information about the source application that generated the event."),
  `source_info_region_id` STRING OPTIONS(description="The unique region identifier from the originating system or location provider.")
)
OPTIONS(
  description="Region Events are emitted when a device enters or exits a geofence or the range of any of a set of bluetooth beacons. Region events require a Gimbal integration. Events for Gimbal customers include the Gimbal application instance identifer as `com.urbanairship.gimbal.aii` within the `identifiers` object."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.RICH_CONTROL`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `web_browser_name` STRING OPTIONS(description="The name of the browser running the SDK."),
  `web_browser_type` STRING OPTIONS(description="Indicates whether the browser was running on a desktop or mobile device."),
  `web_browser_version` STRING OPTIONS(description="The version of the browser running the SDK."),
  `web_user_agent_string` STRING OPTIONS(description="The user agent string reported by the browser."),
  `campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `push_id` STRING OPTIONS(description="A unique identifier for a push operation."),
  `group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).")
)
OPTIONS(
  description="Occurs when a Message Center message is not delivered to a user because they are in a control group for a Sequence A/B test or Holdout Experiment."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.RICH_DELETE`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `web_browser_name` STRING OPTIONS(description="The name of the browser running the SDK."),
  `web_browser_type` STRING OPTIONS(description="Indicates whether the browser was running on a desktop or mobile device."),
  `web_browser_version` STRING OPTIONS(description="The version of the browser running the SDK."),
  `web_user_agent_string` STRING OPTIONS(description="The user agent string reported by the browser."),
  `campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `push_id` STRING OPTIONS(description="A unique identifier for a push operation."),
  `group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).")
)
OPTIONS(
  description="Occurs when a user deletes a rich message from their inbox."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.RICH_DELIVERY`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `web_browser_name` STRING OPTIONS(description="The name of the browser running the SDK."),
  `web_browser_type` STRING OPTIONS(description="Indicates whether the browser was running on a desktop or mobile device."),
  `web_browser_version` STRING OPTIONS(description="The version of the browser running the SDK."),
  `web_user_agent_string` STRING OPTIONS(description="The user agent string reported by the browser."),
  `campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `push_id` STRING OPTIONS(description="A unique identifier for a push operation."),
  `group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).")
)
OPTIONS(
  description="Occurs when a rich message is delivered to a user's inbox. Even though rich push deliveries may or may not cause an alert on the user’s lock screen, they are always associated with a push identifier in the Airship system."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.RICH_READ`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `web_browser_name` STRING OPTIONS(description="The name of the browser running the SDK."),
  `web_browser_type` STRING OPTIONS(description="Indicates whether the browser was running on a desktop or mobile device."),
  `web_browser_version` STRING OPTIONS(description="The version of the browser running the SDK."),
  `web_user_agent_string` STRING OPTIONS(description="The user agent string reported by the browser."),
  `campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `push_id` STRING OPTIONS(description="A unique identifier for a push operation."),
  `group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).")
)
OPTIONS(
  description="Occurs when a user reads a rich message in their inbox."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.SCREEN_VIEWED`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `web_browser_name` STRING OPTIONS(description="The name of the browser running the SDK."),
  `web_browser_type` STRING OPTIONS(description="Indicates whether the browser was running on a desktop or mobile device."),
  `web_browser_version` STRING OPTIONS(description="The version of the browser running the SDK."),
  `web_user_agent_string` STRING OPTIONS(description="The user agent string reported by the browser."),
  `session_id` STRING OPTIONS(description="Represents the 'session' of user activity. Absent if the application was initialized while backgrounded."),
  `duration` STRING OPTIONS(description="The number of milliseconds that the user was on the screen."),
  `viewed_screen` STRING OPTIONS(description="The name assigned to the screen that the user left."),
  `previous_screen` STRING OPTIONS(description="The name assigned to the screen the user was on prior to the viewed screen.")
)
OPTIONS(
  description="Occurs when a user has finished viewing a screen. It is up to you to instrument your application with names for each screen. Doing so will allow you to deterimine the user’s path by filtering on the fields in the table below."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.SEND`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `web_browser_name` STRING OPTIONS(description="The name of the browser running the SDK."),
  `web_browser_type` STRING OPTIONS(description="Indicates whether the browser was running on a desktop or mobile device."),
  `web_browser_version` STRING OPTIONS(description="The version of the browser running the SDK."),
  `web_user_agent_string` STRING OPTIONS(description="The user agent string reported by the browser."),
  `open_platform_name` STRING OPTIONS(description="If device_type is set to OPEN, this field shows the full name of the platform."),
  `alerting` BOOL OPTIONS(description="If true, the send event was alerting. Alerting send event has notification text, badge, or sound."),
  `campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `push_id` STRING OPTIONS(description="A unique identifier for a push operation."),
  `group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment)."),
  `context_triggered_by` STRING OPTIONS(description="The triggering event type."),
  `context_event_uuid` STRING OPTIONS(description="The ID of the custom event which triggered the send."),
  `context_interaction_id` STRING OPTIONS(description="If interaction_id was set on the custom event body, it will be populated here."),
  `context_transaction` STRING OPTIONS(description="If transaction was set on the custom event body, it will be populated here.")
)
OPTIONS(
  description="Occurs whenever a push notification is sent to a device identified in the audience selector of a message."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.SEND_ABORTED`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `push_id` STRING OPTIONS(description="A unique identifier for a push operation."),
  `group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `reason` STRING OPTIONS(description="Describes the reason this push was aborted.")
)
OPTIONS(
  description="Occurs when a push is dropped from our system before delivery is attempted. This can happen if you are using External Data Feeds to personalize a message and an error was encountered or the feed returned a non-successful response, or when reaching a Message Limit. Device information for the device that did not receive the push is included with `SEND_ABORTED` events."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.SEND_REJECTED`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment)."),
  `push_id` STRING OPTIONS(description="A unique identifier for a push operation."),
  `group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification.")
)
OPTIONS(
  description="Occurs when a push fails during communication with a third party, like APNs or GCM. This typically indicates that the user has uninstalled the app or otherwise invalidated the last-registered credentials stored in Airship. The event contains the rejected push and the group, variant, or campaigns the push belonged to.Device information for the device that did not receive the push is included with `SEND_REJECTED` events."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.SHORT_LINK_CLICK`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `web_browser_name` STRING OPTIONS(description="The name of the browser running the SDK."),
  `web_browser_type` STRING OPTIONS(description="Indicates whether the browser was running on a desktop or mobile device."),
  `web_browser_version` STRING OPTIONS(description="The version of the browser running the SDK."),
  `web_user_agent_string` STRING OPTIONS(description="The user agent string reported by the browser."),
  `campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `push_id` STRING OPTIONS(description="A unique identifier for a push operation."),
  `original_url` STRING OPTIONS(description="The URL that was clicked."),
  `delivery_address` STRING OPTIONS(description="The address of the device."),
  `sender` STRING OPTIONS(description="The email address or number of the sender.")
)
OPTIONS(
  description="Occurs when a user taps or 'clicks' an Airship-shortened link in an SMS or MMS message."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.SUBSCRIPTION`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `delivery_address` STRING OPTIONS(description="The address of the device."),
  `subscription_event_type` STRING OPTIONS(description="Determines the source of the subscription event. registration and create_and_s if not existsend events result in changes to opted_in dates; all other event types contain opted_out dates."),
  `subscription_identifiers_address` STRING OPTIONS(description="The email address representing the change."),
  `commercial_opted_in` TIMESTAMP OPTIONS(description="The date and time when the address opted into commercial email messages."),
  `transactional_opted_in` TIMESTAMP OPTIONS(description="The date and time when the address opted into transactional email messages.")
)
OPTIONS(
  description="Reflect changes to users' subscription preferences — reflected in opt_in and opt_out values. These events help you track a user''s subscription status in the system and the total number of subscribers."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.TAG_CHANGE`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `web_browser_name` STRING OPTIONS(description="The name of the browser running the SDK."),
  `web_browser_type` STRING OPTIONS(description="Indicates whether the browser was running on a desktop or mobile device."),
  `web_browser_version` STRING OPTIONS(description="The version of the browser running the SDK."),
  `web_user_agent_string` STRING OPTIONS(description="The user agent string reported by the browser."),
  `tags_add` JSON OPTIONS(description="Tag group/tag pairs added to the device. Each tag group is an array containing one or more tags within this object."),
  `tags_current` JSON OPTIONS(description="The total set/state of tag group/tag pairs associated with the device after the tag change. Each tag group is an array containing one or more tags within this object."),
  `tags_remove` JSON OPTIONS(description="Tag group/tag pairs removed from the device. Each tag group is an array containing one or more tags within this object.")
)
OPTIONS(
  description="Occurs when tags change for a device."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.UNINSTALL`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `custom_identifiers` JSON OPTIONS(description="The custom identifiers associated with the app channel, stored as an object."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `app_version` STRING OPTIONS(description="The version of the app installed on the device."),
  `device_model` STRING OPTIONS(description="The model of the device."),
  `connection_type` STRING OPTIONS(description="The internet connection type used by the device."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `device_os` STRING OPTIONS(description="The operating system of the device."),
  `carrier` STRING OPTIONS(description="The wireless carrier used by the device."),
  `location_enabled` BOOL OPTIONS(description="Whether the device has location services enabled."),
  `location_permission` STRING OPTIONS(description="Location permission level as configured in device settings."),
  `background_push_enabled` BOOL OPTIONS(description="Whether the device has background push notifications enabled."),
  `web_browser_name` STRING OPTIONS(description="The name of the browser running the SDK."),
  `web_browser_type` STRING OPTIONS(description="Indicates whether the browser was running on a desktop or mobile device."),
  `web_browser_version` STRING OPTIONS(description="The version of the browser running the SDK."),
  `web_user_agent_string` STRING OPTIONS(description="The user agent string reported by the browser."),
  `decay` BOOL OPTIONS(description="If true, Airship recorded an uninstall event due to user inactivity.")
)
OPTIONS(
  description="Occurs when a user uninstalls an Airship-integrated app in response to a push."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.WEB_CLICK`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `web_browser_name` STRING OPTIONS(description="The name of the browser running the SDK."),
  `web_browser_type` STRING OPTIONS(description="Indicates whether the browser was running on a desktop or mobile device."),
  `web_browser_version` STRING OPTIONS(description="The version of the browser running the SDK."),
  `web_user_agent_string` STRING OPTIONS(description="The user agent string reported by the browser."),
  `campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `push_id` STRING OPTIONS(description="A unique identifier for a push operation."),
  `group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment).")
)
OPTIONS(
  description="Occurs when a user interacts with a web notification, e.g., clicked or tapped it. Web Click events have a device attribute on the event indicating the channel that was the target of the notification. The body of a Web Click Event is an Associated Push object."
);


CREATE TABLE IF NOT EXISTS `PROJECT_ID.AIRSHIP_EVENTS.WEB_SESSION`
(
  `id` STRING NOT NULL OPTIONS(description="The event ID"),
  `offset` STRING OPTIONS(description="The offset of the event that represents the location of the event in the stream."),
  `occurred` TIMESTAMP OPTIONS(description="The time the event occurred."),
  `processed` TIMESTAMP OPTIONS(description="The time the event was processed."),
  `app_key` STRING OPTIONS(description="The identifier for the Airship project."),
  `channel` STRING NOT NULL OPTIONS(description="The unique, platform-agnostic channel identifier for a device."),
  `device_type` STRING OPTIONS(description="The platform of the channel"),
  `named_user` STRING OPTIONS(description="The named user identifier associated with the channel."),
  `locale_variant` STRING OPTIONS(description="The language variant as reported by the device."),
  `locale_country_code` STRING OPTIONS(description="The ISO 3166-1 country code as defined in device settings."),
  `locale_timezone` STRING OPTIONS(description="The timezone as reported by the device offset in seconds from UTC."),
  `locale_language_code` STRING OPTIONS(description="The ISO 639-1 two-letter language code as defined in device settings."),
  `iana_timezone` STRING OPTIONS(description="The IANA timezone of the device."),
  `push_opt_in` BOOL OPTIONS(description="Whether the user has opted in to push notifications."),
  `ua_sdk_version` STRING OPTIONS(description="The version of the Airship SDK used to record the event."),
  `web_browser_name` STRING OPTIONS(description="The name of the browser running the SDK."),
  `web_browser_type` STRING OPTIONS(description="Indicates whether the browser was running on a desktop or mobile device."),
  `web_browser_version` STRING OPTIONS(description="The version of the browser running the SDK."),
  `web_user_agent_string` STRING OPTIONS(description="The user agent string reported by the browser."),
  `last_delivered_push_id` STRING OPTIONS(description="Identifies the last push notification the audience received before the event. Absent if the last push occurred more than 12 hours ago."),
  `last_delivered_group_id` STRING OPTIONS(description="Identifies a push specification delivered over an interval of time, e.g. multiple push_ids as part of the fulfillment of an automation pipeline or a push-to-local-time specification."),
  `last_delivered_campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `last_delivered_time` TIMESTAMP OPTIONS(description="The UTC time when the push occurred."),
  `last_delivered_variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment)."),
  `triggering_push_push_id` STRING OPTIONS(description="The push ID of the push that triggered the custom event."),
  `triggering_push_group_id` STRING OPTIONS(description="The specific `push_id` and accompanying identifiers associated with an event. An associated push helps you trace an event to the original notification or operation. An associated push object may specify a `time`, if the push was a singular operation sent at a defined time. Otherwise, the object will include a `group_id` if the push was sent at a relative time (`best_time` or `local_time`) an automation pipeline, or another operation resulting in multiple `push_id`s"),
  `triggering_push_campaigns` JSON OPTIONS(description="An object listing the campaigns a push specification is associated with. The campaigns object includes an array of categories that must have between 1 and 10 elements, each of which is a string with a 64-byte and -character limit."),
  `triggering_push_time` TIMESTAMP OPTIONS(description="The UTC time when the push occurred."),
  `triggering_push_variant_id` STRING OPTIONS(description="The ID of the variant that a push is associated with, if the push was a part of an A/B test (experiment)."),
  `session_id` STRING OPTIONS(description="Represents the 'session' of user activity. Absent if the application was initialized while backgrounded.")
)
OPTIONS(
  description="Occurs when an opted in user begins interacting with a website. Web Session events have a device attribute, indicating the channel associated with the user."
);




-- List tables using: SELECT table_name FROM `PROJECT_ID.AIRSHIP_EVENTS.INFORMATION_SCHEMA.TABLES`

Schema and file changes

Airship may occasionally add additional columns to the exported CSV files. Column order will remain the same and any new columns will be appended. When creating your data pipelines we recommend ignoring additional columns to prevent any additions from breaking your data loads. If you encounter data load errors, you can recover from your staged files to ensure that no Airship event data is lost.

Changes will be noted in a changelog along with example migrations.