From 7b9950657f021565dc7fb9e30205375a624086ed Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 19 Mar 2026 17:57:49 +0000 Subject: [PATCH] Regenerate client from commit 778e902 of spec repo --- .../SendPublicDashboardInvitation.py | 21 ++-- ...endPublicDashboardInvitation_3435926116.py | 32 +++++ ...shboard_invitation_email_returns_ok.frozen | 1 + ...dashboard_invitation_email_returns_ok.yaml | 117 ++++++++++++++++++ ...hboard_invitation_email_returns_ok_.frozen | 1 + ...ashboard_invitation_email_returns_ok_.yaml | 117 ++++++++++++++++++ tests/v1/features/dashboards.feature | 12 +- 7 files changed, 289 insertions(+), 12 deletions(-) create mode 100644 examples/v1/dashboards/SendPublicDashboardInvitation_3435926116.py create mode 100644 tests/v1/cassettes/test_scenarios/test_send_shared_dashboard_invitation_email_returns_ok.frozen create mode 100644 tests/v1/cassettes/test_scenarios/test_send_shared_dashboard_invitation_email_returns_ok.yaml create mode 100644 tests/v1/cassettes/test_scenarios/test_send_shared_dashboard_invitation_email_returns_ok_.frozen create mode 100644 tests/v1/cassettes/test_scenarios/test_send_shared_dashboard_invitation_email_returns_ok_.yaml diff --git a/examples/v1/dashboards/SendPublicDashboardInvitation.py b/examples/v1/dashboards/SendPublicDashboardInvitation.py index 69c2eee764..72cea5e2eb 100644 --- a/examples/v1/dashboards/SendPublicDashboardInvitation.py +++ b/examples/v1/dashboards/SendPublicDashboardInvitation.py @@ -2,31 +2,32 @@ Send shared dashboard invitation email returns "OK" response """ -from os import environ from datadog_api_client import ApiClient, Configuration from datadog_api_client.v1.api.dashboards_api import DashboardsApi from datadog_api_client.v1.model.dashboard_invite_type import DashboardInviteType from datadog_api_client.v1.model.shared_dashboard_invites import SharedDashboardInvites +from datadog_api_client.v1.model.shared_dashboard_invites_data_list import SharedDashboardInvitesDataList from datadog_api_client.v1.model.shared_dashboard_invites_data_object import SharedDashboardInvitesDataObject from datadog_api_client.v1.model.shared_dashboard_invites_data_object_attributes import ( SharedDashboardInvitesDataObjectAttributes, ) -# there is a valid "shared_dashboard" in the system -SHARED_DASHBOARD_TOKEN = environ["SHARED_DASHBOARD_TOKEN"] - body = SharedDashboardInvites( - data=SharedDashboardInvitesDataObject( - attributes=SharedDashboardInvitesDataObjectAttributes( - email="exampledashboard@datadoghq.com", - ), - type=DashboardInviteType.PUBLIC_DASHBOARD_INVITATION, + data=SharedDashboardInvitesDataList( + [ + SharedDashboardInvitesDataObject( + attributes=SharedDashboardInvitesDataObjectAttributes( + email="test@datadoghq.com", + ), + type=DashboardInviteType.PUBLIC_DASHBOARD_INVITATION, + ), + ] ), ) configuration = Configuration() with ApiClient(configuration) as api_client: api_instance = DashboardsApi(api_client) - response = api_instance.send_public_dashboard_invitation(token=SHARED_DASHBOARD_TOKEN, body=body) + response = api_instance.send_public_dashboard_invitation(token="token", body=body) print(response) diff --git a/examples/v1/dashboards/SendPublicDashboardInvitation_3435926116.py b/examples/v1/dashboards/SendPublicDashboardInvitation_3435926116.py new file mode 100644 index 0000000000..7b8969dfd0 --- /dev/null +++ b/examples/v1/dashboards/SendPublicDashboardInvitation_3435926116.py @@ -0,0 +1,32 @@ +""" +Send shared dashboard invitation email returns OK +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v1.api.dashboards_api import DashboardsApi +from datadog_api_client.v1.model.dashboard_invite_type import DashboardInviteType +from datadog_api_client.v1.model.shared_dashboard_invites import SharedDashboardInvites +from datadog_api_client.v1.model.shared_dashboard_invites_data_object import SharedDashboardInvitesDataObject +from datadog_api_client.v1.model.shared_dashboard_invites_data_object_attributes import ( + SharedDashboardInvitesDataObjectAttributes, +) + +# there is a valid "shared_dashboard" in the system +SHARED_DASHBOARD_TOKEN = environ["SHARED_DASHBOARD_TOKEN"] + +body = SharedDashboardInvites( + data=SharedDashboardInvitesDataObject( + attributes=SharedDashboardInvitesDataObjectAttributes( + email="exampledashboard@datadoghq.com", + ), + type=DashboardInviteType.PUBLIC_DASHBOARD_INVITATION, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = DashboardsApi(api_client) + response = api_instance.send_public_dashboard_invitation(token=SHARED_DASHBOARD_TOKEN, body=body) + + print(response) diff --git a/tests/v1/cassettes/test_scenarios/test_send_shared_dashboard_invitation_email_returns_ok.frozen b/tests/v1/cassettes/test_scenarios/test_send_shared_dashboard_invitation_email_returns_ok.frozen new file mode 100644 index 0000000000..8faa22ecff --- /dev/null +++ b/tests/v1/cassettes/test_scenarios/test_send_shared_dashboard_invitation_email_returns_ok.frozen @@ -0,0 +1 @@ +2026-03-19T17:48:57.466Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_send_shared_dashboard_invitation_email_returns_ok.yaml b/tests/v1/cassettes/test_scenarios/test_send_shared_dashboard_invitation_email_returns_ok.yaml new file mode 100644 index 0000000000..d22d4ab5b4 --- /dev/null +++ b/tests/v1/cassettes/test_scenarios/test_send_shared_dashboard_invitation_email_returns_ok.yaml @@ -0,0 +1,117 @@ +interactions: +- request: + body: '{"layout_type":"ordered","title":"Test-Send_shared_dashboard_invitation_email_returns_OK-1773942537 + with Profile Metrics Query","widgets":[{"definition":{"requests":[{"profile_metrics_query":{"compute":{"aggregation":"sum","facet":"@prof_core_cpu_cores"},"group_by":[{"facet":"service","limit":10,"sort":{"aggregation":"sum","facet":"@prof_core_cpu_cores","order":"desc"}}],"search":{"query":"runtime:jvm"}}}],"type":"timeseries"}}]}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/dashboard + response: + body: + string: '{"id":"i2s-n9z-69c","title":"Test-Send_shared_dashboard_invitation_email_returns_OK-1773942537 + with Profile Metrics Query","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI + Account","layout_type":"ordered","url":"/dashboard/i2s-n9z-69c/test-sendshareddashboardinvitationemailreturnsok-1773942537-with-profile-metrics","template_variables":null,"widgets":[{"definition":{"requests":[{"profile_metrics_query":{"compute":{"aggregation":"sum","facet":"@prof_core_cpu_cores"},"group_by":[{"facet":"service","limit":10,"sort":{"aggregation":"sum","facet":"@prof_core_cpu_cores","order":"desc"}}],"search":{"query":"runtime:jvm"}}}],"type":"timeseries"},"id":3342606346172255}],"notify_list":null,"created_at":"2026-03-19T17:48:57.600536+00:00","modified_at":"2026-03-19T17:48:57.600536+00:00","restricted_roles":[]}' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: '{"dashboard_id":"i2s-n9z-69c","dashboard_type":"custom_timeboard","global_time":{"live_span":"1h"},"share_list":["testsendshareddashboardinvitationemailreturnsok1773942537@datadoghq.com"],"share_type":"invite"}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/dashboard/public + response: + body: + string: '{"author":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"dashboard_id":"i2s-n9z-69c","dashboard_type":"custom_timeboard","status":"active","title":"Test-Send_shared_dashboard_invitation_email_returns_OK-1773942537 + with Profile Metrics Query","viewing_preferences":{},"expiration":null,"last_accessed":null,"global_time_selectable_enabled":false,"global_time":{"live_span":"1h"},"selectable_template_vars":null,"token":"fasjyydbcgwwc2uc-3dde636009128a6f937e880f67a0ad04","public_url":"https://p.datadoghq.com/sb/fasjyydbcgwwc2uc-3dde636009128a6f937e880f67a0ad04","created":"2026-03-19T17:48:58.113567+00:00","share_type":"invite","share_list":["team-intg-tools-libs-spam@datadoghq.com","testsendshareddashboardinvitationemailreturnsok1773942537@datadoghq.com"],"session_duration_in_days":30,"invitees":[{"email":"team-intg-tools-libs-spam@datadoghq.com","access_expiration":null,"last_accessed":null,"created_at":"2026-03-19T17:48:58.132469+00:00"},{"email":"testsendshareddashboardinvitationemailreturnsok1773942537@datadoghq.com","access_expiration":null,"last_accessed":null,"created_at":"2026-03-19T17:48:58.132469+00:00"}],"embeddable_domains":[]} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"email":"testsendshareddashboardinvitationemailreturnsok1773942537@datadoghq.com"},"type":"public_dashboard_invitation"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/dashboard/public/fasjyydbcgwwc2uc-3dde636009128a6f937e880f67a0ad04/invitation + response: + body: + string: '{"data":{"type":"public_dashboard_invitation","attributes":{"email":"testsendshareddashboardinvitationemailreturnsok1773942537@datadoghq.com","share_token":"fasjyydbcgwwc2uc-3dde636009128a6f937e880f67a0ad04","created_at":"2026-03-19T17:48:58.452715+00:00","invitation_expiry":"2026-03-19T18:48:58.463251+00:00","has_session":false,"session_expiry":null}}} + + ' + headers: + content-type: + - application/json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"email":"testsendshareddashboardinvitationemailreturnsok1773942537@datadoghq.com"},"type":"public_dashboard_invitation"}}' + headers: + accept: + - '*/*' + content-type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/dashboard/public/fasjyydbcgwwc2uc-3dde636009128a6f937e880f67a0ad04/invitation + response: + body: + string: '' + headers: + content-type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/dashboard/public/fasjyydbcgwwc2uc-3dde636009128a6f937e880f67a0ad04 + response: + body: + string: '{"deleted_public_dashboard_token":"fasjyydbcgwwc2uc-3dde636009128a6f937e880f67a0ad04"} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/dashboard/i2s-n9z-69c + response: + body: + string: '{"deleted_dashboard_id":"i2s-n9z-69c"}' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v1/cassettes/test_scenarios/test_send_shared_dashboard_invitation_email_returns_ok_.frozen b/tests/v1/cassettes/test_scenarios/test_send_shared_dashboard_invitation_email_returns_ok_.frozen new file mode 100644 index 0000000000..6bcfea8f13 --- /dev/null +++ b/tests/v1/cassettes/test_scenarios/test_send_shared_dashboard_invitation_email_returns_ok_.frozen @@ -0,0 +1 @@ +2026-03-18T20:27:29.628Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_send_shared_dashboard_invitation_email_returns_ok_.yaml b/tests/v1/cassettes/test_scenarios/test_send_shared_dashboard_invitation_email_returns_ok_.yaml new file mode 100644 index 0000000000..9dea91f890 --- /dev/null +++ b/tests/v1/cassettes/test_scenarios/test_send_shared_dashboard_invitation_email_returns_ok_.yaml @@ -0,0 +1,117 @@ +interactions: +- request: + body: '{"layout_type":"ordered","title":"Test-Send_shared_dashboard_invitation_email_returns_OK_-1773865649 + with Profile Metrics Query","widgets":[{"definition":{"requests":[{"profile_metrics_query":{"compute":{"aggregation":"sum","facet":"@prof_core_cpu_cores"},"group_by":[{"facet":"service","limit":10,"sort":{"aggregation":"sum","facet":"@prof_core_cpu_cores","order":"desc"}}],"search":{"query":"runtime:jvm"}}}],"type":"timeseries"}}]}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/dashboard + response: + body: + string: '{"id":"uy7-jdc-khf","title":"Test-Send_shared_dashboard_invitation_email_returns_OK_-1773865649 + with Profile Metrics Query","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI + Account","layout_type":"ordered","url":"/dashboard/uy7-jdc-khf/test-sendshareddashboardinvitationemailreturnsok-1773865649-with-profile-metrics","template_variables":null,"widgets":[{"definition":{"requests":[{"profile_metrics_query":{"compute":{"aggregation":"sum","facet":"@prof_core_cpu_cores"},"group_by":[{"facet":"service","limit":10,"sort":{"aggregation":"sum","facet":"@prof_core_cpu_cores","order":"desc"}}],"search":{"query":"runtime:jvm"}}}],"type":"timeseries"},"id":3763196530100152}],"notify_list":null,"created_at":"2026-03-18T20:27:29.720762+00:00","modified_at":"2026-03-18T20:27:29.720762+00:00","restricted_roles":[]}' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: '{"dashboard_id":"uy7-jdc-khf","dashboard_type":"custom_timeboard","global_time":{"live_span":"1h"},"share_list":["testsendshareddashboardinvitationemailreturnsok1773865649@datadoghq.com"],"share_type":"invite"}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/dashboard/public + response: + body: + string: '{"author":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"dashboard_id":"uy7-jdc-khf","dashboard_type":"custom_timeboard","status":"active","title":"Test-Send_shared_dashboard_invitation_email_returns_OK_-1773865649 + with Profile Metrics Query","viewing_preferences":{},"expiration":null,"last_accessed":null,"global_time_selectable_enabled":false,"global_time":{"live_span":"1h"},"selectable_template_vars":null,"token":"fasjyydbcgwwc2uc-4801190966e7cf88b180c12b876eca65","public_url":"https://p.datadoghq.com/sb/fasjyydbcgwwc2uc-4801190966e7cf88b180c12b876eca65","created":"2026-03-18T20:27:30.223874+00:00","share_type":"invite","share_list":["team-intg-tools-libs-spam@datadoghq.com","testsendshareddashboardinvitationemailreturnsok1773865649@datadoghq.com"],"session_duration_in_days":30,"invitees":[{"email":"team-intg-tools-libs-spam@datadoghq.com","access_expiration":null,"last_accessed":null,"created_at":"2026-03-18T20:27:30.248539+00:00"},{"email":"testsendshareddashboardinvitationemailreturnsok1773865649@datadoghq.com","access_expiration":null,"last_accessed":null,"created_at":"2026-03-18T20:27:30.248539+00:00"}],"embeddable_domains":[]} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"email":"testsendshareddashboardinvitationemailreturnsok1773865649@datadoghq.com"},"type":"public_dashboard_invitation"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/dashboard/public/fasjyydbcgwwc2uc-4801190966e7cf88b180c12b876eca65/invitation + response: + body: + string: '{"data":{"type":"public_dashboard_invitation","attributes":{"email":"testsendshareddashboardinvitationemailreturnsok1773865649@datadoghq.com","share_token":"fasjyydbcgwwc2uc-4801190966e7cf88b180c12b876eca65","created_at":"2026-03-18T20:27:30.426144+00:00","invitation_expiry":"2026-03-18T21:27:30.435235+00:00","has_session":false,"session_expiry":null}}} + + ' + headers: + content-type: + - application/json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"email":"testsendshareddashboardinvitationemailreturnsok1773865649@datadoghq.com"},"type":"public_dashboard_invitation"}}' + headers: + accept: + - '*/*' + content-type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/dashboard/public/fasjyydbcgwwc2uc-4801190966e7cf88b180c12b876eca65/invitation + response: + body: + string: '' + headers: + content-type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/dashboard/public/fasjyydbcgwwc2uc-4801190966e7cf88b180c12b876eca65 + response: + body: + string: '{"deleted_public_dashboard_token":"fasjyydbcgwwc2uc-4801190966e7cf88b180c12b876eca65"} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/dashboard/uy7-jdc-khf + response: + body: + string: '{"deleted_dashboard_id":"uy7-jdc-khf"}' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v1/features/dashboards.feature b/tests/v1/features/dashboards.feature index a586f0f7dd..0b753ac17b 100644 --- a/tests/v1/features/dashboards.feature +++ b/tests/v1/features/dashboards.feature @@ -1357,8 +1357,16 @@ Feature: Dashboards When the request is sent Then the response status is 404 Not Found - @team:DataDog/reporting-and-sharing + @generated @skip @team:DataDog/reporting-and-sharing Scenario: Send shared dashboard invitation email returns "OK" response + Given new "SendPublicDashboardInvitation" request + And request contains "token" parameter from "REPLACE.ME" + And body with value {"data": [{"attributes": {"email": "test@datadoghq.com"}, "type": "public_dashboard_invitation"}]} + When the request is sent + Then the response status is 201 OK + + @team:DataDog/reporting-and-sharing + Scenario: Send shared dashboard invitation email returns OK Given there is a valid "dashboard" in the system And there is a valid "shared_dashboard" in the system And new "SendPublicDashboardInvitation" request @@ -1366,7 +1374,7 @@ Feature: Dashboards And body with value {"data": {"attributes": {"email": "{{unique_lower_alnum}}@datadoghq.com"}, "type": "public_dashboard_invitation"}} When the request is sent Then the response status is 201 OK - And the response "data.attributes.email" has the same value as "shared_dashboard.share_list[0]" + And the response "data.attributes.email" has the same value as "shared_dashboard.share_list[1]" And the response "data.attributes.share_token" has the same value as "shared_dashboard.token" @generated @skip @team:DataDog/dashboards-backend