diff --git a/tests/api_resources/journeys/test_templates.py b/tests/api_resources/journeys/test_templates.py index 8ef42ce..c0d8343 100644 --- a/tests/api_resources/journeys/test_templates.py +++ b/tests/api_resources/journeys/test_templates.py @@ -51,7 +51,41 @@ def test_method_create_with_all_params(self, client: Courier) -> None: notification={ "brand": {"id": "id"}, "content": { - "elements": [{"type": "channel"}], + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "channel": "email", + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "align": "left", + "bold": "bold", + "color": "color", + "content": "Welcome!", + "font_size": "font_size", + "format": "markdown", + "italic": "italic", + "line_height": "line_height", + "locales": {"foo": {"content": "content"}}, + "strikethrough": "strikethrough", + "text_style": "text", + "underline": "underline", + "type": "text", + } + ], + "font_size": "font_size", + "line_height": "line_height", + "padding": "padding", + "raw": {"foo": "bar"}, + "type": "channel", + } + ], "version": "2022-01-01", "scope": "default", }, @@ -422,7 +456,49 @@ def test_method_put_content_with_all_params(self, client: Courier) -> None: notification_id="x", template_id="x", content={ - "elements": [{"type": "channel"}], + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "channel": "email", + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "title": "Welcome!", + "type": "meta", + }, + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "align": "left", + "bold": "bold", + "color": "color", + "content": "Hello {{data.name}}.", + "font_size": "font_size", + "format": "markdown", + "italic": "italic", + "line_height": "line_height", + "locales": {"foo": {"content": "content"}}, + "strikethrough": "strikethrough", + "text_style": "text", + "underline": "underline", + "type": "text", + }, + ], + "font_size": "font_size", + "line_height": "line_height", + "padding": "padding", + "raw": {"foo": "bar"}, + "type": "channel", + } + ], "version": "2022-01-01", }, state="DRAFT", @@ -586,7 +662,27 @@ def test_method_replace_with_all_params(self, client: Courier) -> None: notification={ "brand": {"id": "id"}, "content": { - "elements": [{"type": "text"}], + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "align": "left", + "bold": "bold", + "color": "color", + "content": "content", + "font_size": "font_size", + "format": "markdown", + "italic": "italic", + "line_height": "line_height", + "locales": {"foo": {"content": "content"}}, + "strikethrough": "strikethrough", + "text_style": "text", + "underline": "underline", + "type": "text", + } + ], "version": "2022-01-01", "scope": "default", }, @@ -777,7 +873,41 @@ async def test_method_create_with_all_params(self, async_client: AsyncCourier) - notification={ "brand": {"id": "id"}, "content": { - "elements": [{"type": "channel"}], + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "channel": "email", + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "align": "left", + "bold": "bold", + "color": "color", + "content": "Welcome!", + "font_size": "font_size", + "format": "markdown", + "italic": "italic", + "line_height": "line_height", + "locales": {"foo": {"content": "content"}}, + "strikethrough": "strikethrough", + "text_style": "text", + "underline": "underline", + "type": "text", + } + ], + "font_size": "font_size", + "line_height": "line_height", + "padding": "padding", + "raw": {"foo": "bar"}, + "type": "channel", + } + ], "version": "2022-01-01", "scope": "default", }, @@ -1148,7 +1278,49 @@ async def test_method_put_content_with_all_params(self, async_client: AsyncCouri notification_id="x", template_id="x", content={ - "elements": [{"type": "channel"}], + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "channel": "email", + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "title": "Welcome!", + "type": "meta", + }, + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "align": "left", + "bold": "bold", + "color": "color", + "content": "Hello {{data.name}}.", + "font_size": "font_size", + "format": "markdown", + "italic": "italic", + "line_height": "line_height", + "locales": {"foo": {"content": "content"}}, + "strikethrough": "strikethrough", + "text_style": "text", + "underline": "underline", + "type": "text", + }, + ], + "font_size": "font_size", + "line_height": "line_height", + "padding": "padding", + "raw": {"foo": "bar"}, + "type": "channel", + } + ], "version": "2022-01-01", }, state="DRAFT", @@ -1312,7 +1484,27 @@ async def test_method_replace_with_all_params(self, async_client: AsyncCourier) notification={ "brand": {"id": "id"}, "content": { - "elements": [{"type": "text"}], + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "align": "left", + "bold": "bold", + "color": "color", + "content": "content", + "font_size": "font_size", + "format": "markdown", + "italic": "italic", + "line_height": "line_height", + "locales": {"foo": {"content": "content"}}, + "strikethrough": "strikethrough", + "text_style": "text", + "underline": "underline", + "type": "text", + } + ], "version": "2022-01-01", "scope": "default", }, diff --git a/tests/api_resources/tenants/test_templates.py b/tests/api_resources/tenants/test_templates.py index 712a4e4..1757541 100644 --- a/tests/api_resources/tenants/test_templates.py +++ b/tests/api_resources/tenants/test_templates.py @@ -265,7 +265,41 @@ def test_method_replace_with_all_params(self, client: Courier) -> None: tenant_id="tenant_id", template={ "content": { - "elements": [{"type": "channel"}], + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "channel": "email", + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "align": "left", + "bold": "bold", + "color": "color", + "content": "Hello {{name}}", + "font_size": "font_size", + "format": "markdown", + "italic": "italic", + "line_height": "line_height", + "locales": {"foo": {"content": "content"}}, + "strikethrough": "strikethrough", + "text_style": "text", + "underline": "underline", + "type": "text", + } + ], + "font_size": "font_size", + "line_height": "line_height", + "padding": "padding", + "raw": {"foo": "bar"}, + "type": "channel", + } + ], "version": "2022-01-01", }, "channels": { @@ -629,7 +663,41 @@ async def test_method_replace_with_all_params(self, async_client: AsyncCourier) tenant_id="tenant_id", template={ "content": { - "elements": [{"type": "channel"}], + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "channel": "email", + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "align": "left", + "bold": "bold", + "color": "color", + "content": "Hello {{name}}", + "font_size": "font_size", + "format": "markdown", + "italic": "italic", + "line_height": "line_height", + "locales": {"foo": {"content": "content"}}, + "strikethrough": "strikethrough", + "text_style": "text", + "underline": "underline", + "type": "text", + } + ], + "font_size": "font_size", + "line_height": "line_height", + "padding": "padding", + "raw": {"foo": "bar"}, + "type": "channel", + } + ], "version": "2022-01-01", }, "channels": { diff --git a/tests/api_resources/test_broadcasts.py b/tests/api_resources/test_broadcasts.py index ae572ac..25c8e7e 100644 --- a/tests/api_resources/test_broadcasts.py +++ b/tests/api_resources/test_broadcasts.py @@ -325,7 +325,35 @@ def test_method_put_content_with_all_params(self, client: Courier) -> None: broadcast = client.broadcasts.put_content( broadcast_id="broadcastId", content={ - "elements": [{"type": "meta"}, {"type": "text"}], + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "title": "Spring Sale is here", + "type": "meta", + }, + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "align": "left", + "bold": "bold", + "color": "color", + "content": "Hello! Check out our spring sale.", + "font_size": "font_size", + "format": "markdown", + "italic": "italic", + "line_height": "line_height", + "locales": {"foo": {"content": "content"}}, + "strikethrough": "strikethrough", + "text_style": "text", + "underline": "underline", + "type": "text", + }, + ], "version": "2022-01-01", }, state="DRAFT", @@ -845,7 +873,35 @@ async def test_method_put_content_with_all_params(self, async_client: AsyncCouri broadcast = await async_client.broadcasts.put_content( broadcast_id="broadcastId", content={ - "elements": [{"type": "meta"}, {"type": "text"}], + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "title": "Spring Sale is here", + "type": "meta", + }, + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "align": "left", + "bold": "bold", + "color": "color", + "content": "Hello! Check out our spring sale.", + "font_size": "font_size", + "format": "markdown", + "italic": "italic", + "line_height": "line_height", + "locales": {"foo": {"content": "content"}}, + "strikethrough": "strikethrough", + "text_style": "text", + "underline": "underline", + "type": "text", + }, + ], "version": "2022-01-01", }, state="DRAFT", diff --git a/tests/api_resources/test_notifications.py b/tests/api_resources/test_notifications.py index b50385d..013b3f2 100644 --- a/tests/api_resources/test_notifications.py +++ b/tests/api_resources/test_notifications.py @@ -50,7 +50,49 @@ def test_method_create_with_all_params(self, client: Courier) -> None: notification={ "brand": {"id": "bnd_01kx4mrd0pfzw8wt7pn7p2fzag"}, "content": { - "elements": [{"type": "channel"}], + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "channel": "email", + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "title": "Welcome!", + "type": "meta", + }, + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "align": "left", + "bold": "bold", + "color": "color", + "content": "Hello {{data.name}}.", + "font_size": "font_size", + "format": "markdown", + "italic": "italic", + "line_height": "line_height", + "locales": {"foo": {"content": "content"}}, + "strikethrough": "strikethrough", + "text_style": "text", + "underline": "underline", + "type": "text", + }, + ], + "font_size": "font_size", + "line_height": "line_height", + "padding": "padding", + "raw": {"foo": "bar"}, + "type": "channel", + } + ], "version": "2022-01-01", }, "name": "Welcome Email", @@ -423,7 +465,49 @@ def test_method_put_content_with_all_params(self, client: Courier) -> None: notification = client.notifications.put_content( id="id", content={ - "elements": [{"type": "channel"}], + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "channel": "email", + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "title": "Welcome!", + "type": "meta", + }, + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "align": "left", + "bold": "bold", + "color": "color", + "content": "Hello {{data.name}}.", + "font_size": "font_size", + "format": "markdown", + "italic": "italic", + "line_height": "line_height", + "locales": {"foo": {"content": "content"}}, + "strikethrough": "strikethrough", + "text_style": "text", + "underline": "underline", + "type": "text", + }, + ], + "font_size": "font_size", + "line_height": "line_height", + "padding": "padding", + "raw": {"foo": "bar"}, + "type": "channel", + } + ], "version": "2022-01-01", }, state="DRAFT", @@ -635,7 +719,49 @@ def test_method_replace_with_all_params(self, client: Courier) -> None: notification={ "brand": {"id": "id"}, "content": { - "elements": [{"type": "channel"}], + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "channel": "email", + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "title": "Updated", + "type": "meta", + }, + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "align": "left", + "bold": "bold", + "color": "color", + "content": "Updated content.", + "font_size": "font_size", + "format": "markdown", + "italic": "italic", + "line_height": "line_height", + "locales": {"foo": {"content": "content"}}, + "strikethrough": "strikethrough", + "text_style": "text", + "underline": "underline", + "type": "text", + }, + ], + "font_size": "font_size", + "line_height": "line_height", + "padding": "padding", + "raw": {"foo": "bar"}, + "type": "channel", + } + ], "version": "2022-01-01", }, "name": "Updated Name", @@ -803,7 +929,49 @@ async def test_method_create_with_all_params(self, async_client: AsyncCourier) - notification={ "brand": {"id": "bnd_01kx4mrd0pfzw8wt7pn7p2fzag"}, "content": { - "elements": [{"type": "channel"}], + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "channel": "email", + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "title": "Welcome!", + "type": "meta", + }, + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "align": "left", + "bold": "bold", + "color": "color", + "content": "Hello {{data.name}}.", + "font_size": "font_size", + "format": "markdown", + "italic": "italic", + "line_height": "line_height", + "locales": {"foo": {"content": "content"}}, + "strikethrough": "strikethrough", + "text_style": "text", + "underline": "underline", + "type": "text", + }, + ], + "font_size": "font_size", + "line_height": "line_height", + "padding": "padding", + "raw": {"foo": "bar"}, + "type": "channel", + } + ], "version": "2022-01-01", }, "name": "Welcome Email", @@ -1176,7 +1344,49 @@ async def test_method_put_content_with_all_params(self, async_client: AsyncCouri notification = await async_client.notifications.put_content( id="id", content={ - "elements": [{"type": "channel"}], + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "channel": "email", + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "title": "Welcome!", + "type": "meta", + }, + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "align": "left", + "bold": "bold", + "color": "color", + "content": "Hello {{data.name}}.", + "font_size": "font_size", + "format": "markdown", + "italic": "italic", + "line_height": "line_height", + "locales": {"foo": {"content": "content"}}, + "strikethrough": "strikethrough", + "text_style": "text", + "underline": "underline", + "type": "text", + }, + ], + "font_size": "font_size", + "line_height": "line_height", + "padding": "padding", + "raw": {"foo": "bar"}, + "type": "channel", + } + ], "version": "2022-01-01", }, state="DRAFT", @@ -1388,7 +1598,49 @@ async def test_method_replace_with_all_params(self, async_client: AsyncCourier) notification={ "brand": {"id": "id"}, "content": { - "elements": [{"type": "channel"}], + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "channel": "email", + "elements": [ + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "title": "Updated", + "type": "meta", + }, + { + "channels": ["string"], + "if": "if", + "loop": "loop", + "ref": "ref", + "align": "left", + "bold": "bold", + "color": "color", + "content": "Updated content.", + "font_size": "font_size", + "format": "markdown", + "italic": "italic", + "line_height": "line_height", + "locales": {"foo": {"content": "content"}}, + "strikethrough": "strikethrough", + "text_style": "text", + "underline": "underline", + "type": "text", + }, + ], + "font_size": "font_size", + "line_height": "line_height", + "padding": "padding", + "raw": {"foo": "bar"}, + "type": "channel", + } + ], "version": "2022-01-01", }, "name": "Updated Name",