From c6d1b5f909342b316ec0a5846f8e2d3b2dc067ba Mon Sep 17 00:00:00 2001 From: ykurochkin Date: Fri, 12 Feb 2021 18:44:27 +0200 Subject: [PATCH 1/7] #1945 Issue: update SingerHelper read method --- .../bases/base-singer/base_singer/singer_helpers.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/airbyte-integrations/bases/base-singer/base_singer/singer_helpers.py b/airbyte-integrations/bases/base-singer/base_singer/singer_helpers.py index c460fc290473..63c58ba77025 100644 --- a/airbyte-integrations/bases/base-singer/base_singer/singer_helpers.py +++ b/airbyte-integrations/bases/base-singer/base_singer/singer_helpers.py @@ -166,12 +166,16 @@ def read(logger, shell_command, is_message=(lambda x: True), transform=(lambda x sel = selectors.DefaultSelector() sel.register(p.stdout, selectors.EVENT_READ) sel.register(p.stderr, selectors.EVENT_READ) - ok = True - while ok: - for key, val1 in sel.select(): + eof = False + while not eof: + selects_list = sel.select() + empty_line_counter = 0 + for key, val1 in selects_list: line = key.fileobj.readline() if not line: - ok = False + empty_line_counter += 1 + if empty_line_counter >= len(selects_list): + eof = True elif key.fileobj is p.stdout: out_json = to_json(line) if out_json is not None and is_message(out_json): From 9bb2ee16e9a328624353c11f7e8e8a753a9a20b7 Mon Sep 17 00:00:00 2001 From: ykurochkin Date: Mon, 15 Feb 2021 12:13:13 +0200 Subject: [PATCH 2/7] #1945 Issue: Breaking the 'read' method into smaller functions --- .../base-singer/base_singer/singer_helpers.py | 89 +++++++++++-------- 1 file changed, 52 insertions(+), 37 deletions(-) diff --git a/airbyte-integrations/bases/base-singer/base_singer/singer_helpers.py b/airbyte-integrations/bases/base-singer/base_singer/singer_helpers.py index 63c58ba77025..7c37f4e7b7a4 100644 --- a/airbyte-integrations/bases/base-singer/base_singer/singer_helpers.py +++ b/airbyte-integrations/bases/base-singer/base_singer/singer_helpers.py @@ -163,44 +163,59 @@ def get_catalogs(logger, shell_command: str, sync_mode_overrides: Dict[str, Sync @staticmethod def read(logger, shell_command, is_message=(lambda x: True), transform=(lambda x: x)) -> Generator[AirbyteMessage, None, None]: with subprocess.Popen(shell_command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) as p: - sel = selectors.DefaultSelector() - sel.register(p.stdout, selectors.EVENT_READ) - sel.register(p.stderr, selectors.EVENT_READ) - eof = False - while not eof: - selects_list = sel.select() - empty_line_counter = 0 - for key, val1 in selects_list: - line = key.fileobj.readline() - if not line: - empty_line_counter += 1 - if empty_line_counter >= len(selects_list): - eof = True - elif key.fileobj is p.stdout: - out_json = to_json(line) - if out_json is not None and is_message(out_json): - transformed_json = transform(out_json) - if transformed_json is not None: - if transformed_json.get("type") == "SCHEMA" or transformed_json.get("type") == "ACTIVATE_VERSION": - pass - elif transformed_json.get("type") == "STATE": - out_record = AirbyteStateMessage(data=transformed_json["value"]) - out_message = AirbyteMessage(type=Type.STATE, state=out_record) - yield transform(out_message) - else: - # todo: check that messages match the discovered schema - stream_name = transformed_json["stream"] - out_record = AirbyteRecordMessage( - stream=stream_name, - data=transformed_json["record"], - emitted_at=int(datetime.now().timestamp()) * 1000, - ) - out_message = AirbyteMessage(type=Type.RECORD, record=out_record) - yield transform(out_message) - else: - logger.log_by_prefix(line, "INFO") + for std_data in SingerHelper._read_std_rows(p, is_message, transform): + if isinstance(std_data, AirbyteMessage): + yield std_data + else: + logger.log_by_prefix(*std_data) + + @staticmethod + def _read_std_rows(process: subprocess.Popen, is_message, transform) -> Generator[AirbyteMessage, None, None]: + sel = selectors.DefaultSelector() + sel.register(process.stdout, selectors.EVENT_READ) + sel.register(process.stderr, selectors.EVENT_READ) + eof = False + while not eof: + selects_list = sel.select() + empty_line_counter = 0 + for key, val1 in selects_list: + line = key.fileobj.readline() + if not line: + empty_line_counter += 1 + if empty_line_counter >= len(selects_list): + eof = True + elif key.fileobj is process.stdout: + out_json = to_json(line) + if out_json is not None and is_message(out_json): + message_data = SingerHelper._classify_and_convert_out_json_to_airbyte_message(out_json, transform) + if message_data is not None: + yield message_data else: - logger.log_by_prefix(line, "ERROR") + yield line, "INFO" + else: + yield line, "ERROR" + + @staticmethod + def _classify_and_convert_out_json_to_airbyte_message(out_json: Dict, transform) -> AirbyteMessage: + transformed_json = transform(out_json) + if transformed_json is not None: + if transformed_json.get("type") == "SCHEMA" or transformed_json.get( + "type") == "ACTIVATE_VERSION": + pass + elif transformed_json.get("type") == "STATE": + out_record = AirbyteStateMessage(data=transformed_json["value"]) + out_message = AirbyteMessage(type=Type.STATE, state=out_record) + return transform(out_message) + else: + # todo: check that messages match the discovered schema + stream_name = transformed_json["stream"] + out_record = AirbyteRecordMessage( + stream=stream_name, + data=transformed_json["record"], + emitted_at=int(datetime.now().timestamp()) * 1000, + ) + out_message = AirbyteMessage(type=Type.RECORD, record=out_record) + return transform(out_message) @staticmethod def create_singer_catalog_with_selection(masked_airbyte_catalog: ConfiguredAirbyteCatalog, discovered_singer_catalog: object) -> str: From ed383c5bd05c9d7b23511a44b4b9fcc1d727c470 Mon Sep 17 00:00:00 2001 From: ykurochkin Date: Mon, 15 Feb 2021 12:27:21 +0200 Subject: [PATCH 3/7] some fixes after resolving conflict --- .../bases/base-singer/base_singer/singer_helpers.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/airbyte-integrations/bases/base-singer/base_singer/singer_helpers.py b/airbyte-integrations/bases/base-singer/base_singer/singer_helpers.py index df59e0e9b94b..fbd3b25b3ffd 100644 --- a/airbyte-integrations/bases/base-singer/base_singer/singer_helpers.py +++ b/airbyte-integrations/bases/base-singer/base_singer/singer_helpers.py @@ -188,10 +188,10 @@ def _read_std_rows(process: subprocess.Popen, is_message, transform) -> Generato try: process.wait(timeout=60) except subprocess.TimeoutExpired: - raise Exception(f"Underlying command {shell_command} is hanging") + raise Exception(f"Underlying command {process.args} is hanging") if process.returncode != 0: - raise Exception(f"Underlying command {shell_command} failed with exit code {p.returncode}") + raise Exception(f"Underlying command {process.args} failed with exit code {process.returncode}") elif key.fileobj is process.stdout: out_json = to_json(line) @@ -208,8 +208,7 @@ def _read_std_rows(process: subprocess.Popen, is_message, transform) -> Generato def _classify_and_convert_out_json_to_airbyte_message(out_json: Dict, transform) -> AirbyteMessage: transformed_json = transform(out_json) if transformed_json is not None: - if transformed_json.get("type") == "SCHEMA" or transformed_json.get( - "type") == "ACTIVATE_VERSION": + if transformed_json.get("type") == "SCHEMA" or transformed_json.get("type") == "ACTIVATE_VERSION": pass elif transformed_json.get("type") == "STATE": out_record = AirbyteStateMessage(data=transformed_json["value"]) From 2de4c332ecd4866dc639273638b800af4f4b9893 Mon Sep 17 00:00:00 2001 From: ykurochkin Date: Mon, 15 Feb 2021 12:40:16 +0200 Subject: [PATCH 4/7] update code using run command 'format' --- .../configured_catalog_adcreatives.json | 3844 ++++------------- 1 file changed, 769 insertions(+), 3075 deletions(-) diff --git a/airbyte-integrations/connectors/source-facebook-marketing/sample_files/configured_catalog_adcreatives.json b/airbyte-integrations/connectors/source-facebook-marketing/sample_files/configured_catalog_adcreatives.json index 245dd120ba85..6a0668ef5268 100644 --- a/airbyte-integrations/connectors/source-facebook-marketing/sample_files/configured_catalog_adcreatives.json +++ b/airbyte-integrations/connectors/source-facebook-marketing/sample_files/configured_catalog_adcreatives.json @@ -6,46 +6,25 @@ "json_schema": { "properties": { "body": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "object_story_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "image_url": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "account_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "actor_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "adlabels": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { "type": "object", "properties": { @@ -67,238 +46,124 @@ } }, "applink_treatment": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "call_to_action_type": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "effective_instagram_story_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "effective_object_story_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "title": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "image_crops": { "properties": { "100x100": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "100x72": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "191x100": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "400x150": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "400x500": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "600x360": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "90x160": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] } }, - "type": [ - "null", - "object" - ] + "type": ["null", "object"] }, "instagram_actor_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "instagram_permalink_url": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "instagram_story_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "link_og_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "object_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "object_story_spec": { "properties": { "page_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "instagram_actor_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "link_data": { "properties": { "additional_image_index": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, "app_link_spec": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "android": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { "type": "object", "properties": { @@ -318,10 +183,7 @@ } }, "ios": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { "type": "object", "properties": { @@ -338,10 +200,7 @@ } }, "ipad": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { "type": "object", "properties": { @@ -358,10 +217,7 @@ } }, "iphone": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { "type": "object", "properties": { @@ -380,676 +236,352 @@ } }, "attachment_style": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "branded_content_sponsor_page_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "branded_content_sponsor_relationship": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "call_to_action": { "properties": { "value": { "properties": { "app_destination": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "app_link": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "application": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "event_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "lead_gen_form_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "link": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "link_caption": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "link_format": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "page": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "product_link": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } }, - "type": [ - "null", - "object" - ] + "type": ["null", "object"] }, "type": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } }, - "type": [ - "null", - "object" - ] + "type": ["null", "object"] }, "caption": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "child_attachments": { "items": { "properties": { "image_hash": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "link": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "call_to_action": { "properties": { "value": { "properties": { "app_destination": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "app_link": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "application": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "event_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "lead_gen_form_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "link": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "link_caption": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "link_format": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "page": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "product_link": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } }, - "type": [ - "null", - "object" - ] + "type": ["null", "object"] }, "type": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } }, - "type": [ - "null", - "object" - ] + "type": ["null", "object"] }, "caption": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "picture": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "description": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "image_crops": { "properties": { "100x100": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "100x72": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "191x100": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "400x150": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "400x500": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "600x360": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "90x160": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] } }, - "type": [ - "null", - "object" - ] + "type": ["null", "object"] }, "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "static_card": { - "type": [ - "null", - "boolean" - ] + "type": ["null", "boolean"] }, "video_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } }, - "type": [ - "null", - "object" - ] + "type": ["null", "object"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "multi_share_optimized": { - "type": [ - "null", - "boolean" - ] + "type": ["null", "boolean"] }, "link": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "image_crops": { "properties": { "100x100": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "100x72": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "191x100": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "400x150": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "400x500": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "600x360": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "90x160": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] } }, - "type": [ - "null", - "object" - ] + "type": ["null", "object"] }, "description": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "event_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "force_single_link": { - "type": [ - "null", - "boolean" - ] + "type": ["null", "boolean"] }, "multi_share_end_card": { - "type": [ - "null", - "boolean" - ] + "type": ["null", "boolean"] }, "message": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "image_hash": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "picture": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "offer_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "page_welcome_message": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "retailer_item_ids": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { "type": "string" } }, "show_multiple_images": { - "type": [ - "null", - "boolean" - ] + "type": ["null", "boolean"] } }, - "type": [ - "null", - "object" - ] + "type": ["null", "object"] }, "photo_data": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "branded_content_sponsor_page_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "branded_content_sponsor_relationship": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "caption": { "type": "string" }, "image_hash": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "page_welcome_message": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "url": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, "template_data": { "properties": { "additional_image_index": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, "app_link_spec": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "android": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { "type": "object", "properties": { @@ -1069,10 +601,7 @@ } }, "ios": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { "type": "object", "properties": { @@ -1089,10 +618,7 @@ } }, "ipad": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { "type": "object", "properties": { @@ -1109,10 +635,7 @@ } }, "iphone": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { "type": "object", "properties": { @@ -1131,621 +654,321 @@ } }, "attachment_style": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "branded_content_sponsor_page_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "branded_content_sponsor_relationship": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "call_to_action": { "properties": { "value": { "properties": { "app_destination": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "app_link": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "application": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "event_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "lead_gen_form_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "link": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "link_caption": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "link_format": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "page": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "product_link": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } }, - "type": [ - "null", - "object" - ] + "type": ["null", "object"] }, "type": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } }, - "type": [ - "null", - "object" - ] + "type": ["null", "object"] }, "caption": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "child_attachments": { "items": { "properties": { "image_hash": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "link": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "call_to_action": { "properties": { "value": { "properties": { "app_destination": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "app_link": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "application": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "event_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "lead_gen_form_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "link": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "link_caption": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "link_format": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "page": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "product_link": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } }, - "type": [ - "null", - "object" - ] + "type": ["null", "object"] }, "type": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } }, - "type": [ - "null", - "object" - ] + "type": ["null", "object"] }, "caption": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "picture": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "description": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "image_crops": { "properties": { "100x100": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "100x72": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "191x100": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "400x150": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "400x500": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "600x360": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "90x160": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] } }, - "type": [ - "null", - "object" - ] + "type": ["null", "object"] }, "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "static_card": { - "type": [ - "null", - "boolean" - ] + "type": ["null", "boolean"] }, "video_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } }, - "type": [ - "null", - "object" - ] + "type": ["null", "object"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "multi_share_optimized": { - "type": [ - "null", - "boolean" - ] + "type": ["null", "boolean"] }, "link": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "image_crops": { "properties": { "100x100": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "100x72": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "191x100": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "400x150": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "400x500": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "600x360": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "90x160": { "items": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] } }, - "type": [ - "null", - "object" - ] + "type": ["null", "object"] }, "description": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "event_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "force_single_link": { - "type": [ - "null", - "boolean" - ] + "type": ["null", "boolean"] }, "multi_share_end_card": { - "type": [ - "null", - "boolean" - ] + "type": ["null", "boolean"] }, "message": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "image_hash": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "picture": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "offer_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "page_welcome_message": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "retailer_item_ids": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { "type": "string" } }, "show_multiple_images": { - "type": [ - "null", - "boolean" - ] + "type": ["null", "boolean"] } }, - "type": [ - "null", - "object" - ] + "type": ["null", "object"] }, "text_data": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "message": { "type": "string" @@ -1753,152 +976,80 @@ } }, "video_data": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "additional_image_index": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, "branded_content_sponsor_page_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "branded_content_sponsor_relationship": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "call_to_action": { "properties": { "value": { "properties": { "app_destination": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "app_link": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "application": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "event_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "lead_gen_form_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "link": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "link_caption": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "link_format": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "page": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "product_link": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } }, - "type": [ - "null", - "object" - ] + "type": ["null", "object"] }, "type": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } }, - "type": [ - "null", - "object" - ] + "type": ["null", "object"] }, "image_hash": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "image_url": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "link_description": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "message": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "offer_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "page_welcome_message": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "retailer_item_ids": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { "type": "string" } @@ -1907,1538 +1058,824 @@ "definitions": { "id_name_pairs": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "targeting_fields": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "household_composition": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "home_type": { "$ref$": "targeting.json#/definitions/id_name_pairs" }, "friends_of_connections": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "family_statuses": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "work_positions": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "education_majors": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "life_events": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "moms": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "custom_audiences": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "interests": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "behaviors": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "connections": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "excluded_connections": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "user_adclusters": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "income": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "excluded_custom_audiences": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "work_employers": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "industries": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "net_worth": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "relationship_statuses": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] } }, "generation": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "home_ownership": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "politics": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] } } } }, - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "messenger_positions": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } }, "locales": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "connections": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "instagram_positions": { "items": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "audience_network_positions": { "items": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "exclusions": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "household_composition": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "home_type": { "$ref$": "targeting.json#/definitions/id_name_pairs" }, "friends_of_connections": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "family_statuses": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "work_positions": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "education_majors": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "life_events": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "moms": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "custom_audiences": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "interests": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "behaviors": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "connections": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "excluded_connections": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "user_adclusters": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "income": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "excluded_custom_audiences": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "work_employers": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "industries": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "net_worth": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "relationship_statuses": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] } }, "generation": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "home_ownership": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "politics": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] } } }, "interests": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "geo_locations": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "regions": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "country": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "key": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "countries": { "items": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "cities": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "key": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "distance_unit": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "region": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "country": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "region_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "radius": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "location_types": { "items": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "zips": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "country": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "key": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "primary_city_id": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, "region_id": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] } } } }, "custom_locations": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "address_string": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "country": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "distance_unit": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "latitude": { - "type": [ - "null", - "number" - ] + "type": ["null", "number"] }, "longitude": { - "type": [ - "null", - "number" - ] + "type": ["null", "number"] }, "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "primary_city_id": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, "radius": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, "region_id": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] } } } }, "country_groups": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } }, "geo-markets": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "key": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } } @@ -3446,269 +1883,140 @@ } }, "excluded_geo_locations": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "regions": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "country": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "key": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "countries": { "items": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "cities": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "key": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "distance_unit": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "region": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "country": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "region_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "radius": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "location_types": { "items": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "zips": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "country": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "key": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "primary_city_id": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, "region_id": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] } } } }, "custom_locations": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "address_string": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "country": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "distance_unit": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "latitude": { - "type": [ - "null", - "number" - ] + "type": ["null", "number"] }, "longitude": { - "type": [ - "null", - "number" - ] + "type": ["null", "number"] }, "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "primary_city_id": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, "radius": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, "region_id": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] } } } }, "country_groups": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } }, "geo-markets": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "key": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } } @@ -3717,1240 +2025,664 @@ }, "work_positions": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "education_statuses": { "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "publisher_platforms": { "items": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "age_max": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, "custom_audiences": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "device_platforms": { "items": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "age_min": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] }, "facebook_positions": { "items": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "excluded_connections": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "flexible_spec": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "household_composition": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "home_type": { "$ref$": "targeting.json#/definitions/id_name_pairs" }, "friends_of_connections": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "family_statuses": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "work_positions": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "education_majors": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "life_events": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "moms": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "custom_audiences": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "interests": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "behaviors": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "connections": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "excluded_connections": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "user_adclusters": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "income": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "excluded_custom_audiences": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "work_employers": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "industries": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "net_worth": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "relationship_statuses": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] } }, "generation": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "home_ownership": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "politics": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "friends_of_connections": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "user_os": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } }, "user_device": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } }, "excluded_custom_audiences": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "excluded_publisher_categories": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } }, "genders": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] } }, "targeting_optimization": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "user_adclusters": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "generation": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "behaviors": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "moms": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "home_ownership": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "office_type": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "home_type": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "family_statuses": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "relationship_statuses": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] } }, "industries": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "income": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "app_install_state": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "net_worth": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "politics": { "items": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "name": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } }, - "type": [ - "null", - "array" - ] + "type": ["null", "array"] }, "interested_in": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { - "type": [ - "null", - "integer" - ] + "type": ["null", "integer"] } }, "excluded_user_device": { - "type": [ - "null", - "array" - ], + "type": ["null", "array"], "items": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } } }, "title": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "video_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } } } }, - "type": [ - "null", - "object" - ] + "type": ["null", "object"] }, "object_type": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "object_url": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "product_set_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "status": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "template_url": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "template_url_spec": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "android": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "app_name": { "type": "string" @@ -4964,10 +2696,7 @@ } }, "config": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "app_id": { "type": "string" @@ -4975,10 +2704,7 @@ } }, "ios": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "app_name": { "type": "string" @@ -4992,10 +2718,7 @@ } }, "ipad": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "app_name": { "type": "string" @@ -5009,10 +2732,7 @@ } }, "iphone": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "app_name": { "type": "string" @@ -5026,10 +2746,7 @@ } }, "web": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "should_fallback": { "type": "string" @@ -5040,10 +2757,7 @@ } }, "windows_phone": { - "type": [ - "null", - "object" - ], + "type": ["null", "object"], "properties": { "app_id": { "type": "string" @@ -5059,44 +2773,24 @@ } }, "thumbnail_url": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "image_hash": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "url_tags": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "video_id": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] }, "link_url": { - "type": [ - "null", - "string" - ] + "type": ["null", "string"] } }, - "type": [ - "null", - "object" - ] + "type": ["null", "object"] }, - "supported_sync_modes": [ - "full_refresh" - ], + "supported_sync_modes": ["full_refresh"], "source_defined_cursor": false }, "sync_mode": "incremental" From 4119d48daa703911fa9745fc28f1abb8f32f6ef8 Mon Sep 17 00:00:00 2001 From: ykurochkin Date: Mon, 15 Feb 2021 14:38:21 +0200 Subject: [PATCH 5/7] #1945 Issue: update code after review --- .../base-singer/base_singer/singer_helpers.py | 67 +++++++++---------- 1 file changed, 31 insertions(+), 36 deletions(-) diff --git a/airbyte-integrations/bases/base-singer/base_singer/singer_helpers.py b/airbyte-integrations/bases/base-singer/base_singer/singer_helpers.py index fbd3b25b3ffd..f7e8f5affc54 100644 --- a/airbyte-integrations/bases/base-singer/base_singer/singer_helpers.py +++ b/airbyte-integrations/bases/base-singer/base_singer/singer_helpers.py @@ -28,7 +28,8 @@ import subprocess from dataclasses import dataclass from datetime import datetime -from typing import DefaultDict, Dict, Generator, List, Optional +from io import TextIOWrapper +from typing import Any, DefaultDict, Dict, Iterator, List, Mapping, Optional, Tuple from airbyte_protocol import ( AirbyteCatalog, @@ -161,16 +162,22 @@ def get_catalogs(logger, shell_command: str, sync_mode_overrides: Dict[str, Sync return Catalogs(singer_catalog=singer_catalog, airbyte_catalog=airbyte_catalog) @staticmethod - def read(logger, shell_command, is_message=(lambda x: True), transform=(lambda x: x)) -> Generator[AirbyteMessage, None, None]: + def read(logger, shell_command, is_message=(lambda x: True)) -> Iterator[AirbyteMessage]: with subprocess.Popen(shell_command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) as p: - for std_data in SingerHelper._read_std_rows(p, is_message, transform): - if isinstance(std_data, AirbyteMessage): - yield std_data + for line, text_wrapper in SingerHelper._read_lines(p): + if text_wrapper is p.stdout: + out_json = to_json(line) + if out_json is not None and is_message(out_json): + message_data = SingerHelper._airbyte_message_from_json(out_json) + if message_data is not None: + yield message_data + else: + logger.log_by_prefix(line, "INFO") else: - logger.log_by_prefix(*std_data) + logger.log_by_prefix(line, "ERROR") @staticmethod - def _read_std_rows(process: subprocess.Popen, is_message, transform) -> Generator[AirbyteMessage, None, None]: + def _read_lines(process: subprocess.Popen) -> Iterator[Tuple[str, TextIOWrapper]]: sel = selectors.DefaultSelector() sel.register(process.stdout, selectors.EVENT_READ) sel.register(process.stderr, selectors.EVENT_READ) @@ -192,38 +199,26 @@ def _read_std_rows(process: subprocess.Popen, is_message, transform) -> Generato if process.returncode != 0: raise Exception(f"Underlying command {process.args} failed with exit code {process.returncode}") - - elif key.fileobj is process.stdout: - out_json = to_json(line) - if out_json is not None and is_message(out_json): - message_data = SingerHelper._classify_and_convert_out_json_to_airbyte_message(out_json, transform) - if message_data is not None: - yield message_data - else: - yield line, "INFO" else: - yield line, "ERROR" + yield line, key.fileobj @staticmethod - def _classify_and_convert_out_json_to_airbyte_message(out_json: Dict, transform) -> AirbyteMessage: - transformed_json = transform(out_json) - if transformed_json is not None: - if transformed_json.get("type") == "SCHEMA" or transformed_json.get("type") == "ACTIVATE_VERSION": - pass - elif transformed_json.get("type") == "STATE": - out_record = AirbyteStateMessage(data=transformed_json["value"]) - out_message = AirbyteMessage(type=Type.STATE, state=out_record) - return transform(out_message) - else: - # todo: check that messages match the discovered schema - stream_name = transformed_json["stream"] - out_record = AirbyteRecordMessage( - stream=stream_name, - data=transformed_json["record"], - emitted_at=int(datetime.now().timestamp()) * 1000, - ) - out_message = AirbyteMessage(type=Type.RECORD, record=out_record) - return transform(out_message) + def _airbyte_message_from_json(transformed_json: Mapping[str, Any]) -> Optional[AirbyteMessage]: + if transformed_json is None or transformed_json.get("type") == "SCHEMA" or transformed_json.get("type") == "ACTIVATE_VERSION": + return None + elif transformed_json.get("type") == "STATE": + out_record = AirbyteStateMessage(data=transformed_json["value"]) + out_message = AirbyteMessage(type=Type.STATE, state=out_record) + else: + # todo: check that messages match the discovered schema + stream_name = transformed_json["stream"] + out_record = AirbyteRecordMessage( + stream=stream_name, + data=transformed_json["record"], + emitted_at=int(datetime.now().timestamp()) * 1000, + ) + out_message = AirbyteMessage(type=Type.RECORD, record=out_record) + return out_message @staticmethod def create_singer_catalog_with_selection(masked_airbyte_catalog: ConfiguredAirbyteCatalog, discovered_singer_catalog: object) -> str: From 0badd97af039d8724922ec53b14157cb068c27c5 Mon Sep 17 00:00:00 2001 From: ykurochkin Date: Mon, 15 Feb 2021 21:42:20 +0200 Subject: [PATCH 6/7] #1945 Issue: fix checking EOF on succed or fail --- .../bases/base-singer/base_singer/singer_helpers.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/airbyte-integrations/bases/base-singer/base_singer/singer_helpers.py b/airbyte-integrations/bases/base-singer/base_singer/singer_helpers.py index f7e8f5affc54..d698b329cb9c 100644 --- a/airbyte-integrations/bases/base-singer/base_singer/singer_helpers.py +++ b/airbyte-integrations/bases/base-singer/base_singer/singer_helpers.py @@ -192,13 +192,13 @@ def _read_lines(process: subprocess.Popen) -> Iterator[Tuple[str, TextIOWrapper] if empty_line_counter >= len(selects_list): eof = True - try: - process.wait(timeout=60) - except subprocess.TimeoutExpired: - raise Exception(f"Underlying command {process.args} is hanging") + try: + process.wait(timeout=60) + except subprocess.TimeoutExpired: + raise Exception(f"Underlying command {process.args} is hanging") - if process.returncode != 0: - raise Exception(f"Underlying command {process.args} failed with exit code {process.returncode}") + if process.returncode != 0: + raise Exception(f"Underlying command {process.args} failed with exit code {process.returncode}") else: yield line, key.fileobj From c2abace4f200c2b67158e19fbae86b62bf2c95ab Mon Sep 17 00:00:00 2001 From: Sherif Nada Date: Mon, 15 Feb 2021 15:13:26 -0800 Subject: [PATCH 7/7] bump slack and ga --- .../39f092a6-8c87-4f6f-a8d9-5cef45b7dbe1.json | 2 +- .../41375467-61ae-4204-8e38-e2b8b7365f23.json | 2 +- .../init/src/main/resources/seed/source_definitions.yaml | 4 ++-- .../connectors/source-googleanalytics-singer/Dockerfile | 2 +- .../connectors/source-slack-singer/Dockerfile | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/39f092a6-8c87-4f6f-a8d9-5cef45b7dbe1.json b/airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/39f092a6-8c87-4f6f-a8d9-5cef45b7dbe1.json index e155ac564399..7d8e56284171 100644 --- a/airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/39f092a6-8c87-4f6f-a8d9-5cef45b7dbe1.json +++ b/airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/39f092a6-8c87-4f6f-a8d9-5cef45b7dbe1.json @@ -2,6 +2,6 @@ "sourceDefinitionId": "39f092a6-8c87-4f6f-a8d9-5cef45b7dbe1", "name": "Google Analytics", "dockerRepository": "airbyte/source-googleanalytics-singer", - "dockerImageTag": "0.1.6", + "dockerImageTag": "0.1.7", "documentationUrl": "https://hub.docker.com/r/airbyte/source-googleanalytics-singer" } diff --git a/airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/41375467-61ae-4204-8e38-e2b8b7365f23.json b/airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/41375467-61ae-4204-8e38-e2b8b7365f23.json index ba5dce22399a..7d65729d25cd 100644 --- a/airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/41375467-61ae-4204-8e38-e2b8b7365f23.json +++ b/airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/41375467-61ae-4204-8e38-e2b8b7365f23.json @@ -2,6 +2,6 @@ "sourceDefinitionId": "41375467-61ae-4204-8e38-e2b8b7365f23", "name": "Slack", "dockerRepository": "airbyte/source-slack-singer", - "dockerImageTag": "0.1.2", + "dockerImageTag": "0.1.3", "documentationUrl": "https://hub.docker.com/repository/docker/airbyte/source-slack-singer" } diff --git a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml index 85f645b69cf0..3d6738b4b95a 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -71,7 +71,7 @@ - sourceDefinitionId: 39f092a6-8c87-4f6f-a8d9-5cef45b7dbe1 name: Google Analytics dockerRepository: airbyte/source-googleanalytics-singer - dockerImageTag: 0.1.6 + dockerImageTag: 0.1.7 documentationUrl: https://hub.docker.com/r/airbyte/source-googleanalytics-singer - sourceDefinitionId: e7778cfc-e97c-4458-9ecb-b4f2bba8946c name: Facebook Marketing @@ -116,7 +116,7 @@ - sourceDefinitionId: 41375467-61ae-4204-8e38-e2b8b7365f23 name: Slack dockerRepository: airbyte/source-slack-singer - dockerImageTag: 0.1.2 + dockerImageTag: 0.1.3 documentationUrl: https://hub.docker.com/repository/docker/airbyte/source-slack-singer - sourceDefinitionId: 59f1e50a-331f-4f09-b3e8-2e8d4d355f44 name: Greenhouse diff --git a/airbyte-integrations/connectors/source-googleanalytics-singer/Dockerfile b/airbyte-integrations/connectors/source-googleanalytics-singer/Dockerfile index 915dfc50cd73..0b1d27fbf1e4 100644 --- a/airbyte-integrations/connectors/source-googleanalytics-singer/Dockerfile +++ b/airbyte-integrations/connectors/source-googleanalytics-singer/Dockerfile @@ -8,7 +8,7 @@ ENV CODE_PATH="source_googleanalytics_singer" ENV AIRBYTE_IMPL_MODULE="source_googleanalytics_singer" ENV AIRBYTE_IMPL_PATH="GoogleAnalyticsSingerSource" -LABEL io.airbyte.version=0.1.6 +LABEL io.airbyte.version=0.1.7 LABEL io.airbyte.name=airbyte/source-googleanalytics-singer WORKDIR /airbyte/integration_code diff --git a/airbyte-integrations/connectors/source-slack-singer/Dockerfile b/airbyte-integrations/connectors/source-slack-singer/Dockerfile index eea97d5c05a4..7872c66c96b5 100644 --- a/airbyte-integrations/connectors/source-slack-singer/Dockerfile +++ b/airbyte-integrations/connectors/source-slack-singer/Dockerfile @@ -6,7 +6,7 @@ ENV CODE_PATH="source_slack_singer" ENV AIRBYTE_IMPL_MODULE="source_slack_singer" ENV AIRBYTE_IMPL_PATH="SourceSlackSinger" -LABEL io.airbyte.version=0.1.2 +LABEL io.airbyte.version=0.1.3 LABEL io.airbyte.name=airbyte/source-slack-singer WORKDIR /airbyte/integration_code