From 534a9f43f05dc05e16761a890fb94ce9fd7d0888 Mon Sep 17 00:00:00 2001 From: Oliver Li Date: Fri, 20 Dec 2024 16:28:57 -0500 Subject: [PATCH 1/6] delete app_deployment.feature --- .../features/v2/app_deployment.feature | 58 ------------------- 1 file changed, 58 deletions(-) delete mode 100644 tests/scenarios/features/v2/app_deployment.feature diff --git a/tests/scenarios/features/v2/app_deployment.feature b/tests/scenarios/features/v2/app_deployment.feature deleted file mode 100644 index b76bc1d8841..00000000000 --- a/tests/scenarios/features/v2/app_deployment.feature +++ /dev/null @@ -1,58 +0,0 @@ -@endpoint(app-deployment) @endpoint(app-deployment-v2) -Feature: App Deployment - Deploy and disable apps in App Builder. - - Background: - Given a valid "apiKeyAuth" key in the system - And a valid "appKeyAuth" key in the system - And an instance of "AppDeployment" API - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Deploy App returns "Bad Request" response - Given operation "DeployApp" enabled - And new "DeployApp" request - And request contains "app_id" parameter with value "invalid-uuid" - When the request is sent - Then the response status is 400 Bad Request - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Deploy App returns "Created" response - Given operation "DeployApp" enabled - And new "DeployApp" request - And there is a valid "app" in the system - And request contains "app_id" parameter from "app.data.id" - When the request is sent - Then the response status is 201 Created - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Deploy App returns "Not Found" response - Given operation "DeployApp" enabled - And new "DeployApp" request - And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" - When the request is sent - Then the response status is 404 Not Found - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Disable App returns "Bad Request" response - Given operation "DisableApp" enabled - And new "DisableApp" request - And request contains "app_id" parameter with value "invalid-uuid" - When the request is sent - Then the response status is 400 Bad Request - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Disable App returns "Not Found" response - Given operation "DisableApp" enabled - And new "DisableApp" request - And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" - When the request is sent - Then the response status is 404 Not Found - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Disable App returns "OK" response - Given operation "DisableApp" enabled - And new "DisableApp" request - And there is a valid "app" in the system - And request contains "app_id" parameter from "app.data.id" - When the request is sent - Then the response status is 200 OK From 009f364627b7763b589f6f551cd6ffeb1cc69d26 Mon Sep 17 00:00:00 2001 From: Oliver Li Date: Thu, 9 Jan 2025 01:54:22 -0500 Subject: [PATCH 2/6] handle UUID values --- .generator/src/generator/formatter.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.generator/src/generator/formatter.py b/.generator/src/generator/formatter.py index ab118cfd235..78f2df677c0 100644 --- a/.generator/src/generator/formatter.py +++ b/.generator/src/generator/formatter.py @@ -253,6 +253,7 @@ def reference_to_value(schema, value, print_nullable=True, **kwargs): "date": "Time", "date-time": "Time", "email": "String", + "uuid": "UUID", None: "String", }[type_format] return formatter.format(prefix=prefix, function_name=function_name, value=value) From c6c101ae6325a412e38c478fd281e3c8377dface Mon Sep 17 00:00:00 2001 From: Oliver Li Date: Thu, 9 Jan 2025 02:12:17 -0500 Subject: [PATCH 3/6] add PtrUuid func --- .generator/src/generator/formatter.py | 2 +- api/datadog/utils.go | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.generator/src/generator/formatter.py b/.generator/src/generator/formatter.py index 78f2df677c0..3de017d7348 100644 --- a/.generator/src/generator/formatter.py +++ b/.generator/src/generator/formatter.py @@ -253,7 +253,7 @@ def reference_to_value(schema, value, print_nullable=True, **kwargs): "date": "Time", "date-time": "Time", "email": "String", - "uuid": "UUID", + "uuid": "Uuid", None: "String", }[type_format] return formatter.format(prefix=prefix, function_name=function_name, value=value) diff --git a/api/datadog/utils.go b/api/datadog/utils.go index c908e1d19cc..e37f873b701 100644 --- a/api/datadog/utils.go +++ b/api/datadog/utils.go @@ -12,6 +12,8 @@ import ( "strings" "time" "unicode/utf8" + + "github.com/google/uuid" ) // PtrBool is a helper routine that returns a pointer to given boolean value. @@ -35,9 +37,12 @@ func PtrFloat64(v float64) *float64 { return &v } // PtrString is a helper routine that returns a pointer to given string value. func PtrString(v string) *string { return &v } -// PtrTime is helper routine that returns a pointer to given Time value. +// PtrTime is a helper routine that returns a pointer to given Time value. func PtrTime(v time.Time) *time.Time { return &v } +// PtrUuid is a helper routine that returns a pointer to given Uuid value. +func PtrUuid(v uuid.UUID) *uuid.UUID { return &v } + // PaginationResult pagination item helper struct type PaginationResult[T any] struct { Item T From 4cbf9a9068f07954b0242ab960463616ee7fb475 Mon Sep 17 00:00:00 2001 From: Oliver Li Date: Thu, 9 Jan 2025 02:38:59 -0500 Subject: [PATCH 4/6] add uuid reference case --- .generator/src/generator/formatter.py | 4 +++- api/datadog/utils.go | 7 +------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.generator/src/generator/formatter.py b/.generator/src/generator/formatter.py index 3de017d7348..1dcce4b0a6c 100644 --- a/.generator/src/generator/formatter.py +++ b/.generator/src/generator/formatter.py @@ -249,11 +249,13 @@ def reference_to_value(schema, value, print_nullable=True, **kwargs): return formatter.format(prefix=prefix, function_name=function_name, value=value) if type_name == "string": + if type_format == "uuid": + return f"&{value}" + function_name = { "date": "Time", "date-time": "Time", "email": "String", - "uuid": "Uuid", None: "String", }[type_format] return formatter.format(prefix=prefix, function_name=function_name, value=value) diff --git a/api/datadog/utils.go b/api/datadog/utils.go index e37f873b701..c908e1d19cc 100644 --- a/api/datadog/utils.go +++ b/api/datadog/utils.go @@ -12,8 +12,6 @@ import ( "strings" "time" "unicode/utf8" - - "github.com/google/uuid" ) // PtrBool is a helper routine that returns a pointer to given boolean value. @@ -37,12 +35,9 @@ func PtrFloat64(v float64) *float64 { return &v } // PtrString is a helper routine that returns a pointer to given string value. func PtrString(v string) *string { return &v } -// PtrTime is a helper routine that returns a pointer to given Time value. +// PtrTime is helper routine that returns a pointer to given Time value. func PtrTime(v time.Time) *time.Time { return &v } -// PtrUuid is a helper routine that returns a pointer to given Uuid value. -func PtrUuid(v uuid.UUID) *uuid.UUID { return &v } - // PaginationResult pagination item helper struct type PaginationResult[T any] struct { Item T From 948079dda49f7207931d6471c2acf7950083ac84 Mon Sep 17 00:00:00 2001 From: Oliver Li Date: Thu, 9 Jan 2025 13:39:49 -0500 Subject: [PATCH 5/6] remove apps.feature --- tests/scenarios/features/v2/apps.feature | 208 ----------------------- 1 file changed, 208 deletions(-) delete mode 100644 tests/scenarios/features/v2/apps.feature diff --git a/tests/scenarios/features/v2/apps.feature b/tests/scenarios/features/v2/apps.feature deleted file mode 100644 index 1bed411c311..00000000000 --- a/tests/scenarios/features/v2/apps.feature +++ /dev/null @@ -1,208 +0,0 @@ -@endpoint(apps) @endpoint(apps-v2) -Feature: Apps - Datadog App Builder provides a low-code solution to rapidly develop and - integrate secure, customized applications into your monitoring stack that - are built to accelerate remediation at scale. These API endpoints allow - you to create, read, update, delete, and publish apps. - - Background: - Given a valid "apiKeyAuth" key in the system - And a valid "appKeyAuth" key in the system - And an instance of "Apps" API - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Create App returns "App Created" response - Given operation "CreateApp" enabled - And new "CreateApp" request - And body with value {"data": {"attributes": {"components": [{"events": [], "name": "grid0", "properties": {"children": [{"events": [], "name": "gridCell0", "properties": {"children": [{"events": [], "name": "calloutValue0", "properties": {"isVisible": true, "isDisabled": false, "isLoading": false, "label": "CPU Usage", "size": "sm", "style": "vivid_yellow", "unit": "kB", "value": "42"}, "type": "calloutValue"}], "isVisible": "true", "layout": {"default": {"height": 8, "width": 2, "x": 0, "y": 0}}}, "type": "gridCell"}]}, "type": "grid"}], "description": "This is a simple example app", "embeddedQueries": [], "name": "Example App", "rootInstanceName": "grid0"}, "type": "appDefinitions"}} - When the request is sent - Then the response status is 201 App Created - And the response "data.type" is equal to "appDefinitions" - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Create App returns "Bad Request" response - Given operation "CreateApp" enabled - And new "CreateApp" request - And body with value {"data": {"attributes": {"description": "This is a bad example app", "embeddedQueries": [], "rootInstanceName": "grid0"}, "type": "appDefinitions"}} - When the request is sent - Then the response status is 400 Bad Request - And the response "errors" has length 1 - And the response "errors[0].detail" is equal to "missing required field" - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Delete App returns "Bad Request" response - Given operation "DeleteApp" enabled - And new "DeleteApp" request - And request contains "app_id" parameter with value "bad-app-id" - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/app-builder-backend - Scenario: Delete App returns "Gone" response - Given operation "DeleteApp" enabled - And new "DeleteApp" request - And request contains "app_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 410 Gone - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Delete App returns "Not Found" response - Given operation "DeleteApp" enabled - And new "DeleteApp" request - And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" - When the request is sent - Then the response status is 404 Not Found - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Delete App returns "OK" response - Given operation "DeleteApp" enabled - And there is a valid "app" in the system - And new "DeleteApp" request - And request contains "app_id" parameter from "app.data.id" - When the request is sent - Then the response status is 200 OK - And the response "data.id" has the same value as "app.data.id" - And the response "data.type" is equal to "appDefinitions" - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Delete Multiple Apps returns "Bad Request" response - Given operation "DeleteApps" enabled - And new "DeleteApps" request - And body with value {"data": [{"id": "71c0d358-eac5-41e3-892d-a7467571b9b", "type": "appDefinitions"}, {"id": "71c0d358-eac5-41e3-892d-a7467571b9b0", "type": "appDefinitions"}, {"id": "98e7e44d-1562-474a-90f7-3a94e739c006", "type": "appDefinitions"}]} - When the request is sent - Then the response status is 400 Bad Request - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Delete Multiple Apps returns "Not Found" response - Given operation "DeleteApps" enabled - And new "DeleteApps" request - And body with value {"data": [{"id": "29494ddd-ac13-46a7-8558-b05b050ee755", "type": "appDefinitions"}, {"id": "71c0d358-eac5-41e3-892d-a7467571b9b0", "type": "appDefinitions"}, {"id": "98e7e44d-1562-474a-90f7-3a94e739c006", "type": "appDefinitions"}]} - When the request is sent - Then the response status is 404 Not Found - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Delete Multiple Apps returns "OK" response - Given operation "DeleteApps" enabled - And new "DeleteApps" request - And there is a valid "app" in the system - And body with value {"data": [{"id": "{{ app.data.id }}", "type": "appDefinitions"}]} - When the request is sent - Then the response status is 200 OK - And the response "data" has length 1 - And the response "data[0].id" has the same value as "app.data.id" - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Deploy App returns "Bad Request" response - Given operation "DeployApp" enabled - And new "DeployApp" request - And request contains "app_id" parameter with value "invalid-uuid" - When the request is sent - Then the response status is 400 Bad Request - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Deploy App returns "Created" response - Given operation "DeployApp" enabled - And new "DeployApp" request - And there is a valid "app" in the system - And request contains "app_id" parameter from "app.data.id" - When the request is sent - Then the response status is 201 Created - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Deploy App returns "Not Found" response - Given operation "DeployApp" enabled - And new "DeployApp" request - And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" - When the request is sent - Then the response status is 404 Not Found - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Disable App returns "Bad Request" response - Given operation "DisableApp" enabled - And new "DisableApp" request - And request contains "app_id" parameter with value "invalid-uuid" - When the request is sent - Then the response status is 400 Bad Request - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Disable App returns "Not Found" response - Given operation "DisableApp" enabled - And new "DisableApp" request - And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" - When the request is sent - Then the response status is 404 Not Found - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Disable App returns "OK" response - Given operation "DisableApp" enabled - And new "DisableApp" request - And there is a valid "app" in the system - And request contains "app_id" parameter from "app.data.id" - When the request is sent - Then the response status is 200 OK - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Get App returns "Bad Request" response - Given operation "GetApp" enabled - And new "GetApp" request - And request contains "app_id" parameter with value "invalid-uuid" - When the request is sent - Then the response status is 400 Bad Request - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Get App returns "Not Found" response - Given operation "GetApp" enabled - And new "GetApp" request - And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" - When the request is sent - Then the response status is 404 Not Found - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Get App returns "OK" response - Given operation "GetApp" enabled - And new "GetApp" request - And there is a valid "app" in the system - And request contains "app_id" parameter from "app.data.id" - When the request is sent - Then the response status is 200 OK - And the response "data.id" has the same value as "app.data.id" - And the response "data.type" is equal to "appDefinitions" - - @generated @skip @team:DataDog/app-builder-backend - Scenario: List Apps returns "Bad Request" response - Given operation "ListApps" enabled - And new "ListApps" request - When the request is sent - Then the response status is 400 Bad Request - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: List Apps returns "OK" response - Given operation "ListApps" enabled - And new "ListApps" request - When the request is sent - Then the response status is 200 OK - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Update App returns "Bad Request" response - Given operation "UpdateApp" enabled - And new "UpdateApp" request - And there is a valid "app" in the system - And request contains "app_id" parameter from "app.data.id" - And body with value {"data": {"attributes": {"rootInstanceName": ""}, "id": "{{ app.data.id }}", "type": "appDefinitions"}} - When the request is sent - Then the response status is 400 Bad Request - And the response "errors" has length 1 - And the response "errors[0].detail" is equal to "missing required field" - - @skip-typescript @team:DataDog/app-builder-backend - Scenario: Update App returns "OK" response - Given operation "UpdateApp" enabled - And new "UpdateApp" request - And there is a valid "app" in the system - And request contains "app_id" parameter from "app.data.id" - And body with value {"data": {"attributes": {"name": "Updated Name", "rootInstanceName": "grid0"}, "id": "{{ app.data.id }}", "type": "appDefinitions"}} - When the request is sent - Then the response status is 200 OK - And the response "data.id" has the same value as "app.data.id" - And the response "data.type" is equal to "appDefinitions" - And the response "data.attributes.name" is equal to "Updated Name" From 32b0b4ccf3fe26e1798567c131848df192000a6c Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 21 Jan 2025 20:50:36 +0000 Subject: [PATCH 6/6] Regenerate client from commit a519ecb4 of spec repo --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 944 +++++++----------- api/datadog/configuration.go | 4 +- .../{api_apps.go => api_app_builder.go} | 402 ++++---- api/datadogV2/doc.go | 16 +- api/datadogV2/model_app_builder_event.go | 2 +- api/datadogV2/model_app_definition_type.go | 64 ++ api/datadogV2/model_app_deployment_type.go | 64 ++ api/datadogV2/model_app_meta.go | 119 +-- ...ationship.go => model_app_relationship.go} | 40 +- api/datadogV2/model_component.go | 12 +- api/datadogV2/model_component_grid.go | 14 +- .../model_component_grid_properties.go | 8 +- ...el_component_grid_properties_is_visible.go | 2 +- api/datadogV2/model_component_grid_type.go | 2 +- api/datadogV2/model_component_properties.go | 6 +- .../model_component_properties_is_visible.go | 2 +- api/datadogV2/model_component_type.go | 2 +- api/datadogV2/model_create_app_request.go | 4 +- .../model_create_app_request_data.go | 22 +- ...odel_create_app_request_data_attributes.go | 95 +- .../model_create_app_request_data_type.go | 64 -- api/datadogV2/model_create_app_response.go | 4 +- .../model_create_app_response_data.go | 36 +- .../model_create_app_response_data_type.go | 64 -- api/datadogV2/model_custom_connection.go | 24 +- .../model_custom_connection_attributes.go | 6 +- ...om_connection_attributes_on_prem_runner.go | 6 +- api/datadogV2/model_custom_connection_type.go | 2 +- api/datadogV2/model_delete_app_response.go | 2 +- .../model_delete_app_response_data.go | 34 +- .../model_delete_app_response_data_type.go | 64 -- api/datadogV2/model_delete_apps_request.go | 4 +- .../model_delete_apps_request_data_items.go | 36 +- ...del_delete_apps_request_data_items_type.go | 64 -- api/datadogV2/model_delete_apps_response.go | 4 +- .../model_delete_apps_response_data_items.go | 36 +- ...el_delete_apps_response_data_items_type.go | 64 -- api/datadogV2/model_deploy_app_response.go | 111 -- ...del_deploy_app_response_data_attributes.go | 102 -- .../model_deploy_app_response_data_type.go | 64 -- ...p_response_data.go => model_deployment.go} | 98 +- ...utes.go => model_deployment_attributes.go} | 40 +- api/datadogV2/model_deployment_included.go | 227 ----- .../model_deployment_included_meta.go | 209 ---- .../model_deployment_included_type.go | 64 -- ...t_meta.go => model_deployment_metadata.go} | 76 +- .../model_deployment_relationship.go | 20 +- .../model_deployment_relationship_data.go | 40 +- ...model_deployment_relationship_data_type.go | 64 -- .../model_deployment_relationship_meta.go | 209 ---- api/datadogV2/model_disable_app_response.go | 111 -- .../model_disable_app_response_data.go | 227 ----- ...el_disable_app_response_data_attributes.go | 102 -- .../model_disable_app_response_data_type.go | 64 -- api/datadogV2/model_get_app_response.go | 42 +- api/datadogV2/model_get_app_response_data.go | 38 +- .../model_get_app_response_data_attributes.go | 97 +- .../model_get_app_response_data_type.go | 64 -- api/datadogV2/model_input_schema_data.go | 189 ---- .../model_input_schema_data_attributes.go | 102 -- ...schema_data_attributes_parameters_items.go | 111 -- ...a_data_attributes_parameters_items_data.go | 111 -- ...ibutes_parameters_items_data_attributes.go | 277 ----- api/datadogV2/model_input_schema_data_type.go | 64 -- api/datadogV2/model_list_apps_response.go | 22 +- .../model_list_apps_response_data_items.go | 42 +- ...ist_apps_response_data_items_attributes.go | 12 +- ..._apps_response_data_items_relationships.go | 4 +- ...odel_list_apps_response_data_items_type.go | 64 -- .../model_list_apps_response_meta.go | 4 +- .../model_list_apps_response_meta_page.go | 6 +- ...cript.go => model_publish_app_response.go} | 38 +- api/datadogV2/model_query.go | 28 +- api/datadogV2/model_query_type.go | 2 +- api/datadogV2/model_script_data.go | 189 ---- api/datadogV2/model_script_data_attributes.go | 172 ---- api/datadogV2/model_script_data_type.go | 64 -- ...ema.go => model_unpublish_app_response.go} | 38 +- api/datadogV2/model_update_app_request.go | 4 +- .../model_update_app_request_data.go | 40 +- ...odel_update_app_request_data_attributes.go | 95 +- .../model_update_app_request_data_type.go | 64 -- api/datadogV2/model_update_app_response.go | 42 +- .../model_update_app_response_data.go | 38 +- ...del_update_app_response_data_attributes.go | 97 +- .../model_update_app_response_data_type.go | 64 -- .../model_update_app_response_relationship.go | 146 --- .../v2/{apps => app-builder}/CreateApp.go | 10 +- .../v2/{apps => app-builder}/DeleteApp.go | 9 +- .../v2/{apps => app-builder}/DeleteApps.go | 11 +- examples/v2/{apps => app-builder}/GetApp.go | 9 +- examples/v2/{apps => app-builder}/ListApps.go | 6 +- .../PublishApp.go} | 15 +- .../UnpublishApp.go} | 15 +- .../v2/{apps => app-builder}/UpdateApp.go | 13 +- tests/scenarios/api_mappings.go | 2 +- ...te_App_returns_Bad_Request_response.freeze | 1 + ...eate_App_returns_Bad_Request_response.yaml | 3 +- ...Create_App_returns_Created_response.freeze | 1 + ..._Create_App_returns_Created_response.yaml} | 8 +- ...lete_App_returns_Not_Found_response.freeze | 1 + ...Delete_App_returns_Not_Found_response.yaml | 2 +- ...ario_Delete_App_returns_OK_response.freeze | 1 + ...enario_Delete_App_returns_OK_response.yaml | 10 +- ...ple_Apps_returns_Not_Found_response.freeze | 1 + ...tiple_Apps_returns_Not_Found_response.yaml | 5 +- ...e_Multiple_Apps_returns_OK_response.freeze | 1 + ...ete_Multiple_Apps_returns_OK_response.yaml | 10 +- ..._Get_App_returns_Not_Found_response.freeze | 1 + ...io_Get_App_returns_Not_Found_response.yaml | 2 +- ...cenario_Get_App_returns_OK_response.freeze | 1 + .../Scenario_Get_App_returns_OK_response.yaml | 12 +- ...nario_List_Apps_returns_OK_response.freeze | 1 + ...cenario_List_Apps_returns_OK_response.yaml | 5 +- ...ublish_App_returns_Created_response.freeze | 1 + ...Publish_App_returns_Created_response.yaml} | 10 +- ...lish_App_returns_Not_Found_response.freeze | 1 + ...blish_App_returns_Not_Found_response.yaml} | 2 +- ...lish_App_returns_Not_Found_response.freeze | 1 + ...blish_App_returns_Not_Found_response.yaml} | 2 +- ...o_Unpublish_App_returns_OK_response.freeze | 1 + ...io_Unpublish_App_returns_OK_response.yaml} | 10 +- ...te_App_returns_Bad_Request_response.freeze | 1 + ...date_App_returns_Bad_Request_response.yaml | 13 +- ...ario_Update_App_returns_OK_response.freeze | 1 + ...enario_Update_App_returns_OK_response.yaml | 14 +- ...te_App_returns_App_Created_response.freeze | 1 - ...te_App_returns_Bad_Request_response.freeze | 1 - ...te_App_returns_Bad_Request_response.freeze | 1 - ...lete_App_returns_Bad_Request_response.yaml | 19 - ...lete_App_returns_Not_Found_response.freeze | 1 - ...ario_Delete_App_returns_OK_response.freeze | 1 - ...e_Apps_returns_Bad_Request_response.freeze | 1 - ...ple_Apps_returns_Bad_Request_response.yaml | 23 - ...ple_Apps_returns_Not_Found_response.freeze | 1 - ...e_Multiple_Apps_returns_OK_response.freeze | 1 - ...oy_App_returns_Bad_Request_response.freeze | 1 - ...ploy_App_returns_Bad_Request_response.yaml | 19 - ...Deploy_App_returns_Created_response.freeze | 1 - ...ploy_App_returns_Not_Found_response.freeze | 1 - ...le_App_returns_Bad_Request_response.freeze | 1 - ...able_App_returns_Bad_Request_response.yaml | 19 - ...able_App_returns_Not_Found_response.freeze | 1 - ...rio_Disable_App_returns_OK_response.freeze | 1 - ...et_App_returns_Bad_Request_response.freeze | 1 - ..._Get_App_returns_Bad_Request_response.yaml | 19 - ..._Get_App_returns_Not_Found_response.freeze | 1 - ...cenario_Get_App_returns_OK_response.freeze | 1 - ...nario_List_Apps_returns_OK_response.freeze | 1 - ...te_App_returns_Bad_Request_response.freeze | 1 - ...ario_Update_App_returns_OK_response.freeze | 1 - .../scenarios/features/v2/app_builder.feature | 208 ++++ tests/scenarios/features/v2/given.json | 2 +- tests/scenarios/features/v2/undo.json | 20 +- 155 files changed, 1629 insertions(+), 5477 deletions(-) rename api/datadogV2/{api_apps.go => api_app_builder.go} (92%) create mode 100644 api/datadogV2/model_app_definition_type.go create mode 100644 api/datadogV2/model_app_deployment_type.go rename api/datadogV2/{model_get_app_response_relationship.go => model_app_relationship.go} (73%) delete mode 100644 api/datadogV2/model_create_app_request_data_type.go delete mode 100644 api/datadogV2/model_create_app_response_data_type.go delete mode 100644 api/datadogV2/model_delete_app_response_data_type.go delete mode 100644 api/datadogV2/model_delete_apps_request_data_items_type.go delete mode 100644 api/datadogV2/model_delete_apps_response_data_items_type.go delete mode 100644 api/datadogV2/model_deploy_app_response.go delete mode 100644 api/datadogV2/model_deploy_app_response_data_attributes.go delete mode 100644 api/datadogV2/model_deploy_app_response_data_type.go rename api/datadogV2/{model_deploy_app_response_data.go => model_deployment.go} (60%) rename api/datadogV2/{model_deployment_included_attributes.go => model_deployment_attributes.go} (65%) delete mode 100644 api/datadogV2/model_deployment_included.go delete mode 100644 api/datadogV2/model_deployment_included_meta.go delete mode 100644 api/datadogV2/model_deployment_included_type.go rename api/datadogV2/{model_deployment_meta.go => model_deployment_metadata.go} (69%) delete mode 100644 api/datadogV2/model_deployment_relationship_data_type.go delete mode 100644 api/datadogV2/model_deployment_relationship_meta.go delete mode 100644 api/datadogV2/model_disable_app_response.go delete mode 100644 api/datadogV2/model_disable_app_response_data.go delete mode 100644 api/datadogV2/model_disable_app_response_data_attributes.go delete mode 100644 api/datadogV2/model_disable_app_response_data_type.go delete mode 100644 api/datadogV2/model_get_app_response_data_type.go delete mode 100644 api/datadogV2/model_input_schema_data.go delete mode 100644 api/datadogV2/model_input_schema_data_attributes.go delete mode 100644 api/datadogV2/model_input_schema_data_attributes_parameters_items.go delete mode 100644 api/datadogV2/model_input_schema_data_attributes_parameters_items_data.go delete mode 100644 api/datadogV2/model_input_schema_data_attributes_parameters_items_data_attributes.go delete mode 100644 api/datadogV2/model_input_schema_data_type.go delete mode 100644 api/datadogV2/model_list_apps_response_data_items_type.go rename api/datadogV2/{model_script.go => model_publish_app_response.go} (71%) delete mode 100644 api/datadogV2/model_script_data.go delete mode 100644 api/datadogV2/model_script_data_attributes.go delete mode 100644 api/datadogV2/model_script_data_type.go rename api/datadogV2/{model_input_schema.go => model_unpublish_app_response.go} (70%) delete mode 100644 api/datadogV2/model_update_app_request_data_type.go delete mode 100644 api/datadogV2/model_update_app_response_data_type.go delete mode 100644 api/datadogV2/model_update_app_response_relationship.go rename examples/v2/{apps => app-builder}/CreateApp.go (86%) rename examples/v2/{apps => app-builder}/DeleteApp.go (69%) rename examples/v2/{apps => app-builder}/DeleteApps.go (69%) rename examples/v2/{apps => app-builder}/GetApp.go (70%) rename examples/v2/{apps => app-builder}/ListApps.go (75%) rename examples/v2/{apps/DisableApp.go => app-builder/PublishApp.go} (53%) rename examples/v2/{apps/DeployApp.go => app-builder/UnpublishApp.go} (53%) rename examples/v2/{apps => app-builder}/UpdateApp.go (71%) create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Bad_Request_response.freeze rename tests/scenarios/cassettes/TestScenarios/v2/{Feature_Apps => Feature_App_Builder}/Scenario_Create_App_returns_Bad_Request_response.yaml (78%) create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Created_response.freeze rename tests/scenarios/cassettes/TestScenarios/v2/{Feature_Apps/Scenario_Create_App_returns_App_Created_response.yaml => Feature_App_Builder/Scenario_Create_App_returns_Created_response.yaml} (57%) create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_Not_Found_response.freeze rename tests/scenarios/cassettes/TestScenarios/v2/{Feature_Apps => Feature_App_Builder}/Scenario_Delete_App_returns_Not_Found_response.yaml (83%) create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_OK_response.freeze rename tests/scenarios/cassettes/TestScenarios/v2/{Feature_Apps => Feature_App_Builder}/Scenario_Delete_App_returns_OK_response.yaml (79%) create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.freeze rename tests/scenarios/cassettes/TestScenarios/v2/{Feature_Apps => Feature_App_Builder}/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.yaml (53%) create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_OK_response.freeze rename tests/scenarios/cassettes/TestScenarios/v2/{Feature_Apps => Feature_App_Builder}/Scenario_Delete_Multiple_Apps_returns_OK_response.yaml (82%) create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_Not_Found_response.freeze rename tests/scenarios/cassettes/TestScenarios/v2/{Feature_Apps => Feature_App_Builder}/Scenario_Get_App_returns_Not_Found_response.yaml (83%) create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_OK_response.freeze rename tests/scenarios/cassettes/TestScenarios/v2/{Feature_Apps => Feature_App_Builder}/Scenario_Get_App_returns_OK_response.yaml (82%) create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Apps_returns_OK_response.freeze rename tests/scenarios/cassettes/TestScenarios/v2/{Feature_Apps => Feature_App_Builder}/Scenario_List_Apps_returns_OK_response.yaml (68%) create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Created_response.freeze rename tests/scenarios/cassettes/TestScenarios/v2/{Feature_Apps/Scenario_Deploy_App_returns_Created_response.yaml => Feature_App_Builder/Scenario_Publish_App_returns_Created_response.yaml} (73%) create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Not_Found_response.freeze rename tests/scenarios/cassettes/TestScenarios/v2/{Feature_Apps/Scenario_Deploy_App_returns_Not_Found_response.yaml => Feature_App_Builder/Scenario_Publish_App_returns_Not_Found_response.yaml} (83%) create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_Not_Found_response.freeze rename tests/scenarios/cassettes/TestScenarios/v2/{Feature_Apps/Scenario_Disable_App_returns_Not_Found_response.yaml => Feature_App_Builder/Scenario_Unpublish_App_returns_Not_Found_response.yaml} (83%) create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_OK_response.freeze rename tests/scenarios/cassettes/TestScenarios/v2/{Feature_Apps/Scenario_Disable_App_returns_OK_response.yaml => Feature_App_Builder/Scenario_Unpublish_App_returns_OK_response.yaml} (76%) create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_Bad_Request_response.freeze rename tests/scenarios/cassettes/TestScenarios/v2/{Feature_Apps => Feature_App_Builder}/Scenario_Update_App_returns_Bad_Request_response.yaml (72%) create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_OK_response.freeze rename tests/scenarios/cassettes/TestScenarios/v2/{Feature_Apps => Feature_App_Builder}/Scenario_Update_App_returns_OK_response.yaml (81%) delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_App_Created_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_Bad_Request_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Bad_Request_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Bad_Request_response.yaml delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Not_Found_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_OK_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Bad_Request_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Bad_Request_response.yaml delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_OK_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Bad_Request_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Bad_Request_response.yaml delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Created_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Not_Found_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_Bad_Request_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_Bad_Request_response.yaml delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_Not_Found_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_OK_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Bad_Request_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Bad_Request_response.yaml delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Not_Found_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_OK_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_List_Apps_returns_OK_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_Bad_Request_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_OK_response.freeze create mode 100644 tests/scenarios/features/v2/app_builder.feature diff --git a/.apigentools-info b/.apigentools-info index 9060ac4f697..4251c88c709 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-21 14:16:33.980025", - "spec_repo_commit": "0bbc13ae" + "regenerated": "2025-01-21 20:49:14.304708", + "spec_repo_commit": "a519ecb4" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-21 14:16:33.995142", - "spec_repo_commit": "0bbc13ae" + "regenerated": "2025-01-21 20:49:14.319616", + "spec_repo_commit": "a519ecb4" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3b81448eef7..d28a5a714ac 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1806,7 +1806,8 @@ components: - apm_retention_filter AppBuilderEvent: additionalProperties: {} - description: The definition of `AppBuilderEvent` object. + description: An event on a UI component that triggers a response or action in + an app. properties: name: $ref: '#/components/schemas/AppBuilderEventName' @@ -1826,6 +1827,7 @@ components: - close - open - executionFinished + example: click type: string x-enum-varnames: - PAGECHANGE @@ -1849,6 +1851,7 @@ components: - openUrl - downloadFile - setStateVariableValue + example: triggerQuery type: string x-enum-varnames: - CUSTOM @@ -1859,44 +1862,77 @@ components: - OPENURL - DOWNLOADFILE - SETSTATEVARIABLEVALUE + AppDefinitionType: + default: appDefinitions + description: The app definition type. + enum: + - appDefinitions + example: appDefinitions + type: string + x-enum-varnames: + - APPDEFINITIONS + AppDeploymentType: + default: deployment + description: The deployment type. + enum: + - deployment + example: deployment + type: string + x-enum-varnames: + - DEPLOYMENT AppMeta: - description: The definition of `AppMeta` object. + description: Metadata of an app. properties: created_at: - description: The `AppMeta` `created_at`. + description: Timestamp of when the app was created. + format: date-time type: string deleted_at: - description: The `AppMeta` `deleted_at`. + description: Timestamp of when the app was deleted. + format: date-time type: string org_id: - description: The `AppMeta` `org_id`. + description: The Datadog organization ID that owns the app. format: int64 type: integer - run_as_user: - description: The `AppMeta` `run_as_user`. - type: string updated_at: - description: The `AppMeta` `updated_at`. + description: Timestamp of when the app was last updated. + format: date-time type: string updated_since_deployment: - description: The `AppMeta` `updated_since_deployment`. + description: Whether the app has been updated since it was last published. + Published apps are pinned to a specific version and do not automatically + update when the app is updated. type: boolean user_id: - description: The `AppMeta` `user_id`. + description: The ID of the user who created the app. format: int64 type: integer user_name: - description: The `AppMeta` `user_name`. + description: The name (or email address) of the user who created the app. type: string user_uuid: - description: The `AppMeta` `user_uuid`. + description: The UUID of the user who created the app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 format: uuid type: string version: - description: The `AppMeta` `version`. + description: The version number of the app. This starts at 1 and increments + with each update. format: int64 type: integer type: object + AppRelationship: + description: The app's publication relationship and custom connections. + properties: + connections: + description: Array of custom connections used by the app. + items: + $ref: '#/components/schemas/CustomConnection' + type: array + deployment: + $ref: '#/components/schemas/DeploymentRelationship' + type: object ApplicationKeyCreateAttributes: description: Attributes used to create an application Key. properties: @@ -2059,6 +2095,7 @@ components: - -created_at - -updated_at - -user_name + example: -created_at type: string x-enum-varnames: - NAME @@ -6048,19 +6085,21 @@ components: - location type: object Component: - description: The definition of `Component` object. + description: '[Definition of a UI component in the app](https://docs.datadoghq.com/service_management/app_builder/components/)' properties: events: - description: The `Component` `events`. + description: Events to listen for on the UI component. items: $ref: '#/components/schemas/AppBuilderEvent' type: array id: - description: The `Component` `id`. + description: The ID of the UI component. This property is deprecated; use + `name` to identify individual components instead. nullable: true type: string name: - description: The `Component` `name`. + description: A unique identifier for this UI component. This name is also + visible in the app editor. example: '' type: string properties: @@ -6073,18 +6112,21 @@ components: - properties type: object ComponentGrid: - description: The definition of `ComponentGrid` object. + description: A grid component. The grid component is the root canvas for an + app and contains all other components. properties: events: - description: The `ComponentGrid` `events`. + description: Events to listen for on the grid component. items: $ref: '#/components/schemas/AppBuilderEvent' type: array id: - description: The `ComponentGrid` `id`. + description: The ID of the grid component. This property is deprecated; + use `name` to identify individual components instead. type: string name: - description: The `ComponentGrid` `name`. + description: A unique identifier for this grid component. This name is also + visible in the app editor. example: '' type: string properties: @@ -6097,14 +6139,14 @@ components: - properties type: object ComponentGridProperties: - description: The definition of `ComponentGridProperties` object. + description: Properties of a grid component. properties: backgroundColor: default: default - description: The `ComponentGridProperties` `backgroundColor`. + description: The background color of the grid. type: string children: - description: The `ComponentGridProperties` `children`. + description: The child components of the grid. items: $ref: '#/components/schemas/Component' type: array @@ -6112,13 +6154,15 @@ components: $ref: '#/components/schemas/ComponentGridPropertiesIsVisible' type: object ComponentGridPropertiesIsVisible: - description: The definition of `ComponentGridPropertiesIsVisible` object. + description: Whether the grid component and its children are visible. If a string, + it should be a valid JavaScript expression that evaluates to a boolean. oneOf: - type: string - default: true type: boolean ComponentGridType: - description: The definition of `ComponentGridType` object. + default: grid + description: The grid component type. enum: - grid example: grid @@ -6127,10 +6171,12 @@ components: - GRID ComponentProperties: additionalProperties: {} - description: The definition of `ComponentProperties` object. + description: Properties of a UI component. Different component types can have + their own additional unique properties. See the [components documentation](https://docs.datadoghq.com/service_management/app_builder/components/) + for more detail on each component type and its properties. properties: children: - description: The `ComponentProperties` `children`. + description: The child components of the UI component. items: $ref: '#/components/schemas/Component' type: array @@ -6138,15 +6184,16 @@ components: $ref: '#/components/schemas/ComponentPropertiesIsVisible' type: object ComponentPropertiesIsVisible: - description: The definition of `ComponentPropertiesIsVisible` object. + description: Whether the UI component is visible. If this is a string, it must + be a valid JavaScript expression that evaluates to a boolean. oneOf: - type: boolean - - description: If a string, it should be a valid JavaScript expression that - evaluates to a boolean. + - description: If this is a string, it must be a valid JavaScript expression + that evaluates to a boolean. example: ${true} type: string ComponentType: - description: The definition of `ComponentType` object. + description: The UI component type. enum: - table - textInput @@ -6168,7 +6215,7 @@ components: - search - container - calloutValue - example: table + example: text type: string x-enum-varnames: - TABLE @@ -7207,7 +7254,7 @@ components: $ref: '#/components/schemas/ActionConnectionData' type: object CreateAppRequest: - description: The definition of `CreateAppRequest` object. + description: A request object for creating a new app. example: data: attributes: @@ -7251,87 +7298,70 @@ components: $ref: '#/components/schemas/CreateAppRequestData' type: object CreateAppRequestData: - description: The definition of `CreateAppRequestData` object. + description: The data object containing the app definition. properties: attributes: $ref: '#/components/schemas/CreateAppRequestDataAttributes' type: - $ref: '#/components/schemas/CreateAppRequestDataType' + $ref: '#/components/schemas/AppDefinitionType' required: - type type: object CreateAppRequestDataAttributes: - description: The definition of `CreateAppRequestDataAttributes` object. + description: App definition attributes such as name, description, and components. properties: components: - description: The `attributes` `components`. + description: The UI components that make up the app. items: $ref: '#/components/schemas/ComponentGrid' type: array description: - description: The `attributes` `description`. + description: A human-readable description for the app. type: string embeddedQueries: - description: The `attributes` `embeddedQueries`. + description: An array of queries, such as external actions and state variables, + that the app uses. items: $ref: '#/components/schemas/Query' type: array - inputSchema: - $ref: '#/components/schemas/InputSchema' name: - description: The `attributes` `name`. + description: The name of the app. type: string rootInstanceName: - description: The `attributes` `rootInstanceName`. + description: The name of the root component of the app. This must be a `grid` + component that contains all other components. type: string - scripts: - description: The `attributes` `scripts`. - items: - $ref: '#/components/schemas/Script' - type: array tags: - description: The `attributes` `tags`. + description: A list of tags for the app, which can be used to filter apps. + example: + - service:webshop-backend + - team:webshop items: + description: An individual tag for the app. type: string type: array type: object - CreateAppRequestDataType: - default: appDefinitions - description: The definition of `CreateAppRequestDataType` object. - enum: - - appDefinitions - example: appDefinitions - type: string - x-enum-varnames: - - APPDEFINITIONS CreateAppResponse: - description: The definition of `CreateAppResponse` object. + description: The response object after a new app has been successfully created, + with the app ID. properties: data: $ref: '#/components/schemas/CreateAppResponseData' type: object CreateAppResponseData: - description: The definition of `CreateAppResponseData` object. + description: The data object containing the app ID. properties: id: - description: The `data` `id`. - example: '' + description: The ID of the created app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid type: string type: - $ref: '#/components/schemas/CreateAppResponseDataType' + $ref: '#/components/schemas/AppDefinitionType' required: - id - type type: object - CreateAppResponseDataType: - default: appDefinitions - description: The definition of `CreateAppResponseDataType` object. - enum: - - appDefinitions - example: appDefinitions - type: string - x-enum-varnames: - - APPDEFINITIONS CreateDataDeletionRequestBody: description: Object needed to create a data deletion request. properties: @@ -7697,40 +7727,44 @@ components: $ref: '#/components/schemas/CsmServerlessCoverageAnalysisData' type: object CustomConnection: - description: The definition of `CustomConnection` object. + description: A custom connection used by an app. properties: attributes: $ref: '#/components/schemas/CustomConnectionAttributes' id: - description: The `CustomConnection` `id`. + description: The ID of the custom connection. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid type: string type: $ref: '#/components/schemas/CustomConnectionType' type: object CustomConnectionAttributes: - description: The definition of `CustomConnectionAttributes` object. + description: The custom connection attributes. properties: name: - description: The `attributes` `name`. + description: The name of the custom connection. type: string onPremRunner: $ref: '#/components/schemas/CustomConnectionAttributesOnPremRunner' type: object CustomConnectionAttributesOnPremRunner: - description: The definition of `CustomConnectionAttributesOnPremRunner` object. + description: Information about the Private Action Runner used by the custom + connection, if the custom connection is associated with a Private Action Runner. properties: id: - description: The `onPremRunner` `id`. + description: The Private Action Runner ID. type: string url: - description: The `onPremRunner` `url`. + description: The URL of the Private Action Runner. type: string type: object CustomConnectionType: default: custom_connections - description: The definition of `CustomConnectionType` object. + description: The custom connection type. enum: - custom_connections + example: custom_connections type: string x-enum-varnames: - CUSTOM_CONNECTIONS @@ -9116,7 +9150,7 @@ components: type: array type: object DeleteAppResponse: - description: The definition of `DeleteAppResponse` object. + description: The response object after an app has been successfully deleted. properties: data: $ref: '#/components/schemas/DeleteAppResponseData' @@ -9125,94 +9159,71 @@ components: description: The definition of `DeleteAppResponseData` object. properties: id: - description: The `data` `id`. - example: '' + description: The ID of the deleted app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid type: string type: - $ref: '#/components/schemas/DeleteAppResponseDataType' + $ref: '#/components/schemas/AppDefinitionType' required: - id - type type: object - DeleteAppResponseDataType: - default: appDefinitions - description: The definition of `DeleteAppResponseDataType` object. - enum: - - appDefinitions - example: appDefinitions - type: string - x-enum-varnames: - - APPDEFINITIONS DeleteAppsRequest: - description: The definition of `DeleteAppsRequest` object. + description: A request object for deleting multiple apps by ID. example: data: - - id: 29494ddd-ac13-46a7-8558-b05b050ee755 + - id: aea2ed17-b45f-40d0-ba59-c86b7972c901 type: appDefinitions - - id: 71c0d358-eac5-41e3-892d-a7467571b9b0 + - id: f69bb8be-6168-4fe7-a30d-370256b6504a type: appDefinitions - - id: 98e7e44d-1562-474a-90f7-3a94e739c006 + - id: ab1ed73e-13ad-4426-b0df-a0ff8876a088 type: appDefinitions properties: data: - description: The `DeleteAppsRequest` `data`. + description: An array of objects containing the IDs of the apps to delete. items: $ref: '#/components/schemas/DeleteAppsRequestDataItems' type: array type: object DeleteAppsRequestDataItems: - description: The definition of `DeleteAppsRequestDataItems` object. + description: An object containing the ID of an app to delete. properties: id: - description: The `items` `id`. - example: '' + description: The ID of the app to delete. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid type: string type: - $ref: '#/components/schemas/DeleteAppsRequestDataItemsType' + $ref: '#/components/schemas/AppDefinitionType' required: - id - type type: object - DeleteAppsRequestDataItemsType: - default: appDefinitions - description: The definition of `DeleteAppsRequestDataItemsType` object. - enum: - - appDefinitions - example: appDefinitions - type: string - x-enum-varnames: - - APPDEFINITIONS DeleteAppsResponse: - description: The definition of `DeleteAppsResponse` object. + description: The response object after multiple apps have been successfully + deleted. properties: data: - description: The `DeleteAppsResponse` `data`. + description: An array of objects containing the IDs of the deleted apps. items: $ref: '#/components/schemas/DeleteAppsResponseDataItems' type: array type: object DeleteAppsResponseDataItems: - description: The definition of `DeleteAppsResponseDataItems` object. + description: An object containing the ID of a deleted app. properties: id: - description: The `items` `id`. - example: '' + description: The ID of the deleted app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid type: string type: - $ref: '#/components/schemas/DeleteAppsResponseDataItemsType' + $ref: '#/components/schemas/AppDefinitionType' required: - id - type type: object - DeleteAppsResponseDataItemsType: - default: appDefinitions - description: The definition of `DeleteAppsResponseDataItemsType` object. - enum: - - appDefinitions - example: appDefinitions - type: string - x-enum-varnames: - - APPDEFINITIONS DependencyLocation: description: Static library vulnerability location. properties: @@ -9247,175 +9258,71 @@ components: - column_start - column_end type: object - DeployAppResponse: - description: The definition of `DeployAppResponse` object. - properties: - data: - $ref: '#/components/schemas/DeployAppResponseData' - type: object - DeployAppResponseData: - description: The definition of `DeployAppResponseData` object. - properties: - attributes: - $ref: '#/components/schemas/DeployAppResponseDataAttributes' - id: - description: The `data` `id`. - type: string - meta: - $ref: '#/components/schemas/DeploymentMeta' - type: - $ref: '#/components/schemas/DeployAppResponseDataType' - type: object - DeployAppResponseDataAttributes: - description: The definition of `DeployAppResponseDataAttributes` object. - properties: - app_version_id: - description: The `attributes` `app_version_id`. - type: string - type: object - DeployAppResponseDataType: - default: deployment - description: The definition of `DeployAppResponseDataType` object. - enum: - - deployment - type: string - x-enum-varnames: - - DEPLOYMENT Deployment: - description: The definition of `Deployment` object. + description: The version of the app that was published. properties: attributes: $ref: '#/components/schemas/DeploymentAttributes' id: - description: The `Deployment` `id`. + description: The deployment ID. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid type: string meta: - $ref: '#/components/schemas/DeploymentMeta' + $ref: '#/components/schemas/DeploymentMetadata' type: - $ref: '#/components/schemas/DeploymentType' + $ref: '#/components/schemas/AppDeploymentType' type: object DeploymentAttributes: - description: The definition of `DeploymentAttributes` object. - properties: - app_version_id: - description: The `attributes` `app_version_id`. - type: string - type: object - DeploymentIncluded: - description: The definition of `DeploymentIncluded` object. - properties: - attributes: - $ref: '#/components/schemas/DeploymentIncludedAttributes' - id: - description: The `DeploymentIncluded` `id`. - type: string - meta: - $ref: '#/components/schemas/DeploymentIncludedMeta' - type: - $ref: '#/components/schemas/DeploymentIncludedType' - type: object - DeploymentIncludedAttributes: - description: The definition of `DeploymentIncludedAttributes` object. + description: The attributes object containing the version ID of the published + app. properties: app_version_id: - description: The `attributes` `app_version_id`. - type: string - type: object - DeploymentIncludedMeta: - description: The definition of `DeploymentIncludedMeta` object. - properties: - created_at: - description: The `meta` `created_at`. - type: string - user_id: - description: The `meta` `user_id`. - format: int64 - type: integer - user_name: - description: The `meta` `user_name`. - type: string - user_uuid: - description: The `meta` `user_uuid`. + description: The version ID of the app that was published. For an unpublished + app, this will always be the nil UUID (`00000000-0000-0000-0000-000000000000`). + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 format: uuid type: string type: object - DeploymentIncludedType: - default: deployment - description: The definition of `DeploymentIncludedType` object. - enum: - - deployment - type: string - x-enum-varnames: - - DEPLOYMENT - DeploymentMeta: - description: The definition of `DeploymentMeta` object. + DeploymentMetadata: + description: Metadata object containing the publication creation information. properties: created_at: - description: The `DeploymentMeta` `created_at`. + description: Timestamp of when the app was published. + format: date-time type: string user_id: - description: The `DeploymentMeta` `user_id`. + description: The ID of the user who published the app. format: int64 type: integer user_name: - description: The `DeploymentMeta` `user_name`. + description: The name (or email address) of the user who published the app. type: string user_uuid: - description: The `DeploymentMeta` `user_uuid`. + description: The UUID of the user who published the app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 format: uuid type: string type: object DeploymentRelationship: - description: The definition of `DeploymentRelationship` object. + description: Information pointing to the app's publication status. properties: data: $ref: '#/components/schemas/DeploymentRelationshipData' meta: - $ref: '#/components/schemas/DeploymentRelationshipMeta' + $ref: '#/components/schemas/DeploymentMetadata' type: object DeploymentRelationshipData: - description: The definition of `DeploymentRelationshipData` object. + description: Data object containing the deployment ID. properties: id: - description: The `data` `id`. - type: string - type: - $ref: '#/components/schemas/DeploymentRelationshipDataType' - type: object - DeploymentRelationshipDataType: - default: deployment - description: The definition of `DeploymentRelationshipDataType` object. - enum: - - deployment - type: string - x-enum-varnames: - - DEPLOYMENT - DeploymentRelationshipMeta: - description: The definition of `DeploymentRelationshipMeta` object. - properties: - created_at: - description: The `meta` `created_at`. - type: string - user_id: - description: The `meta` `user_id`. - format: int64 - type: integer - user_name: - description: The `meta` `user_name`. - type: string - user_uuid: - description: The `meta` `user_uuid`. + description: The deployment ID. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 format: uuid type: string + type: + $ref: '#/components/schemas/AppDeploymentType' type: object - DeploymentType: - default: deployment - description: The definition of `DeploymentType` object. - enum: - - deployment - type: string - x-enum-varnames: - - DEPLOYMENT DetailedFinding: description: A single finding with with message and resource configuration. properties: @@ -9599,40 +9506,6 @@ components: description: The type of the resource. The value should always be device. type: string type: object - DisableAppResponse: - description: The definition of `DisableAppResponse` object. - properties: - data: - $ref: '#/components/schemas/DisableAppResponseData' - type: object - DisableAppResponseData: - description: The definition of `DisableAppResponseData` object. - properties: - attributes: - $ref: '#/components/schemas/DisableAppResponseDataAttributes' - id: - description: The `data` `id`. - type: string - meta: - $ref: '#/components/schemas/DeploymentMeta' - type: - $ref: '#/components/schemas/DisableAppResponseDataType' - type: object - DisableAppResponseDataAttributes: - description: The definition of `DisableAppResponseDataAttributes` object. - properties: - app_version_id: - description: The `attributes` `app_version_id`. - type: string - type: object - DisableAppResponseDataType: - default: deployment - description: The definition of `DisableAppResponseDataType` object. - enum: - - deployment - type: string - x-enum-varnames: - - DEPLOYMENT DomainAllowlist: description: The email domain allowlist for an org. properties: @@ -12434,94 +12307,74 @@ components: $ref: '#/components/schemas/ActionConnectionData' type: object GetAppResponse: - description: The definition of `GetAppResponse` object. + description: The full app definition response object. properties: data: $ref: '#/components/schemas/GetAppResponseData' included: - description: The `GetAppResponse` `included`. + description: Data on the version of the app that was published. items: - $ref: '#/components/schemas/DeploymentIncluded' + $ref: '#/components/schemas/Deployment' type: array meta: $ref: '#/components/schemas/AppMeta' relationship: - $ref: '#/components/schemas/GetAppResponseRelationship' + $ref: '#/components/schemas/AppRelationship' type: object GetAppResponseData: - description: The definition of `GetAppResponseData` object. + description: The data object containing the app definition. properties: attributes: $ref: '#/components/schemas/GetAppResponseDataAttributes' id: - description: The `data` `id`. - example: '' + description: The ID of the app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid type: string type: - $ref: '#/components/schemas/GetAppResponseDataType' + $ref: '#/components/schemas/AppDefinitionType' required: - id - type - attributes type: object GetAppResponseDataAttributes: - description: The definition of `GetAppResponseDataAttributes` object. + description: The app definition attributes, such as name, description, and components. properties: components: - description: The `attributes` `components`. + description: The UI components that make up the app. items: $ref: '#/components/schemas/ComponentGrid' type: array description: - description: The `attributes` `description`. + description: A human-readable description for the app. type: string embeddedQueries: - description: The `attributes` `embeddedQueries`. + description: An array of queries, such as external actions and state variables, + that the app uses. items: $ref: '#/components/schemas/Query' type: array favorite: - description: The `attributes` `favorite`. + description: Whether the app is marked as a favorite by the current user. type: boolean - inputSchema: - $ref: '#/components/schemas/InputSchema' name: - description: The `attributes` `name`. + description: The name of the app. type: string rootInstanceName: - description: The `attributes` `rootInstanceName`. + description: The name of the root component of the app. This must be a `grid` + component that contains all other components. type: string - scripts: - description: The `attributes` `scripts`. - items: - $ref: '#/components/schemas/Script' - type: array tags: - description: The `attributes` `tags`. + description: A list of tags for the app, which can be used to filter apps. + example: + - service:webshop-backend + - team:webshop items: + description: An individual tag for the app. type: string type: array type: object - GetAppResponseDataType: - default: appDefinitions - description: The definition of `GetAppResponseDataType` object. - enum: - - appDefinitions - example: appDefinitions - type: string - x-enum-varnames: - - APPDEFINITIONS - GetAppResponseRelationship: - description: The definition of `GetAppResponseRelationship` object. - properties: - connections: - description: The `relationship` `connections`. - items: - $ref: '#/components/schemas/CustomConnection' - type: array - deployment: - $ref: '#/components/schemas/DeploymentRelationship' - type: object GetDataDeletionsResponseBody: description: The response from the get data deletion requests endpoint. properties: @@ -15427,77 +15280,6 @@ components: - ONCALL - INCIDENT - RELATION - InputSchema: - description: The definition of `InputSchema` object. - properties: - data: - $ref: '#/components/schemas/InputSchemaData' - type: object - InputSchemaData: - description: The definition of `InputSchemaData` object. - properties: - attributes: - $ref: '#/components/schemas/InputSchemaDataAttributes' - id: - description: The `data` `id`. - type: string - type: - $ref: '#/components/schemas/InputSchemaDataType' - type: object - InputSchemaDataAttributes: - description: The definition of `InputSchemaDataAttributes` object. - properties: - parameters: - description: The `attributes` `parameters`. - items: - $ref: '#/components/schemas/InputSchemaDataAttributesParametersItems' - type: array - type: object - InputSchemaDataAttributesParametersItems: - description: The definition of `InputSchemaDataAttributesParametersItems` object. - properties: - data: - $ref: '#/components/schemas/InputSchemaDataAttributesParametersItemsData' - type: object - InputSchemaDataAttributesParametersItemsData: - description: The definition of `InputSchemaDataAttributesParametersItemsData` - object. - properties: - attributes: - $ref: '#/components/schemas/InputSchemaDataAttributesParametersItemsDataAttributes' - type: object - InputSchemaDataAttributesParametersItemsDataAttributes: - description: The definition of `InputSchemaDataAttributesParametersItemsDataAttributes` - object. - properties: - defaultValue: - description: The `attributes` `defaultValue`. - description: - description: The `attributes` `description`. - type: string - enum: - description: The `attributes` `enum`. - items: - type: string - type: array - label: - description: The `attributes` `label`. - type: string - name: - description: The `attributes` `name`. - type: string - type: - description: The `attributes` `type`. - type: string - type: object - InputSchemaDataType: - default: inputSchema - description: The definition of `InputSchemaDataType` object. - enum: - - inputSchema - type: string - x-enum-varnames: - - INPUTSCHEMA IntakePayloadAccepted: description: The payload accepted for intake. properties: @@ -15943,92 +15725,92 @@ components: $ref: '#/components/schemas/ApplicationKeyResponseMeta' type: object ListAppsResponse: - description: The definition of `ListAppsResponse` object. + description: A paginated list of apps matching the specified filters and sorting. properties: data: - description: The `ListAppsResponse` `data`. + description: An array of app definitions. items: $ref: '#/components/schemas/ListAppsResponseDataItems' type: array included: - description: The `ListAppsResponse` `included`. + description: Data on the version of the app that was published. items: - $ref: '#/components/schemas/DeploymentIncluded' + $ref: '#/components/schemas/Deployment' type: array meta: $ref: '#/components/schemas/ListAppsResponseMeta' type: object ListAppsResponseDataItems: - description: The definition of `ListAppsResponseDataItems` object. + description: An app definition object. This contains only basic information + about the app such as ID, name, and tags. properties: attributes: $ref: '#/components/schemas/ListAppsResponseDataItemsAttributes' id: - description: The `items` `id`. - example: '' + description: The ID of the app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid type: string meta: $ref: '#/components/schemas/AppMeta' relationships: $ref: '#/components/schemas/ListAppsResponseDataItemsRelationships' type: - $ref: '#/components/schemas/ListAppsResponseDataItemsType' + $ref: '#/components/schemas/AppDefinitionType' required: - id - type - attributes type: object ListAppsResponseDataItemsAttributes: - description: The definition of `ListAppsResponseDataItemsAttributes` object. + description: Basic information about the app such as name, description, and + tags. properties: description: - description: The `attributes` `description`. + description: A human-readable description for the app. type: string favorite: - description: The `attributes` `favorite`. + description: Whether the app is marked as a favorite by the current user. type: boolean name: - description: The `attributes` `name`. + description: The name of the app. type: string selfService: - description: The `attributes` `selfService`. + description: Whether the app is enabled for use in the Datadog self-service + hub. type: boolean tags: - description: The `attributes` `tags`. + description: A list of tags for the app, which can be used to filter apps. + example: + - service:webshop-backend + - team:webshop items: + description: An individual tag for the app. type: string type: array type: object ListAppsResponseDataItemsRelationships: - description: The definition of `ListAppsResponseDataItemsRelationships` object. + description: The app's publication information. properties: deployment: $ref: '#/components/schemas/DeploymentRelationship' type: object - ListAppsResponseDataItemsType: - default: appDefinitions - description: The definition of `ListAppsResponseDataItemsType` object. - enum: - - appDefinitions - example: appDefinitions - type: string - x-enum-varnames: - - APPDEFINITIONS ListAppsResponseMeta: - description: The definition of `ListAppsResponseMeta` object. + description: Pagination metadata. properties: page: $ref: '#/components/schemas/ListAppsResponseMetaPage' type: object ListAppsResponseMetaPage: - description: The definition of `ListAppsResponseMetaPage` object. + description: Information on the total number of apps, to be used for pagination. properties: totalCount: - description: The `page` `totalCount`. + description: The total number of apps under the Datadog organization, disregarding + any filters applied. format: int64 type: integer totalFilteredCount: - description: The `page` `totalFilteredCount`. + description: The total number of apps that match the specified filters. format: int64 type: integer type: object @@ -20862,24 +20644,34 @@ components: $ref: '#/components/schemas/Project' type: array type: object + PublishAppResponse: + description: The response object after an app has been successfully published. + properties: + data: + $ref: '#/components/schemas/Deployment' + type: object Query: - description: The definition of `Query` object. + description: A query used by an app. This can take the form of an external action, + a data transformation, or a state variable change. properties: events: - description: The `Query` `events`. + description: Events to listen for downstream of the query. items: $ref: '#/components/schemas/AppBuilderEvent' type: array id: - description: The `Query` `id`. - example: '' + description: The ID of the query. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid type: string name: - description: The `Query` `name`. + description: The name of the query. The name must be unique within the app, + and will be visible in the app editor. example: '' type: string properties: - description: The `Query` `properties`. + description: The properties of the query. The properties will vary depending + on the query type. type: $ref: '#/components/schemas/QueryType' required: @@ -20911,7 +20703,7 @@ components: - ASC - DESC QueryType: - description: The definition of `QueryType` object. + description: The query type. enum: - action - stateVariable @@ -23506,44 +23298,6 @@ components: type: string x-enum-varnames: - SCORECARD - Script: - description: The definition of `Script` object. - properties: - data: - $ref: '#/components/schemas/ScriptData' - type: object - ScriptData: - description: The definition of `ScriptData` object. - properties: - attributes: - $ref: '#/components/schemas/ScriptDataAttributes' - id: - description: The `data` `id`. - type: string - type: - $ref: '#/components/schemas/ScriptDataType' - type: object - ScriptDataAttributes: - description: The definition of `ScriptDataAttributes` object. - properties: - name: - description: The `attributes` `name`. - type: string - src: - description: The `attributes` `src`. - type: string - type: - description: The `attributes` `type`. - type: string - type: object - ScriptDataType: - default: scripts - description: The definition of `ScriptDataType` object. - enum: - - scripts - type: string - x-enum-varnames: - - SCRIPTS SecurityFilter: description: The security filter's properties. properties: @@ -29172,6 +28926,12 @@ components: example: min type: string type: object + UnpublishAppResponse: + description: The response object after an app has been successfully unpublished. + properties: + data: + $ref: '#/components/schemas/Deployment' + type: object UpdateActionConnectionRequest: description: Request used to update an action connection. properties: @@ -29187,7 +28947,7 @@ components: $ref: '#/components/schemas/ActionConnectionData' type: object UpdateAppRequest: - description: The definition of `UpdateAppRequest` object. + description: A request object for updating an existing app. example: data: attributes: @@ -29232,151 +28992,132 @@ components: $ref: '#/components/schemas/UpdateAppRequestData' type: object UpdateAppRequestData: - description: The definition of `UpdateAppRequestData` object. + description: The data object containing the new app definition. Any fields not + included in the request remain unchanged. properties: attributes: $ref: '#/components/schemas/UpdateAppRequestDataAttributes' id: - description: The `data` `id`. + description: The ID of the app to update. The app ID must match the ID in + the URL path. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid type: string type: - $ref: '#/components/schemas/UpdateAppRequestDataType' + $ref: '#/components/schemas/AppDefinitionType' required: - type type: object UpdateAppRequestDataAttributes: - description: The definition of `UpdateAppRequestDataAttributes` object. + description: App definition attributes to be updated, such as name, description, + and components. properties: components: - description: The `attributes` `components`. + description: The new UI components that make up the app. If this field is + set, all existing components are replaced with the new components under + this field. items: $ref: '#/components/schemas/ComponentGrid' type: array description: - description: The `attributes` `description`. + description: The new human-readable description for the app. type: string embeddedQueries: - description: The `attributes` `embeddedQueries`. + description: The new array of queries, such as external actions and state + variables, that the app uses. If this field is set, all existing queries + are replaced with the new queries under this field. items: $ref: '#/components/schemas/Query' type: array - inputSchema: - $ref: '#/components/schemas/InputSchema' name: - description: The `attributes` `name`. + description: The new name of the app. type: string rootInstanceName: - description: The `attributes` `rootInstanceName`. + description: The new name of the root component of the app. This must be + a `grid` component that contains all other components. type: string - scripts: - description: The `attributes` `scripts`. - items: - $ref: '#/components/schemas/Script' - type: array tags: - description: The `attributes` `tags`. + description: The new list of tags for the app, which can be used to filter + apps. If this field is set, any existing tags not included in the request + will be removed. + example: + - service:webshop-backend + - team:webshop items: + description: An individual tag for the app. type: string type: array type: object - UpdateAppRequestDataType: - default: appDefinitions - description: The definition of `UpdateAppRequestDataType` object. - enum: - - appDefinitions - example: appDefinitions - type: string - x-enum-varnames: - - APPDEFINITIONS UpdateAppResponse: - description: The definition of `UpdateAppResponse` object. + description: The response object after an app has been successfully updated. properties: data: $ref: '#/components/schemas/UpdateAppResponseData' included: - description: The `UpdateAppResponse` `included`. + description: Data on the version of the app that was published. items: - $ref: '#/components/schemas/DeploymentIncluded' + $ref: '#/components/schemas/Deployment' type: array meta: $ref: '#/components/schemas/AppMeta' relationship: - $ref: '#/components/schemas/UpdateAppResponseRelationship' + $ref: '#/components/schemas/AppRelationship' type: object UpdateAppResponseData: - description: The definition of `UpdateAppResponseData` object. + description: The data object containing the updated app definition. properties: attributes: $ref: '#/components/schemas/UpdateAppResponseDataAttributes' id: - description: The `data` `id`. - example: '' + description: The ID of the updated app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid type: string type: - $ref: '#/components/schemas/UpdateAppResponseDataType' + $ref: '#/components/schemas/AppDefinitionType' required: - id - type - attributes type: object UpdateAppResponseDataAttributes: - description: The definition of `UpdateAppResponseDataAttributes` object. + description: The updated app definition attributes, such as name, description, + and components. properties: components: - description: The `attributes` `components`. + description: The UI components that make up the app. items: $ref: '#/components/schemas/ComponentGrid' type: array description: - description: The `attributes` `description`. + description: The human-readable description for the app. type: string embeddedQueries: - description: The `attributes` `embeddedQueries`. + description: An array of queries, such as external actions and state variables, + that the app uses. items: $ref: '#/components/schemas/Query' type: array favorite: - description: The `attributes` `favorite`. + description: Whether the app is marked as a favorite by the current user. type: boolean - inputSchema: - $ref: '#/components/schemas/InputSchema' name: - description: The `attributes` `name`. + description: The name of the app. type: string rootInstanceName: - description: The `attributes` `rootInstanceName`. + description: The name of the root component of the app. This must be a `grid` + component that contains all other components. type: string - scripts: - description: The `attributes` `scripts`. - items: - $ref: '#/components/schemas/Script' - type: array tags: - description: The `attributes` `tags`. + description: A list of tags for the app, which can be used to filter apps. + example: + - service:webshop-backend + - team:webshop items: + description: An individual tag for the app. type: string type: array type: object - UpdateAppResponseDataType: - default: appDefinitions - description: The definition of `UpdateAppResponseDataType` object. - enum: - - appDefinitions - example: appDefinitions - type: string - x-enum-varnames: - - APPDEFINITIONS - UpdateAppResponseRelationship: - description: The definition of `UpdateAppResponseRelationship` object. - properties: - connections: - description: The `relationship` `connections`. - items: - $ref: '#/components/schemas/CustomConnection' - type: array - deployment: - $ref: '#/components/schemas/DeploymentRelationship' - type: object UpdateOpenAPIResponse: description: Response for `UpdateOpenAPI`. properties: @@ -31714,7 +31455,7 @@ paths: - apm_pipelines_write /api/v2/app-builder/apps: delete: - description: Delete multiple apps by ID + description: Delete multiple apps in a single request from a list of app IDs. operationId: DeleteApps requestBody: content: @@ -31751,15 +31492,17 @@ paths: $ref: '#/components/responses/TooManyRequestsResponse' summary: Delete Multiple Apps tags: - - Apps + - App Builder x-permission: operator: OR permissions: - apps_write x-unstable: '**Note**: App Builder API endpoints are still under active development - and may change at any time.' + and might change at any time.' get: - description: List all apps, with optional filters and sorting + description: List all apps, with optional filters and sorting. This endpoint + is paginated. Only basic app information such as the app ID, name, and description + is returned by this endpoint. operationId: ListApps parameters: - description: The number of apps to return per page. @@ -31783,6 +31526,7 @@ paths: schema: type: string - description: Filter apps by the app creator's UUID. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 in: query name: filter[user_uuid] required: false @@ -31858,15 +31602,15 @@ paths: $ref: '#/components/responses/TooManyRequestsResponse' summary: List Apps tags: - - Apps + - App Builder x-permission: operator: OR permissions: - apps_run x-unstable: '**Note**: App Builder API endpoints are still under active development - and may change at any time.' + and might change at any time.' post: - description: Create a new app, returning the app ID + description: Create a new app, returning the app ID. operationId: CreateApp requestBody: content: @@ -31880,7 +31624,7 @@ paths: application/json: schema: $ref: '#/components/schemas/CreateAppResponse' - description: App Created + description: Created '400': content: application/json: @@ -31897,7 +31641,7 @@ paths: $ref: '#/components/responses/TooManyRequestsResponse' summary: Create App tags: - - Apps + - App Builder x-permission: operator: AND permissions: @@ -31905,16 +31649,19 @@ paths: - connections_resolve - workflows_run x-unstable: '**Note**: App Builder API endpoints are still under active development - and may change at any time.' + and might change at any time.' /api/v2/app-builder/apps/{app_id}: delete: - description: Delete an app by ID + description: Delete a single app. operationId: DeleteApp parameters: - - in: path + - description: The ID of the app to delete. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + in: path name: app_id required: true schema: + format: uuid type: string responses: '200': @@ -31951,23 +31698,30 @@ paths: $ref: '#/components/responses/TooManyRequestsResponse' summary: Delete App tags: - - Apps + - App Builder x-permission: operator: OR permissions: - apps_write x-unstable: '**Note**: App Builder API endpoints are still under active development - and may change at any time.' + and might change at any time.' get: - description: Get the full definition of an app by ID + description: Get the full definition of an app. operationId: GetApp parameters: - - in: path + - description: The ID of the app to retrieve. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + in: path name: app_id required: true schema: + format: uuid type: string - - in: query + - description: The version number of the app to retrieve. If not specified, + the latest version is returned. Version numbers start at 1 and increment + with each update. The special values `latest` and `deployed` can be used + to retrieve the latest version or the published version, respectively. + in: query name: version required: false schema: @@ -32001,22 +31755,25 @@ paths: $ref: '#/components/responses/TooManyRequestsResponse' summary: Get App tags: - - Apps + - App Builder x-permission: operator: AND permissions: - apps_run - connections_read x-unstable: '**Note**: App Builder API endpoints are still under active development - and may change at any time.' + and might change at any time.' patch: - description: Update an existing app by ID. Creates a new version of the app + description: Update an existing app. This creates a new version of the app. operationId: UpdateApp parameters: - - in: path + - description: The ID of the app to update. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + in: path name: app_id required: true schema: + format: uuid type: string requestBody: content: @@ -32047,7 +31804,7 @@ paths: $ref: '#/components/responses/TooManyRequestsResponse' summary: Update App tags: - - Apps + - App Builder x-permission: operator: AND permissions: @@ -32055,23 +31812,29 @@ paths: - connections_resolve - workflows_run x-unstable: '**Note**: App Builder API endpoints are still under active development - and may change at any time.' + and might change at any time.' /api/v2/app-builder/apps/{app_id}/deployment: delete: - description: Disable an app by ID - operationId: DisableApp - parameters: - - in: path + description: Unpublish an app, removing the live version of the app. Unpublishing + creates a new instance of a `deployment` object on the app, with a nil `app_version_id` + (`00000000-0000-0000-0000-000000000000`). The app can still be updated and + published again in the future. + operationId: UnpublishApp + parameters: + - description: The ID of the app to unpublish. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + in: path name: app_id required: true schema: + format: uuid type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/DisableAppResponse' + $ref: '#/components/schemas/UnpublishAppResponse' description: OK '400': content: @@ -32093,30 +31856,35 @@ paths: description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Disable App + summary: Unpublish App tags: - - Apps + - App Builder x-permission: operator: OR permissions: - apps_write x-unstable: '**Note**: App Builder API endpoints are still under active development - and may change at any time.' + and might change at any time.' post: - description: Deploy (publish) an app by ID - operationId: DeployApp + description: Publish an app for use by other users. To ensure the app is accessible + to the correct users, you also need to set a [Restriction Policy](https://docs.datadoghq.com/api/latest/restriction-policies/) + on the app if a policy does not yet exist. + operationId: PublishApp parameters: - - in: path + - description: The ID of the app to publish. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + in: path name: app_id required: true schema: + format: uuid type: string responses: '201': content: application/json: schema: - $ref: '#/components/schemas/DeployAppResponse' + $ref: '#/components/schemas/PublishAppResponse' description: Created '400': content: @@ -32138,15 +31906,15 @@ paths: description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Deploy App + summary: Publish App tags: - - Apps + - App Builder x-permission: operator: OR permissions: - apps_write x-unstable: '**Note**: App Builder API endpoints are still under active development - and may change at any time.' + and might change at any time.' /api/v2/application_keys: get: description: List all application keys available for your org @@ -48848,7 +48616,7 @@ tags: and integrate secure, customized applications into your monitoring stack that are built to accelerate remediation at scale. These API endpoints allow you to create, read, update, delete, and publish apps. - name: Apps + name: App Builder - description: Search your Audit Logs events over HTTP. name: Audit - description: '[The AuthN Mappings API](https://docs.datadoghq.com/account_management/authn_mapping/?tab=example) diff --git a/api/datadog/configuration.go b/api/datadog/configuration.go index 8e859608f58..e2512a4b583 100644 --- a/api/datadog/configuration.go +++ b/api/datadog/configuration.go @@ -331,10 +331,10 @@ func NewConfiguration() *Configuration { "v2.CreateApp": false, "v2.DeleteApp": false, "v2.DeleteApps": false, - "v2.DeployApp": false, - "v2.DisableApp": false, "v2.GetApp": false, "v2.ListApps": false, + "v2.PublishApp": false, + "v2.UnpublishApp": false, "v2.UpdateApp": false, "v2.GetActiveBillingDimensions": false, "v2.GetBillingDimensionMapping": false, diff --git a/api/datadogV2/api_apps.go b/api/datadogV2/api_app_builder.go similarity index 92% rename from api/datadogV2/api_apps.go rename to api/datadogV2/api_app_builder.go index aeed2478a5c..0fb5aab2ec1 100644 --- a/api/datadogV2/api_apps.go +++ b/api/datadogV2/api_app_builder.go @@ -15,12 +15,12 @@ import ( "github.com/google/uuid" ) -// AppsApi service type -type AppsApi datadog.Service +// AppBuilderApi service type +type AppBuilderApi datadog.Service // CreateApp Create App. -// Create a new app, returning the app ID -func (a *AppsApi) CreateApp(ctx _context.Context, body CreateAppRequest) (CreateAppResponse, *_nethttp.Response, error) { +// Create a new app, returning the app ID. +func (a *AppBuilderApi) CreateApp(ctx _context.Context, body CreateAppRequest) (CreateAppResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -36,7 +36,7 @@ func (a *AppsApi) CreateApp(ctx _context.Context, body CreateAppRequest) (Create _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppsApi.CreateApp") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.CreateApp") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } @@ -110,8 +110,8 @@ func (a *AppsApi) CreateApp(ctx _context.Context, body CreateAppRequest) (Create } // DeleteApp Delete App. -// Delete an app by ID -func (a *AppsApi) DeleteApp(ctx _context.Context, appId string) (DeleteAppResponse, *_nethttp.Response, error) { +// Delete a single app. +func (a *AppBuilderApi) DeleteApp(ctx _context.Context, appId uuid.UUID) (DeleteAppResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} @@ -127,7 +127,7 @@ func (a *AppsApi) DeleteApp(ctx _context.Context, appId string) (DeleteAppRespon _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppsApi.DeleteApp") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.DeleteApp") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } @@ -199,8 +199,8 @@ func (a *AppsApi) DeleteApp(ctx _context.Context, appId string) (DeleteAppRespon } // DeleteApps Delete Multiple Apps. -// Delete multiple apps by ID -func (a *AppsApi) DeleteApps(ctx _context.Context, body DeleteAppsRequest) (DeleteAppsResponse, *_nethttp.Response, error) { +// Delete multiple apps in a single request from a list of app IDs. +func (a *AppBuilderApi) DeleteApps(ctx _context.Context, body DeleteAppsRequest) (DeleteAppsResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} @@ -216,7 +216,7 @@ func (a *AppsApi) DeleteApps(ctx _context.Context, body DeleteAppsRequest) (Dele _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppsApi.DeleteApps") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.DeleteApps") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } @@ -289,184 +289,6 @@ func (a *AppsApi) DeleteApps(ctx _context.Context, body DeleteAppsRequest) (Dele return localVarReturnValue, localVarHTTPResponse, nil } -// DeployApp Deploy App. -// Deploy (publish) an app by ID -func (a *AppsApi) DeployApp(ctx _context.Context, appId string) (DeployAppResponse, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue DeployAppResponse - ) - - operationId := "v2.DeployApp" - isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) - if !isOperationEnabled { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} - } - if isOperationEnabled && a.Client.Cfg.Debug { - _log.Printf("WARNING: Using unstable operation '%s'", operationId) - } - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppsApi.DeployApp") - if err != nil { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}/deployment" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - localVarHeaderParams["Accept"] = "application/json" - - datadog.SetAuthKeys( - ctx, - &localVarHeaderParams, - [2]string{"apiKeyAuth", "DD-API-KEY"}, - [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, - ) - req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.Client.CallAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := datadog.ReadBody(localVarHTTPResponse) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := datadog.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { - var v JSONAPIErrorResponse - err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.ErrorModel = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v APIErrorResponse - err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.ErrorModel = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := datadog.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -// DisableApp Disable App. -// Disable an app by ID -func (a *AppsApi) DisableApp(ctx _context.Context, appId string) (DisableAppResponse, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarReturnValue DisableAppResponse - ) - - operationId := "v2.DisableApp" - isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) - if !isOperationEnabled { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} - } - if isOperationEnabled && a.Client.Cfg.Debug { - _log.Printf("WARNING: Using unstable operation '%s'", operationId) - } - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppsApi.DisableApp") - if err != nil { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}/deployment" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - localVarHeaderParams["Accept"] = "application/json" - - datadog.SetAuthKeys( - ctx, - &localVarHeaderParams, - [2]string{"apiKeyAuth", "DD-API-KEY"}, - [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, - ) - req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.Client.CallAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := datadog.ReadBody(localVarHTTPResponse) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := datadog.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { - var v JSONAPIErrorResponse - err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.ErrorModel = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 429 { - var v APIErrorResponse - err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.ErrorModel = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := datadog.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - // GetAppOptionalParameters holds optional parameters for GetApp. type GetAppOptionalParameters struct { Version *string @@ -485,8 +307,8 @@ func (r *GetAppOptionalParameters) WithVersion(version string) *GetAppOptionalPa } // GetApp Get App. -// Get the full definition of an app by ID -func (a *AppsApi) GetApp(ctx _context.Context, appId string, o ...GetAppOptionalParameters) (GetAppResponse, *_nethttp.Response, error) { +// Get the full definition of an app. +func (a *AppBuilderApi) GetApp(ctx _context.Context, appId uuid.UUID, o ...GetAppOptionalParameters) (GetAppResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -510,7 +332,7 @@ func (a *AppsApi) GetApp(ctx _context.Context, appId string, o ...GetAppOptional _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppsApi.GetApp") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.GetApp") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } @@ -672,8 +494,8 @@ func (r *ListAppsOptionalParameters) WithSort(sort []AppsSortField) *ListAppsOpt } // ListApps List Apps. -// List all apps, with optional filters and sorting -func (a *AppsApi) ListApps(ctx _context.Context, o ...ListAppsOptionalParameters) (ListAppsResponse, *_nethttp.Response, error) { +// List all apps, with optional filters and sorting. This endpoint is paginated. Only basic app information such as the app ID, name, and description is returned by this endpoint. +func (a *AppBuilderApi) ListApps(ctx _context.Context, o ...ListAppsOptionalParameters) (ListAppsResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -697,7 +519,7 @@ func (a *AppsApi) ListApps(ctx _context.Context, o ...ListAppsOptionalParameters _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppsApi.ListApps") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.ListApps") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } @@ -800,9 +622,187 @@ func (a *AppsApi) ListApps(ctx _context.Context, o ...ListAppsOptionalParameters return localVarReturnValue, localVarHTTPResponse, nil } +// PublishApp Publish App. +// Publish an app for use by other users. To ensure the app is accessible to the correct users, you also need to set a [Restriction Policy](https://docs.datadoghq.com/api/latest/restriction-policies/) on the app if a policy does not yet exist. +func (a *AppBuilderApi) PublishApp(ctx _context.Context, appId uuid.UUID) (PublishAppResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue PublishAppResponse + ) + + operationId := "v2.PublishApp" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.PublishApp") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}/deployment" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// UnpublishApp Unpublish App. +// Unpublish an app, removing the live version of the app. Unpublishing creates a new instance of a `deployment` object on the app, with a nil `app_version_id` (`00000000-0000-0000-0000-000000000000`). The app can still be updated and published again in the future. +func (a *AppBuilderApi) UnpublishApp(ctx _context.Context, appId uuid.UUID) (UnpublishAppResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue UnpublishAppResponse + ) + + operationId := "v2.UnpublishApp" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.UnpublishApp") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}/deployment" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_id}", _neturl.PathEscape(datadog.ParameterToString(appId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // UpdateApp Update App. -// Update an existing app by ID. Creates a new version of the app -func (a *AppsApi) UpdateApp(ctx _context.Context, appId string, body UpdateAppRequest) (UpdateAppResponse, *_nethttp.Response, error) { +// Update an existing app. This creates a new version of the app. +func (a *AppBuilderApi) UpdateApp(ctx _context.Context, appId uuid.UUID, body UpdateAppRequest) (UpdateAppResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} @@ -818,7 +818,7 @@ func (a *AppsApi) UpdateApp(ctx _context.Context, appId string, body UpdateAppRe _log.Printf("WARNING: Using unstable operation '%s'", operationId) } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppsApi.UpdateApp") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.UpdateApp") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } @@ -892,9 +892,9 @@ func (a *AppsApi) UpdateApp(ctx _context.Context, appId string, body UpdateAppRe return localVarReturnValue, localVarHTTPResponse, nil } -// NewAppsApi Returns NewAppsApi. -func NewAppsApi(client *datadog.APIClient) *AppsApi { - return &AppsApi{ +// NewAppBuilderApi Returns NewAppBuilderApi. +func NewAppBuilderApi(client *datadog.APIClient) *AppBuilderApi { + return &AppBuilderApi{ Client: client, } } diff --git a/api/datadogV2/doc.go b/api/datadogV2/doc.go index fe4bfea9140..5e7eefa6f77 100644 --- a/api/datadogV2/doc.go +++ b/api/datadogV2/doc.go @@ -27,14 +27,14 @@ // - [ActionConnectionApi.GetActionConnection] // - [ActionConnectionApi.UpdateActionConnection] // - [AgentlessScanningApi.ListAwsScanOptions] -// - [AppsApi.CreateApp] -// - [AppsApi.DeleteApp] -// - [AppsApi.DeleteApps] -// - [AppsApi.DeployApp] -// - [AppsApi.DisableApp] -// - [AppsApi.GetApp] -// - [AppsApi.ListApps] -// - [AppsApi.UpdateApp] +// - [AppBuilderApi.CreateApp] +// - [AppBuilderApi.DeleteApp] +// - [AppBuilderApi.DeleteApps] +// - [AppBuilderApi.GetApp] +// - [AppBuilderApi.ListApps] +// - [AppBuilderApi.PublishApp] +// - [AppBuilderApi.UnpublishApp] +// - [AppBuilderApi.UpdateApp] // - [AuditApi.ListAuditLogs] // - [AuditApi.SearchAuditLogs] // - [AuthNMappingsApi.CreateAuthNMapping] diff --git a/api/datadogV2/model_app_builder_event.go b/api/datadogV2/model_app_builder_event.go index 053db569091..42f58b545b9 100644 --- a/api/datadogV2/model_app_builder_event.go +++ b/api/datadogV2/model_app_builder_event.go @@ -8,7 +8,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// AppBuilderEvent The definition of `AppBuilderEvent` object. +// AppBuilderEvent An event on a UI component that triggers a response or action in an app. type AppBuilderEvent struct { // The triggering action for the event. Name *AppBuilderEventName `json:"name,omitempty"` diff --git a/api/datadogV2/model_app_definition_type.go b/api/datadogV2/model_app_definition_type.go new file mode 100644 index 00000000000..a39d9c96dff --- /dev/null +++ b/api/datadogV2/model_app_definition_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AppDefinitionType The app definition type. +type AppDefinitionType string + +// List of AppDefinitionType. +const ( + APPDEFINITIONTYPE_APPDEFINITIONS AppDefinitionType = "appDefinitions" +) + +var allowedAppDefinitionTypeEnumValues = []AppDefinitionType{ + APPDEFINITIONTYPE_APPDEFINITIONS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *AppDefinitionType) GetAllowedValues() []AppDefinitionType { + return allowedAppDefinitionTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *AppDefinitionType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = AppDefinitionType(value) + return nil +} + +// NewAppDefinitionTypeFromValue returns a pointer to a valid AppDefinitionType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewAppDefinitionTypeFromValue(v string) (*AppDefinitionType, error) { + ev := AppDefinitionType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for AppDefinitionType: valid values are %v", v, allowedAppDefinitionTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v AppDefinitionType) IsValid() bool { + for _, existing := range allowedAppDefinitionTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AppDefinitionType value. +func (v AppDefinitionType) Ptr() *AppDefinitionType { + return &v +} diff --git a/api/datadogV2/model_app_deployment_type.go b/api/datadogV2/model_app_deployment_type.go new file mode 100644 index 00000000000..910bd97d44d --- /dev/null +++ b/api/datadogV2/model_app_deployment_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AppDeploymentType The deployment type. +type AppDeploymentType string + +// List of AppDeploymentType. +const ( + APPDEPLOYMENTTYPE_DEPLOYMENT AppDeploymentType = "deployment" +) + +var allowedAppDeploymentTypeEnumValues = []AppDeploymentType{ + APPDEPLOYMENTTYPE_DEPLOYMENT, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *AppDeploymentType) GetAllowedValues() []AppDeploymentType { + return allowedAppDeploymentTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *AppDeploymentType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = AppDeploymentType(value) + return nil +} + +// NewAppDeploymentTypeFromValue returns a pointer to a valid AppDeploymentType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewAppDeploymentTypeFromValue(v string) (*AppDeploymentType, error) { + ev := AppDeploymentType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for AppDeploymentType: valid values are %v", v, allowedAppDeploymentTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v AppDeploymentType) IsValid() bool { + for _, existing := range allowedAppDeploymentTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AppDeploymentType value. +func (v AppDeploymentType) Ptr() *AppDeploymentType { + return &v +} diff --git a/api/datadogV2/model_app_meta.go b/api/datadogV2/model_app_meta.go index 5554e7c5710..2ee4401738a 100644 --- a/api/datadogV2/model_app_meta.go +++ b/api/datadogV2/model_app_meta.go @@ -5,32 +5,32 @@ package datadogV2 import ( + "time" + "github.com/google/uuid" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// AppMeta The definition of `AppMeta` object. +// AppMeta Metadata of an app. type AppMeta struct { - // The `AppMeta` `created_at`. - CreatedAt *string `json:"created_at,omitempty"` - // The `AppMeta` `deleted_at`. - DeletedAt *string `json:"deleted_at,omitempty"` - // The `AppMeta` `org_id`. + // Timestamp of when the app was created. + CreatedAt *time.Time `json:"created_at,omitempty"` + // Timestamp of when the app was deleted. + DeletedAt *time.Time `json:"deleted_at,omitempty"` + // The Datadog organization ID that owns the app. OrgId *int64 `json:"org_id,omitempty"` - // The `AppMeta` `run_as_user`. - RunAsUser *string `json:"run_as_user,omitempty"` - // The `AppMeta` `updated_at`. - UpdatedAt *string `json:"updated_at,omitempty"` - // The `AppMeta` `updated_since_deployment`. + // Timestamp of when the app was last updated. + UpdatedAt *time.Time `json:"updated_at,omitempty"` + // Whether the app has been updated since it was last published. Published apps are pinned to a specific version and do not automatically update when the app is updated. UpdatedSinceDeployment *bool `json:"updated_since_deployment,omitempty"` - // The `AppMeta` `user_id`. + // The ID of the user who created the app. UserId *int64 `json:"user_id,omitempty"` - // The `AppMeta` `user_name`. + // The name (or email address) of the user who created the app. UserName *string `json:"user_name,omitempty"` - // The `AppMeta` `user_uuid`. + // The UUID of the user who created the app. UserUuid *uuid.UUID `json:"user_uuid,omitempty"` - // The `AppMeta` `version`. + // The version number of the app. This starts at 1 and increments with each update. Version *int64 `json:"version,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` @@ -55,9 +55,9 @@ func NewAppMetaWithDefaults() *AppMeta { } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *AppMeta) GetCreatedAt() string { +func (o *AppMeta) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { - var ret string + var ret time.Time return ret } return *o.CreatedAt @@ -65,7 +65,7 @@ func (o *AppMeta) GetCreatedAt() string { // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AppMeta) GetCreatedAtOk() (*string, bool) { +func (o *AppMeta) GetCreatedAtOk() (*time.Time, bool) { if o == nil || o.CreatedAt == nil { return nil, false } @@ -77,15 +77,15 @@ func (o *AppMeta) HasCreatedAt() bool { return o != nil && o.CreatedAt != nil } -// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field. -func (o *AppMeta) SetCreatedAt(v string) { +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *AppMeta) SetCreatedAt(v time.Time) { o.CreatedAt = &v } // GetDeletedAt returns the DeletedAt field value if set, zero value otherwise. -func (o *AppMeta) GetDeletedAt() string { +func (o *AppMeta) GetDeletedAt() time.Time { if o == nil || o.DeletedAt == nil { - var ret string + var ret time.Time return ret } return *o.DeletedAt @@ -93,7 +93,7 @@ func (o *AppMeta) GetDeletedAt() string { // GetDeletedAtOk returns a tuple with the DeletedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AppMeta) GetDeletedAtOk() (*string, bool) { +func (o *AppMeta) GetDeletedAtOk() (*time.Time, bool) { if o == nil || o.DeletedAt == nil { return nil, false } @@ -105,8 +105,8 @@ func (o *AppMeta) HasDeletedAt() bool { return o != nil && o.DeletedAt != nil } -// SetDeletedAt gets a reference to the given string and assigns it to the DeletedAt field. -func (o *AppMeta) SetDeletedAt(v string) { +// SetDeletedAt gets a reference to the given time.Time and assigns it to the DeletedAt field. +func (o *AppMeta) SetDeletedAt(v time.Time) { o.DeletedAt = &v } @@ -138,38 +138,10 @@ func (o *AppMeta) SetOrgId(v int64) { o.OrgId = &v } -// GetRunAsUser returns the RunAsUser field value if set, zero value otherwise. -func (o *AppMeta) GetRunAsUser() string { - if o == nil || o.RunAsUser == nil { - var ret string - return ret - } - return *o.RunAsUser -} - -// GetRunAsUserOk returns a tuple with the RunAsUser field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AppMeta) GetRunAsUserOk() (*string, bool) { - if o == nil || o.RunAsUser == nil { - return nil, false - } - return o.RunAsUser, true -} - -// HasRunAsUser returns a boolean if a field has been set. -func (o *AppMeta) HasRunAsUser() bool { - return o != nil && o.RunAsUser != nil -} - -// SetRunAsUser gets a reference to the given string and assigns it to the RunAsUser field. -func (o *AppMeta) SetRunAsUser(v string) { - o.RunAsUser = &v -} - // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *AppMeta) GetUpdatedAt() string { +func (o *AppMeta) GetUpdatedAt() time.Time { if o == nil || o.UpdatedAt == nil { - var ret string + var ret time.Time return ret } return *o.UpdatedAt @@ -177,7 +149,7 @@ func (o *AppMeta) GetUpdatedAt() string { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AppMeta) GetUpdatedAtOk() (*string, bool) { +func (o *AppMeta) GetUpdatedAtOk() (*time.Time, bool) { if o == nil || o.UpdatedAt == nil { return nil, false } @@ -189,8 +161,8 @@ func (o *AppMeta) HasUpdatedAt() bool { return o != nil && o.UpdatedAt != nil } -// SetUpdatedAt gets a reference to the given string and assigns it to the UpdatedAt field. -func (o *AppMeta) SetUpdatedAt(v string) { +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *AppMeta) SetUpdatedAt(v time.Time) { o.UpdatedAt = &v } @@ -341,19 +313,28 @@ func (o AppMeta) MarshalJSON() ([]byte, error) { return datadog.Marshal(o.UnparsedObject) } if o.CreatedAt != nil { - toSerialize["created_at"] = o.CreatedAt + if o.CreatedAt.Nanosecond() == 0 { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } } if o.DeletedAt != nil { - toSerialize["deleted_at"] = o.DeletedAt + if o.DeletedAt.Nanosecond() == 0 { + toSerialize["deleted_at"] = o.DeletedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["deleted_at"] = o.DeletedAt.Format("2006-01-02T15:04:05.000Z07:00") + } } if o.OrgId != nil { toSerialize["org_id"] = o.OrgId } - if o.RunAsUser != nil { - toSerialize["run_as_user"] = o.RunAsUser - } if o.UpdatedAt != nil { - toSerialize["updated_at"] = o.UpdatedAt + if o.UpdatedAt.Nanosecond() == 0 { + toSerialize["updated_at"] = o.UpdatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["updated_at"] = o.UpdatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } } if o.UpdatedSinceDeployment != nil { toSerialize["updated_since_deployment"] = o.UpdatedSinceDeployment @@ -380,11 +361,10 @@ func (o AppMeta) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AppMeta) UnmarshalJSON(bytes []byte) (err error) { all := struct { - CreatedAt *string `json:"created_at,omitempty"` - DeletedAt *string `json:"deleted_at,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + DeletedAt *time.Time `json:"deleted_at,omitempty"` OrgId *int64 `json:"org_id,omitempty"` - RunAsUser *string `json:"run_as_user,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` UpdatedSinceDeployment *bool `json:"updated_since_deployment,omitempty"` UserId *int64 `json:"user_id,omitempty"` UserName *string `json:"user_name,omitempty"` @@ -396,14 +376,13 @@ func (o *AppMeta) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "deleted_at", "org_id", "run_as_user", "updated_at", "updated_since_deployment", "user_id", "user_name", "user_uuid", "version"}) + datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "deleted_at", "org_id", "updated_at", "updated_since_deployment", "user_id", "user_name", "user_uuid", "version"}) } else { return err } o.CreatedAt = all.CreatedAt o.DeletedAt = all.DeletedAt o.OrgId = all.OrgId - o.RunAsUser = all.RunAsUser o.UpdatedAt = all.UpdatedAt o.UpdatedSinceDeployment = all.UpdatedSinceDeployment o.UserId = all.UserId diff --git a/api/datadogV2/model_get_app_response_relationship.go b/api/datadogV2/model_app_relationship.go similarity index 73% rename from api/datadogV2/model_get_app_response_relationship.go rename to api/datadogV2/model_app_relationship.go index 00a2330e33e..9eb77de5908 100644 --- a/api/datadogV2/model_get_app_response_relationship.go +++ b/api/datadogV2/model_app_relationship.go @@ -8,36 +8,36 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// GetAppResponseRelationship The definition of `GetAppResponseRelationship` object. -type GetAppResponseRelationship struct { - // The `relationship` `connections`. +// AppRelationship The app's publication relationship and custom connections. +type AppRelationship struct { + // Array of custom connections used by the app. Connections []CustomConnection `json:"connections,omitempty"` - // The definition of `DeploymentRelationship` object. + // Information pointing to the app's publication status. Deployment *DeploymentRelationship `json:"deployment,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } -// NewGetAppResponseRelationship instantiates a new GetAppResponseRelationship object. +// NewAppRelationship instantiates a new AppRelationship object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewGetAppResponseRelationship() *GetAppResponseRelationship { - this := GetAppResponseRelationship{} +func NewAppRelationship() *AppRelationship { + this := AppRelationship{} return &this } -// NewGetAppResponseRelationshipWithDefaults instantiates a new GetAppResponseRelationship object. +// NewAppRelationshipWithDefaults instantiates a new AppRelationship object. // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set. -func NewGetAppResponseRelationshipWithDefaults() *GetAppResponseRelationship { - this := GetAppResponseRelationship{} +func NewAppRelationshipWithDefaults() *AppRelationship { + this := AppRelationship{} return &this } // GetConnections returns the Connections field value if set, zero value otherwise. -func (o *GetAppResponseRelationship) GetConnections() []CustomConnection { +func (o *AppRelationship) GetConnections() []CustomConnection { if o == nil || o.Connections == nil { var ret []CustomConnection return ret @@ -47,7 +47,7 @@ func (o *GetAppResponseRelationship) GetConnections() []CustomConnection { // GetConnectionsOk returns a tuple with the Connections field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GetAppResponseRelationship) GetConnectionsOk() (*[]CustomConnection, bool) { +func (o *AppRelationship) GetConnectionsOk() (*[]CustomConnection, bool) { if o == nil || o.Connections == nil { return nil, false } @@ -55,17 +55,17 @@ func (o *GetAppResponseRelationship) GetConnectionsOk() (*[]CustomConnection, bo } // HasConnections returns a boolean if a field has been set. -func (o *GetAppResponseRelationship) HasConnections() bool { +func (o *AppRelationship) HasConnections() bool { return o != nil && o.Connections != nil } // SetConnections gets a reference to the given []CustomConnection and assigns it to the Connections field. -func (o *GetAppResponseRelationship) SetConnections(v []CustomConnection) { +func (o *AppRelationship) SetConnections(v []CustomConnection) { o.Connections = v } // GetDeployment returns the Deployment field value if set, zero value otherwise. -func (o *GetAppResponseRelationship) GetDeployment() DeploymentRelationship { +func (o *AppRelationship) GetDeployment() DeploymentRelationship { if o == nil || o.Deployment == nil { var ret DeploymentRelationship return ret @@ -75,7 +75,7 @@ func (o *GetAppResponseRelationship) GetDeployment() DeploymentRelationship { // GetDeploymentOk returns a tuple with the Deployment field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GetAppResponseRelationship) GetDeploymentOk() (*DeploymentRelationship, bool) { +func (o *AppRelationship) GetDeploymentOk() (*DeploymentRelationship, bool) { if o == nil || o.Deployment == nil { return nil, false } @@ -83,17 +83,17 @@ func (o *GetAppResponseRelationship) GetDeploymentOk() (*DeploymentRelationship, } // HasDeployment returns a boolean if a field has been set. -func (o *GetAppResponseRelationship) HasDeployment() bool { +func (o *AppRelationship) HasDeployment() bool { return o != nil && o.Deployment != nil } // SetDeployment gets a reference to the given DeploymentRelationship and assigns it to the Deployment field. -func (o *GetAppResponseRelationship) SetDeployment(v DeploymentRelationship) { +func (o *AppRelationship) SetDeployment(v DeploymentRelationship) { o.Deployment = &v } // MarshalJSON serializes the struct using spec logic. -func (o GetAppResponseRelationship) MarshalJSON() ([]byte, error) { +func (o AppRelationship) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) @@ -112,7 +112,7 @@ func (o GetAppResponseRelationship) MarshalJSON() ([]byte, error) { } // UnmarshalJSON deserializes the given payload. -func (o *GetAppResponseRelationship) UnmarshalJSON(bytes []byte) (err error) { +func (o *AppRelationship) UnmarshalJSON(bytes []byte) (err error) { all := struct { Connections []CustomConnection `json:"connections,omitempty"` Deployment *DeploymentRelationship `json:"deployment,omitempty"` diff --git a/api/datadogV2/model_component.go b/api/datadogV2/model_component.go index 3d034f4d5e6..b3ec6fb87d9 100644 --- a/api/datadogV2/model_component.go +++ b/api/datadogV2/model_component.go @@ -10,17 +10,17 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// Component The definition of `Component` object. +// Component [Definition of a UI component in the app](https://docs.datadoghq.com/service_management/app_builder/components/) type Component struct { - // The `Component` `events`. + // Events to listen for on the UI component. Events []AppBuilderEvent `json:"events,omitempty"` - // The `Component` `id`. + // The ID of the UI component. This property is deprecated; use `name` to identify individual components instead. Id datadog.NullableString `json:"id,omitempty"` - // The `Component` `name`. + // A unique identifier for this UI component. This name is also visible in the app editor. Name string `json:"name"` - // The definition of `ComponentProperties` object. + // Properties of a UI component. Different component types can have their own additional unique properties. See the [components documentation](https://docs.datadoghq.com/service_management/app_builder/components/) for more detail on each component type and its properties. Properties ComponentProperties `json:"properties"` - // The definition of `ComponentType` object. + // The UI component type. Type ComponentType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_component_grid.go b/api/datadogV2/model_component_grid.go index cb1e38205e4..d6a222fe431 100644 --- a/api/datadogV2/model_component_grid.go +++ b/api/datadogV2/model_component_grid.go @@ -10,17 +10,17 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// ComponentGrid The definition of `ComponentGrid` object. +// ComponentGrid A grid component. The grid component is the root canvas for an app and contains all other components. type ComponentGrid struct { - // The `ComponentGrid` `events`. + // Events to listen for on the grid component. Events []AppBuilderEvent `json:"events,omitempty"` - // The `ComponentGrid` `id`. + // The ID of the grid component. This property is deprecated; use `name` to identify individual components instead. Id *string `json:"id,omitempty"` - // The `ComponentGrid` `name`. + // A unique identifier for this grid component. This name is also visible in the app editor. Name string `json:"name"` - // The definition of `ComponentGridProperties` object. + // Properties of a grid component. Properties ComponentGridProperties `json:"properties"` - // The definition of `ComponentGridType` object. + // The grid component type. Type ComponentGridType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` @@ -44,6 +44,8 @@ func NewComponentGrid(name string, properties ComponentGridProperties, typeVar C // but it doesn't guarantee that properties required by API are set. func NewComponentGridWithDefaults() *ComponentGrid { this := ComponentGrid{} + var typeVar ComponentGridType = COMPONENTGRIDTYPE_GRID + this.Type = typeVar return &this } diff --git a/api/datadogV2/model_component_grid_properties.go b/api/datadogV2/model_component_grid_properties.go index 2184f8e0881..624f3ae8f88 100644 --- a/api/datadogV2/model_component_grid_properties.go +++ b/api/datadogV2/model_component_grid_properties.go @@ -8,13 +8,13 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// ComponentGridProperties The definition of `ComponentGridProperties` object. +// ComponentGridProperties Properties of a grid component. type ComponentGridProperties struct { - // The `ComponentGridProperties` `backgroundColor`. + // The background color of the grid. BackgroundColor *string `json:"backgroundColor,omitempty"` - // The `ComponentGridProperties` `children`. + // The child components of the grid. Children []Component `json:"children,omitempty"` - // The definition of `ComponentGridPropertiesIsVisible` object. + // Whether the grid component and its children are visible. If a string, it should be a valid JavaScript expression that evaluates to a boolean. IsVisible *ComponentGridPropertiesIsVisible `json:"isVisible,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_component_grid_properties_is_visible.go b/api/datadogV2/model_component_grid_properties_is_visible.go index 2430219301a..9a74c57ce72 100644 --- a/api/datadogV2/model_component_grid_properties_is_visible.go +++ b/api/datadogV2/model_component_grid_properties_is_visible.go @@ -8,7 +8,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// ComponentGridPropertiesIsVisible - The definition of `ComponentGridPropertiesIsVisible` object. +// ComponentGridPropertiesIsVisible - Whether the grid component and its children are visible. If a string, it should be a valid JavaScript expression that evaluates to a boolean. type ComponentGridPropertiesIsVisible struct { String *string Bool *bool diff --git a/api/datadogV2/model_component_grid_type.go b/api/datadogV2/model_component_grid_type.go index 71c704646ec..ab4e83bb373 100644 --- a/api/datadogV2/model_component_grid_type.go +++ b/api/datadogV2/model_component_grid_type.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// ComponentGridType The definition of `ComponentGridType` object. +// ComponentGridType The grid component type. type ComponentGridType string // List of ComponentGridType. diff --git a/api/datadogV2/model_component_properties.go b/api/datadogV2/model_component_properties.go index 698fe9e6f48..8e10f062de0 100644 --- a/api/datadogV2/model_component_properties.go +++ b/api/datadogV2/model_component_properties.go @@ -8,11 +8,11 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// ComponentProperties The definition of `ComponentProperties` object. +// ComponentProperties Properties of a UI component. Different component types can have their own additional unique properties. See the [components documentation](https://docs.datadoghq.com/service_management/app_builder/components/) for more detail on each component type and its properties. type ComponentProperties struct { - // The `ComponentProperties` `children`. + // The child components of the UI component. Children []Component `json:"children,omitempty"` - // The definition of `ComponentPropertiesIsVisible` object. + // Whether the UI component is visible. If this is a string, it must be a valid JavaScript expression that evaluates to a boolean. IsVisible *ComponentPropertiesIsVisible `json:"isVisible,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_component_properties_is_visible.go b/api/datadogV2/model_component_properties_is_visible.go index 5cc7b416c17..bf5f1f8d21d 100644 --- a/api/datadogV2/model_component_properties_is_visible.go +++ b/api/datadogV2/model_component_properties_is_visible.go @@ -8,7 +8,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// ComponentPropertiesIsVisible - The definition of `ComponentPropertiesIsVisible` object. +// ComponentPropertiesIsVisible - Whether the UI component is visible. If this is a string, it must be a valid JavaScript expression that evaluates to a boolean. type ComponentPropertiesIsVisible struct { Bool *bool String *string diff --git a/api/datadogV2/model_component_type.go b/api/datadogV2/model_component_type.go index 858d5cce9ba..85dbdf8b3cf 100644 --- a/api/datadogV2/model_component_type.go +++ b/api/datadogV2/model_component_type.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// ComponentType The definition of `ComponentType` object. +// ComponentType The UI component type. type ComponentType string // List of ComponentType. diff --git a/api/datadogV2/model_create_app_request.go b/api/datadogV2/model_create_app_request.go index c58c2d161a0..57a7d2d0b32 100644 --- a/api/datadogV2/model_create_app_request.go +++ b/api/datadogV2/model_create_app_request.go @@ -8,9 +8,9 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CreateAppRequest The definition of `CreateAppRequest` object. +// CreateAppRequest A request object for creating a new app. type CreateAppRequest struct { - // The definition of `CreateAppRequestData` object. + // The data object containing the app definition. Data *CreateAppRequestData `json:"data,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_create_app_request_data.go b/api/datadogV2/model_create_app_request_data.go index 6833a45aa0b..19743fe8b89 100644 --- a/api/datadogV2/model_create_app_request_data.go +++ b/api/datadogV2/model_create_app_request_data.go @@ -10,12 +10,12 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CreateAppRequestData The definition of `CreateAppRequestData` object. +// CreateAppRequestData The data object containing the app definition. type CreateAppRequestData struct { - // The definition of `CreateAppRequestDataAttributes` object. + // App definition attributes such as name, description, and components. Attributes *CreateAppRequestDataAttributes `json:"attributes,omitempty"` - // The definition of `CreateAppRequestDataType` object. - Type CreateAppRequestDataType `json:"type"` + // The app definition type. + Type AppDefinitionType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -25,7 +25,7 @@ type CreateAppRequestData struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewCreateAppRequestData(typeVar CreateAppRequestDataType) *CreateAppRequestData { +func NewCreateAppRequestData(typeVar AppDefinitionType) *CreateAppRequestData { this := CreateAppRequestData{} this.Type = typeVar return &this @@ -36,7 +36,7 @@ func NewCreateAppRequestData(typeVar CreateAppRequestDataType) *CreateAppRequest // but it doesn't guarantee that properties required by API are set. func NewCreateAppRequestDataWithDefaults() *CreateAppRequestData { this := CreateAppRequestData{} - var typeVar CreateAppRequestDataType = CREATEAPPREQUESTDATATYPE_APPDEFINITIONS + var typeVar AppDefinitionType = APPDEFINITIONTYPE_APPDEFINITIONS this.Type = typeVar return &this } @@ -70,9 +70,9 @@ func (o *CreateAppRequestData) SetAttributes(v CreateAppRequestDataAttributes) { } // GetType returns the Type field value. -func (o *CreateAppRequestData) GetType() CreateAppRequestDataType { +func (o *CreateAppRequestData) GetType() AppDefinitionType { if o == nil { - var ret CreateAppRequestDataType + var ret AppDefinitionType return ret } return o.Type @@ -80,7 +80,7 @@ func (o *CreateAppRequestData) GetType() CreateAppRequestDataType { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *CreateAppRequestData) GetTypeOk() (*CreateAppRequestDataType, bool) { +func (o *CreateAppRequestData) GetTypeOk() (*AppDefinitionType, bool) { if o == nil { return nil, false } @@ -88,7 +88,7 @@ func (o *CreateAppRequestData) GetTypeOk() (*CreateAppRequestDataType, bool) { } // SetType sets field value. -func (o *CreateAppRequestData) SetType(v CreateAppRequestDataType) { +func (o *CreateAppRequestData) SetType(v AppDefinitionType) { o.Type = v } @@ -113,7 +113,7 @@ func (o CreateAppRequestData) MarshalJSON() ([]byte, error) { func (o *CreateAppRequestData) UnmarshalJSON(bytes []byte) (err error) { all := struct { Attributes *CreateAppRequestDataAttributes `json:"attributes,omitempty"` - Type *CreateAppRequestDataType `json:"type"` + Type *AppDefinitionType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_create_app_request_data_attributes.go b/api/datadogV2/model_create_app_request_data_attributes.go index de5264e085f..b1e397b219d 100644 --- a/api/datadogV2/model_create_app_request_data_attributes.go +++ b/api/datadogV2/model_create_app_request_data_attributes.go @@ -8,23 +8,19 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CreateAppRequestDataAttributes The definition of `CreateAppRequestDataAttributes` object. +// CreateAppRequestDataAttributes App definition attributes such as name, description, and components. type CreateAppRequestDataAttributes struct { - // The `attributes` `components`. + // The UI components that make up the app. Components []ComponentGrid `json:"components,omitempty"` - // The `attributes` `description`. + // A human-readable description for the app. Description *string `json:"description,omitempty"` - // The `attributes` `embeddedQueries`. + // An array of queries, such as external actions and state variables, that the app uses. EmbeddedQueries []Query `json:"embeddedQueries,omitempty"` - // The definition of `InputSchema` object. - InputSchema *InputSchema `json:"inputSchema,omitempty"` - // The `attributes` `name`. + // The name of the app. Name *string `json:"name,omitempty"` - // The `attributes` `rootInstanceName`. + // The name of the root component of the app. This must be a `grid` component that contains all other components. RootInstanceName *string `json:"rootInstanceName,omitempty"` - // The `attributes` `scripts`. - Scripts []Script `json:"scripts,omitempty"` - // The `attributes` `tags`. + // A list of tags for the app, which can be used to filter apps. Tags []string `json:"tags,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` @@ -132,34 +128,6 @@ func (o *CreateAppRequestDataAttributes) SetEmbeddedQueries(v []Query) { o.EmbeddedQueries = v } -// GetInputSchema returns the InputSchema field value if set, zero value otherwise. -func (o *CreateAppRequestDataAttributes) GetInputSchema() InputSchema { - if o == nil || o.InputSchema == nil { - var ret InputSchema - return ret - } - return *o.InputSchema -} - -// GetInputSchemaOk returns a tuple with the InputSchema field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateAppRequestDataAttributes) GetInputSchemaOk() (*InputSchema, bool) { - if o == nil || o.InputSchema == nil { - return nil, false - } - return o.InputSchema, true -} - -// HasInputSchema returns a boolean if a field has been set. -func (o *CreateAppRequestDataAttributes) HasInputSchema() bool { - return o != nil && o.InputSchema != nil -} - -// SetInputSchema gets a reference to the given InputSchema and assigns it to the InputSchema field. -func (o *CreateAppRequestDataAttributes) SetInputSchema(v InputSchema) { - o.InputSchema = &v -} - // GetName returns the Name field value if set, zero value otherwise. func (o *CreateAppRequestDataAttributes) GetName() string { if o == nil || o.Name == nil { @@ -216,34 +184,6 @@ func (o *CreateAppRequestDataAttributes) SetRootInstanceName(v string) { o.RootInstanceName = &v } -// GetScripts returns the Scripts field value if set, zero value otherwise. -func (o *CreateAppRequestDataAttributes) GetScripts() []Script { - if o == nil || o.Scripts == nil { - var ret []Script - return ret - } - return o.Scripts -} - -// GetScriptsOk returns a tuple with the Scripts field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateAppRequestDataAttributes) GetScriptsOk() (*[]Script, bool) { - if o == nil || o.Scripts == nil { - return nil, false - } - return &o.Scripts, true -} - -// HasScripts returns a boolean if a field has been set. -func (o *CreateAppRequestDataAttributes) HasScripts() bool { - return o != nil && o.Scripts != nil -} - -// SetScripts gets a reference to the given []Script and assigns it to the Scripts field. -func (o *CreateAppRequestDataAttributes) SetScripts(v []Script) { - o.Scripts = v -} - // GetTags returns the Tags field value if set, zero value otherwise. func (o *CreateAppRequestDataAttributes) GetTags() []string { if o == nil || o.Tags == nil { @@ -287,18 +227,12 @@ func (o CreateAppRequestDataAttributes) MarshalJSON() ([]byte, error) { if o.EmbeddedQueries != nil { toSerialize["embeddedQueries"] = o.EmbeddedQueries } - if o.InputSchema != nil { - toSerialize["inputSchema"] = o.InputSchema - } if o.Name != nil { toSerialize["name"] = o.Name } if o.RootInstanceName != nil { toSerialize["rootInstanceName"] = o.RootInstanceName } - if o.Scripts != nil { - toSerialize["scripts"] = o.Scripts - } if o.Tags != nil { toSerialize["tags"] = o.Tags } @@ -315,10 +249,8 @@ func (o *CreateAppRequestDataAttributes) UnmarshalJSON(bytes []byte) (err error) Components []ComponentGrid `json:"components,omitempty"` Description *string `json:"description,omitempty"` EmbeddedQueries []Query `json:"embeddedQueries,omitempty"` - InputSchema *InputSchema `json:"inputSchema,omitempty"` Name *string `json:"name,omitempty"` RootInstanceName *string `json:"rootInstanceName,omitempty"` - Scripts []Script `json:"scripts,omitempty"` Tags []string `json:"tags,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { @@ -326,31 +258,20 @@ func (o *CreateAppRequestDataAttributes) UnmarshalJSON(bytes []byte) (err error) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"components", "description", "embeddedQueries", "inputSchema", "name", "rootInstanceName", "scripts", "tags"}) + datadog.DeleteKeys(additionalProperties, &[]string{"components", "description", "embeddedQueries", "name", "rootInstanceName", "tags"}) } else { return err } - - hasInvalidField := false o.Components = all.Components o.Description = all.Description o.EmbeddedQueries = all.EmbeddedQueries - if all.InputSchema != nil && all.InputSchema.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.InputSchema = all.InputSchema o.Name = all.Name o.RootInstanceName = all.RootInstanceName - o.Scripts = all.Scripts o.Tags = all.Tags if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties } - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - return nil } diff --git a/api/datadogV2/model_create_app_request_data_type.go b/api/datadogV2/model_create_app_request_data_type.go deleted file mode 100644 index bd767d6429f..00000000000 --- a/api/datadogV2/model_create_app_request_data_type.go +++ /dev/null @@ -1,64 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// CreateAppRequestDataType The definition of `CreateAppRequestDataType` object. -type CreateAppRequestDataType string - -// List of CreateAppRequestDataType. -const ( - CREATEAPPREQUESTDATATYPE_APPDEFINITIONS CreateAppRequestDataType = "appDefinitions" -) - -var allowedCreateAppRequestDataTypeEnumValues = []CreateAppRequestDataType{ - CREATEAPPREQUESTDATATYPE_APPDEFINITIONS, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *CreateAppRequestDataType) GetAllowedValues() []CreateAppRequestDataType { - return allowedCreateAppRequestDataTypeEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *CreateAppRequestDataType) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = CreateAppRequestDataType(value) - return nil -} - -// NewCreateAppRequestDataTypeFromValue returns a pointer to a valid CreateAppRequestDataType -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewCreateAppRequestDataTypeFromValue(v string) (*CreateAppRequestDataType, error) { - ev := CreateAppRequestDataType(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for CreateAppRequestDataType: valid values are %v", v, allowedCreateAppRequestDataTypeEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v CreateAppRequestDataType) IsValid() bool { - for _, existing := range allowedCreateAppRequestDataTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to CreateAppRequestDataType value. -func (v CreateAppRequestDataType) Ptr() *CreateAppRequestDataType { - return &v -} diff --git a/api/datadogV2/model_create_app_response.go b/api/datadogV2/model_create_app_response.go index 47777dd67a5..73880ed29c9 100644 --- a/api/datadogV2/model_create_app_response.go +++ b/api/datadogV2/model_create_app_response.go @@ -8,9 +8,9 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CreateAppResponse The definition of `CreateAppResponse` object. +// CreateAppResponse The response object after a new app has been successfully created, with the app ID. type CreateAppResponse struct { - // The definition of `CreateAppResponseData` object. + // The data object containing the app ID. Data *CreateAppResponseData `json:"data,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_create_app_response_data.go b/api/datadogV2/model_create_app_response_data.go index a212c0315df..b32ec9f4b77 100644 --- a/api/datadogV2/model_create_app_response_data.go +++ b/api/datadogV2/model_create_app_response_data.go @@ -7,15 +7,17 @@ package datadogV2 import ( "fmt" + "github.com/google/uuid" + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CreateAppResponseData The definition of `CreateAppResponseData` object. +// CreateAppResponseData The data object containing the app ID. type CreateAppResponseData struct { - // The `data` `id`. - Id string `json:"id"` - // The definition of `CreateAppResponseDataType` object. - Type CreateAppResponseDataType `json:"type"` + // The ID of the created app. + Id uuid.UUID `json:"id"` + // The app definition type. + Type AppDefinitionType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -25,7 +27,7 @@ type CreateAppResponseData struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewCreateAppResponseData(id string, typeVar CreateAppResponseDataType) *CreateAppResponseData { +func NewCreateAppResponseData(id uuid.UUID, typeVar AppDefinitionType) *CreateAppResponseData { this := CreateAppResponseData{} this.Id = id this.Type = typeVar @@ -37,15 +39,15 @@ func NewCreateAppResponseData(id string, typeVar CreateAppResponseDataType) *Cre // but it doesn't guarantee that properties required by API are set. func NewCreateAppResponseDataWithDefaults() *CreateAppResponseData { this := CreateAppResponseData{} - var typeVar CreateAppResponseDataType = CREATEAPPRESPONSEDATATYPE_APPDEFINITIONS + var typeVar AppDefinitionType = APPDEFINITIONTYPE_APPDEFINITIONS this.Type = typeVar return &this } // GetId returns the Id field value. -func (o *CreateAppResponseData) GetId() string { +func (o *CreateAppResponseData) GetId() uuid.UUID { if o == nil { - var ret string + var ret uuid.UUID return ret } return o.Id @@ -53,7 +55,7 @@ func (o *CreateAppResponseData) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *CreateAppResponseData) GetIdOk() (*string, bool) { +func (o *CreateAppResponseData) GetIdOk() (*uuid.UUID, bool) { if o == nil { return nil, false } @@ -61,14 +63,14 @@ func (o *CreateAppResponseData) GetIdOk() (*string, bool) { } // SetId sets field value. -func (o *CreateAppResponseData) SetId(v string) { +func (o *CreateAppResponseData) SetId(v uuid.UUID) { o.Id = v } // GetType returns the Type field value. -func (o *CreateAppResponseData) GetType() CreateAppResponseDataType { +func (o *CreateAppResponseData) GetType() AppDefinitionType { if o == nil { - var ret CreateAppResponseDataType + var ret AppDefinitionType return ret } return o.Type @@ -76,7 +78,7 @@ func (o *CreateAppResponseData) GetType() CreateAppResponseDataType { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *CreateAppResponseData) GetTypeOk() (*CreateAppResponseDataType, bool) { +func (o *CreateAppResponseData) GetTypeOk() (*AppDefinitionType, bool) { if o == nil { return nil, false } @@ -84,7 +86,7 @@ func (o *CreateAppResponseData) GetTypeOk() (*CreateAppResponseDataType, bool) { } // SetType sets field value. -func (o *CreateAppResponseData) SetType(v CreateAppResponseDataType) { +func (o *CreateAppResponseData) SetType(v AppDefinitionType) { o.Type = v } @@ -106,8 +108,8 @@ func (o CreateAppResponseData) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *CreateAppResponseData) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id"` - Type *CreateAppResponseDataType `json:"type"` + Id *uuid.UUID `json:"id"` + Type *AppDefinitionType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_create_app_response_data_type.go b/api/datadogV2/model_create_app_response_data_type.go deleted file mode 100644 index 7501610a621..00000000000 --- a/api/datadogV2/model_create_app_response_data_type.go +++ /dev/null @@ -1,64 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// CreateAppResponseDataType The definition of `CreateAppResponseDataType` object. -type CreateAppResponseDataType string - -// List of CreateAppResponseDataType. -const ( - CREATEAPPRESPONSEDATATYPE_APPDEFINITIONS CreateAppResponseDataType = "appDefinitions" -) - -var allowedCreateAppResponseDataTypeEnumValues = []CreateAppResponseDataType{ - CREATEAPPRESPONSEDATATYPE_APPDEFINITIONS, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *CreateAppResponseDataType) GetAllowedValues() []CreateAppResponseDataType { - return allowedCreateAppResponseDataTypeEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *CreateAppResponseDataType) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = CreateAppResponseDataType(value) - return nil -} - -// NewCreateAppResponseDataTypeFromValue returns a pointer to a valid CreateAppResponseDataType -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewCreateAppResponseDataTypeFromValue(v string) (*CreateAppResponseDataType, error) { - ev := CreateAppResponseDataType(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for CreateAppResponseDataType: valid values are %v", v, allowedCreateAppResponseDataTypeEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v CreateAppResponseDataType) IsValid() bool { - for _, existing := range allowedCreateAppResponseDataTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to CreateAppResponseDataType value. -func (v CreateAppResponseDataType) Ptr() *CreateAppResponseDataType { - return &v -} diff --git a/api/datadogV2/model_custom_connection.go b/api/datadogV2/model_custom_connection.go index e4cc8730299..4cd87219245 100644 --- a/api/datadogV2/model_custom_connection.go +++ b/api/datadogV2/model_custom_connection.go @@ -5,16 +5,18 @@ package datadogV2 import ( + "github.com/google/uuid" + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CustomConnection The definition of `CustomConnection` object. +// CustomConnection A custom connection used by an app. type CustomConnection struct { - // The definition of `CustomConnectionAttributes` object. + // The custom connection attributes. Attributes *CustomConnectionAttributes `json:"attributes,omitempty"` - // The `CustomConnection` `id`. - Id *string `json:"id,omitempty"` - // The definition of `CustomConnectionType` object. + // The ID of the custom connection. + Id *uuid.UUID `json:"id,omitempty"` + // The custom connection type. Type *CustomConnectionType `json:"type,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` @@ -71,9 +73,9 @@ func (o *CustomConnection) SetAttributes(v CustomConnectionAttributes) { } // GetId returns the Id field value if set, zero value otherwise. -func (o *CustomConnection) GetId() string { +func (o *CustomConnection) GetId() uuid.UUID { if o == nil || o.Id == nil { - var ret string + var ret uuid.UUID return ret } return *o.Id @@ -81,7 +83,7 @@ func (o *CustomConnection) GetId() string { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CustomConnection) GetIdOk() (*string, bool) { +func (o *CustomConnection) GetIdOk() (*uuid.UUID, bool) { if o == nil || o.Id == nil { return nil, false } @@ -93,8 +95,8 @@ func (o *CustomConnection) HasId() bool { return o != nil && o.Id != nil } -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *CustomConnection) SetId(v string) { +// SetId gets a reference to the given uuid.UUID and assigns it to the Id field. +func (o *CustomConnection) SetId(v uuid.UUID) { o.Id = &v } @@ -152,7 +154,7 @@ func (o CustomConnection) MarshalJSON() ([]byte, error) { func (o *CustomConnection) UnmarshalJSON(bytes []byte) (err error) { all := struct { Attributes *CustomConnectionAttributes `json:"attributes,omitempty"` - Id *string `json:"id,omitempty"` + Id *uuid.UUID `json:"id,omitempty"` Type *CustomConnectionType `json:"type,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { diff --git a/api/datadogV2/model_custom_connection_attributes.go b/api/datadogV2/model_custom_connection_attributes.go index 46e1b9ba2a6..9bdfa66ea0c 100644 --- a/api/datadogV2/model_custom_connection_attributes.go +++ b/api/datadogV2/model_custom_connection_attributes.go @@ -8,11 +8,11 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CustomConnectionAttributes The definition of `CustomConnectionAttributes` object. +// CustomConnectionAttributes The custom connection attributes. type CustomConnectionAttributes struct { - // The `attributes` `name`. + // The name of the custom connection. Name *string `json:"name,omitempty"` - // The definition of `CustomConnectionAttributesOnPremRunner` object. + // Information about the Private Action Runner used by the custom connection, if the custom connection is associated with a Private Action Runner. OnPremRunner *CustomConnectionAttributesOnPremRunner `json:"onPremRunner,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_custom_connection_attributes_on_prem_runner.go b/api/datadogV2/model_custom_connection_attributes_on_prem_runner.go index a8eea47e12a..fd841927271 100644 --- a/api/datadogV2/model_custom_connection_attributes_on_prem_runner.go +++ b/api/datadogV2/model_custom_connection_attributes_on_prem_runner.go @@ -8,11 +8,11 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CustomConnectionAttributesOnPremRunner The definition of `CustomConnectionAttributesOnPremRunner` object. +// CustomConnectionAttributesOnPremRunner Information about the Private Action Runner used by the custom connection, if the custom connection is associated with a Private Action Runner. type CustomConnectionAttributesOnPremRunner struct { - // The `onPremRunner` `id`. + // The Private Action Runner ID. Id *string `json:"id,omitempty"` - // The `onPremRunner` `url`. + // The URL of the Private Action Runner. Url *string `json:"url,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_custom_connection_type.go b/api/datadogV2/model_custom_connection_type.go index ce42ce033aa..0636c4b1a93 100644 --- a/api/datadogV2/model_custom_connection_type.go +++ b/api/datadogV2/model_custom_connection_type.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CustomConnectionType The definition of `CustomConnectionType` object. +// CustomConnectionType The custom connection type. type CustomConnectionType string // List of CustomConnectionType. diff --git a/api/datadogV2/model_delete_app_response.go b/api/datadogV2/model_delete_app_response.go index 5462fc55ca8..74d7b5eaece 100644 --- a/api/datadogV2/model_delete_app_response.go +++ b/api/datadogV2/model_delete_app_response.go @@ -8,7 +8,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// DeleteAppResponse The definition of `DeleteAppResponse` object. +// DeleteAppResponse The response object after an app has been successfully deleted. type DeleteAppResponse struct { // The definition of `DeleteAppResponseData` object. Data *DeleteAppResponseData `json:"data,omitempty"` diff --git a/api/datadogV2/model_delete_app_response_data.go b/api/datadogV2/model_delete_app_response_data.go index d5b8d561d30..d33df3bccc2 100644 --- a/api/datadogV2/model_delete_app_response_data.go +++ b/api/datadogV2/model_delete_app_response_data.go @@ -7,15 +7,17 @@ package datadogV2 import ( "fmt" + "github.com/google/uuid" + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) // DeleteAppResponseData The definition of `DeleteAppResponseData` object. type DeleteAppResponseData struct { - // The `data` `id`. - Id string `json:"id"` - // The definition of `DeleteAppResponseDataType` object. - Type DeleteAppResponseDataType `json:"type"` + // The ID of the deleted app. + Id uuid.UUID `json:"id"` + // The app definition type. + Type AppDefinitionType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -25,7 +27,7 @@ type DeleteAppResponseData struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewDeleteAppResponseData(id string, typeVar DeleteAppResponseDataType) *DeleteAppResponseData { +func NewDeleteAppResponseData(id uuid.UUID, typeVar AppDefinitionType) *DeleteAppResponseData { this := DeleteAppResponseData{} this.Id = id this.Type = typeVar @@ -37,15 +39,15 @@ func NewDeleteAppResponseData(id string, typeVar DeleteAppResponseDataType) *Del // but it doesn't guarantee that properties required by API are set. func NewDeleteAppResponseDataWithDefaults() *DeleteAppResponseData { this := DeleteAppResponseData{} - var typeVar DeleteAppResponseDataType = DELETEAPPRESPONSEDATATYPE_APPDEFINITIONS + var typeVar AppDefinitionType = APPDEFINITIONTYPE_APPDEFINITIONS this.Type = typeVar return &this } // GetId returns the Id field value. -func (o *DeleteAppResponseData) GetId() string { +func (o *DeleteAppResponseData) GetId() uuid.UUID { if o == nil { - var ret string + var ret uuid.UUID return ret } return o.Id @@ -53,7 +55,7 @@ func (o *DeleteAppResponseData) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *DeleteAppResponseData) GetIdOk() (*string, bool) { +func (o *DeleteAppResponseData) GetIdOk() (*uuid.UUID, bool) { if o == nil { return nil, false } @@ -61,14 +63,14 @@ func (o *DeleteAppResponseData) GetIdOk() (*string, bool) { } // SetId sets field value. -func (o *DeleteAppResponseData) SetId(v string) { +func (o *DeleteAppResponseData) SetId(v uuid.UUID) { o.Id = v } // GetType returns the Type field value. -func (o *DeleteAppResponseData) GetType() DeleteAppResponseDataType { +func (o *DeleteAppResponseData) GetType() AppDefinitionType { if o == nil { - var ret DeleteAppResponseDataType + var ret AppDefinitionType return ret } return o.Type @@ -76,7 +78,7 @@ func (o *DeleteAppResponseData) GetType() DeleteAppResponseDataType { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *DeleteAppResponseData) GetTypeOk() (*DeleteAppResponseDataType, bool) { +func (o *DeleteAppResponseData) GetTypeOk() (*AppDefinitionType, bool) { if o == nil { return nil, false } @@ -84,7 +86,7 @@ func (o *DeleteAppResponseData) GetTypeOk() (*DeleteAppResponseDataType, bool) { } // SetType sets field value. -func (o *DeleteAppResponseData) SetType(v DeleteAppResponseDataType) { +func (o *DeleteAppResponseData) SetType(v AppDefinitionType) { o.Type = v } @@ -106,8 +108,8 @@ func (o DeleteAppResponseData) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *DeleteAppResponseData) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id"` - Type *DeleteAppResponseDataType `json:"type"` + Id *uuid.UUID `json:"id"` + Type *AppDefinitionType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_delete_app_response_data_type.go b/api/datadogV2/model_delete_app_response_data_type.go deleted file mode 100644 index 365392b8b72..00000000000 --- a/api/datadogV2/model_delete_app_response_data_type.go +++ /dev/null @@ -1,64 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// DeleteAppResponseDataType The definition of `DeleteAppResponseDataType` object. -type DeleteAppResponseDataType string - -// List of DeleteAppResponseDataType. -const ( - DELETEAPPRESPONSEDATATYPE_APPDEFINITIONS DeleteAppResponseDataType = "appDefinitions" -) - -var allowedDeleteAppResponseDataTypeEnumValues = []DeleteAppResponseDataType{ - DELETEAPPRESPONSEDATATYPE_APPDEFINITIONS, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *DeleteAppResponseDataType) GetAllowedValues() []DeleteAppResponseDataType { - return allowedDeleteAppResponseDataTypeEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *DeleteAppResponseDataType) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = DeleteAppResponseDataType(value) - return nil -} - -// NewDeleteAppResponseDataTypeFromValue returns a pointer to a valid DeleteAppResponseDataType -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewDeleteAppResponseDataTypeFromValue(v string) (*DeleteAppResponseDataType, error) { - ev := DeleteAppResponseDataType(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for DeleteAppResponseDataType: valid values are %v", v, allowedDeleteAppResponseDataTypeEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v DeleteAppResponseDataType) IsValid() bool { - for _, existing := range allowedDeleteAppResponseDataTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to DeleteAppResponseDataType value. -func (v DeleteAppResponseDataType) Ptr() *DeleteAppResponseDataType { - return &v -} diff --git a/api/datadogV2/model_delete_apps_request.go b/api/datadogV2/model_delete_apps_request.go index 733f3ae23a1..a78b7fd6ddf 100644 --- a/api/datadogV2/model_delete_apps_request.go +++ b/api/datadogV2/model_delete_apps_request.go @@ -8,9 +8,9 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// DeleteAppsRequest The definition of `DeleteAppsRequest` object. +// DeleteAppsRequest A request object for deleting multiple apps by ID. type DeleteAppsRequest struct { - // The `DeleteAppsRequest` `data`. + // An array of objects containing the IDs of the apps to delete. Data []DeleteAppsRequestDataItems `json:"data,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_delete_apps_request_data_items.go b/api/datadogV2/model_delete_apps_request_data_items.go index c34a1bf5454..ecd7e903ba0 100644 --- a/api/datadogV2/model_delete_apps_request_data_items.go +++ b/api/datadogV2/model_delete_apps_request_data_items.go @@ -7,15 +7,17 @@ package datadogV2 import ( "fmt" + "github.com/google/uuid" + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// DeleteAppsRequestDataItems The definition of `DeleteAppsRequestDataItems` object. +// DeleteAppsRequestDataItems An object containing the ID of an app to delete. type DeleteAppsRequestDataItems struct { - // The `items` `id`. - Id string `json:"id"` - // The definition of `DeleteAppsRequestDataItemsType` object. - Type DeleteAppsRequestDataItemsType `json:"type"` + // The ID of the app to delete. + Id uuid.UUID `json:"id"` + // The app definition type. + Type AppDefinitionType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -25,7 +27,7 @@ type DeleteAppsRequestDataItems struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewDeleteAppsRequestDataItems(id string, typeVar DeleteAppsRequestDataItemsType) *DeleteAppsRequestDataItems { +func NewDeleteAppsRequestDataItems(id uuid.UUID, typeVar AppDefinitionType) *DeleteAppsRequestDataItems { this := DeleteAppsRequestDataItems{} this.Id = id this.Type = typeVar @@ -37,15 +39,15 @@ func NewDeleteAppsRequestDataItems(id string, typeVar DeleteAppsRequestDataItems // but it doesn't guarantee that properties required by API are set. func NewDeleteAppsRequestDataItemsWithDefaults() *DeleteAppsRequestDataItems { this := DeleteAppsRequestDataItems{} - var typeVar DeleteAppsRequestDataItemsType = DELETEAPPSREQUESTDATAITEMSTYPE_APPDEFINITIONS + var typeVar AppDefinitionType = APPDEFINITIONTYPE_APPDEFINITIONS this.Type = typeVar return &this } // GetId returns the Id field value. -func (o *DeleteAppsRequestDataItems) GetId() string { +func (o *DeleteAppsRequestDataItems) GetId() uuid.UUID { if o == nil { - var ret string + var ret uuid.UUID return ret } return o.Id @@ -53,7 +55,7 @@ func (o *DeleteAppsRequestDataItems) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *DeleteAppsRequestDataItems) GetIdOk() (*string, bool) { +func (o *DeleteAppsRequestDataItems) GetIdOk() (*uuid.UUID, bool) { if o == nil { return nil, false } @@ -61,14 +63,14 @@ func (o *DeleteAppsRequestDataItems) GetIdOk() (*string, bool) { } // SetId sets field value. -func (o *DeleteAppsRequestDataItems) SetId(v string) { +func (o *DeleteAppsRequestDataItems) SetId(v uuid.UUID) { o.Id = v } // GetType returns the Type field value. -func (o *DeleteAppsRequestDataItems) GetType() DeleteAppsRequestDataItemsType { +func (o *DeleteAppsRequestDataItems) GetType() AppDefinitionType { if o == nil { - var ret DeleteAppsRequestDataItemsType + var ret AppDefinitionType return ret } return o.Type @@ -76,7 +78,7 @@ func (o *DeleteAppsRequestDataItems) GetType() DeleteAppsRequestDataItemsType { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *DeleteAppsRequestDataItems) GetTypeOk() (*DeleteAppsRequestDataItemsType, bool) { +func (o *DeleteAppsRequestDataItems) GetTypeOk() (*AppDefinitionType, bool) { if o == nil { return nil, false } @@ -84,7 +86,7 @@ func (o *DeleteAppsRequestDataItems) GetTypeOk() (*DeleteAppsRequestDataItemsTyp } // SetType sets field value. -func (o *DeleteAppsRequestDataItems) SetType(v DeleteAppsRequestDataItemsType) { +func (o *DeleteAppsRequestDataItems) SetType(v AppDefinitionType) { o.Type = v } @@ -106,8 +108,8 @@ func (o DeleteAppsRequestDataItems) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *DeleteAppsRequestDataItems) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id"` - Type *DeleteAppsRequestDataItemsType `json:"type"` + Id *uuid.UUID `json:"id"` + Type *AppDefinitionType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_delete_apps_request_data_items_type.go b/api/datadogV2/model_delete_apps_request_data_items_type.go deleted file mode 100644 index 63327e4ee58..00000000000 --- a/api/datadogV2/model_delete_apps_request_data_items_type.go +++ /dev/null @@ -1,64 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// DeleteAppsRequestDataItemsType The definition of `DeleteAppsRequestDataItemsType` object. -type DeleteAppsRequestDataItemsType string - -// List of DeleteAppsRequestDataItemsType. -const ( - DELETEAPPSREQUESTDATAITEMSTYPE_APPDEFINITIONS DeleteAppsRequestDataItemsType = "appDefinitions" -) - -var allowedDeleteAppsRequestDataItemsTypeEnumValues = []DeleteAppsRequestDataItemsType{ - DELETEAPPSREQUESTDATAITEMSTYPE_APPDEFINITIONS, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *DeleteAppsRequestDataItemsType) GetAllowedValues() []DeleteAppsRequestDataItemsType { - return allowedDeleteAppsRequestDataItemsTypeEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *DeleteAppsRequestDataItemsType) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = DeleteAppsRequestDataItemsType(value) - return nil -} - -// NewDeleteAppsRequestDataItemsTypeFromValue returns a pointer to a valid DeleteAppsRequestDataItemsType -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewDeleteAppsRequestDataItemsTypeFromValue(v string) (*DeleteAppsRequestDataItemsType, error) { - ev := DeleteAppsRequestDataItemsType(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for DeleteAppsRequestDataItemsType: valid values are %v", v, allowedDeleteAppsRequestDataItemsTypeEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v DeleteAppsRequestDataItemsType) IsValid() bool { - for _, existing := range allowedDeleteAppsRequestDataItemsTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to DeleteAppsRequestDataItemsType value. -func (v DeleteAppsRequestDataItemsType) Ptr() *DeleteAppsRequestDataItemsType { - return &v -} diff --git a/api/datadogV2/model_delete_apps_response.go b/api/datadogV2/model_delete_apps_response.go index be06445fa66..659452fcca7 100644 --- a/api/datadogV2/model_delete_apps_response.go +++ b/api/datadogV2/model_delete_apps_response.go @@ -8,9 +8,9 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// DeleteAppsResponse The definition of `DeleteAppsResponse` object. +// DeleteAppsResponse The response object after multiple apps have been successfully deleted. type DeleteAppsResponse struct { - // The `DeleteAppsResponse` `data`. + // An array of objects containing the IDs of the deleted apps. Data []DeleteAppsResponseDataItems `json:"data,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_delete_apps_response_data_items.go b/api/datadogV2/model_delete_apps_response_data_items.go index 02d379c5a43..b2e8912d68d 100644 --- a/api/datadogV2/model_delete_apps_response_data_items.go +++ b/api/datadogV2/model_delete_apps_response_data_items.go @@ -7,15 +7,17 @@ package datadogV2 import ( "fmt" + "github.com/google/uuid" + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// DeleteAppsResponseDataItems The definition of `DeleteAppsResponseDataItems` object. +// DeleteAppsResponseDataItems An object containing the ID of a deleted app. type DeleteAppsResponseDataItems struct { - // The `items` `id`. - Id string `json:"id"` - // The definition of `DeleteAppsResponseDataItemsType` object. - Type DeleteAppsResponseDataItemsType `json:"type"` + // The ID of the deleted app. + Id uuid.UUID `json:"id"` + // The app definition type. + Type AppDefinitionType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -25,7 +27,7 @@ type DeleteAppsResponseDataItems struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewDeleteAppsResponseDataItems(id string, typeVar DeleteAppsResponseDataItemsType) *DeleteAppsResponseDataItems { +func NewDeleteAppsResponseDataItems(id uuid.UUID, typeVar AppDefinitionType) *DeleteAppsResponseDataItems { this := DeleteAppsResponseDataItems{} this.Id = id this.Type = typeVar @@ -37,15 +39,15 @@ func NewDeleteAppsResponseDataItems(id string, typeVar DeleteAppsResponseDataIte // but it doesn't guarantee that properties required by API are set. func NewDeleteAppsResponseDataItemsWithDefaults() *DeleteAppsResponseDataItems { this := DeleteAppsResponseDataItems{} - var typeVar DeleteAppsResponseDataItemsType = DELETEAPPSRESPONSEDATAITEMSTYPE_APPDEFINITIONS + var typeVar AppDefinitionType = APPDEFINITIONTYPE_APPDEFINITIONS this.Type = typeVar return &this } // GetId returns the Id field value. -func (o *DeleteAppsResponseDataItems) GetId() string { +func (o *DeleteAppsResponseDataItems) GetId() uuid.UUID { if o == nil { - var ret string + var ret uuid.UUID return ret } return o.Id @@ -53,7 +55,7 @@ func (o *DeleteAppsResponseDataItems) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *DeleteAppsResponseDataItems) GetIdOk() (*string, bool) { +func (o *DeleteAppsResponseDataItems) GetIdOk() (*uuid.UUID, bool) { if o == nil { return nil, false } @@ -61,14 +63,14 @@ func (o *DeleteAppsResponseDataItems) GetIdOk() (*string, bool) { } // SetId sets field value. -func (o *DeleteAppsResponseDataItems) SetId(v string) { +func (o *DeleteAppsResponseDataItems) SetId(v uuid.UUID) { o.Id = v } // GetType returns the Type field value. -func (o *DeleteAppsResponseDataItems) GetType() DeleteAppsResponseDataItemsType { +func (o *DeleteAppsResponseDataItems) GetType() AppDefinitionType { if o == nil { - var ret DeleteAppsResponseDataItemsType + var ret AppDefinitionType return ret } return o.Type @@ -76,7 +78,7 @@ func (o *DeleteAppsResponseDataItems) GetType() DeleteAppsResponseDataItemsType // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *DeleteAppsResponseDataItems) GetTypeOk() (*DeleteAppsResponseDataItemsType, bool) { +func (o *DeleteAppsResponseDataItems) GetTypeOk() (*AppDefinitionType, bool) { if o == nil { return nil, false } @@ -84,7 +86,7 @@ func (o *DeleteAppsResponseDataItems) GetTypeOk() (*DeleteAppsResponseDataItemsT } // SetType sets field value. -func (o *DeleteAppsResponseDataItems) SetType(v DeleteAppsResponseDataItemsType) { +func (o *DeleteAppsResponseDataItems) SetType(v AppDefinitionType) { o.Type = v } @@ -106,8 +108,8 @@ func (o DeleteAppsResponseDataItems) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *DeleteAppsResponseDataItems) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id"` - Type *DeleteAppsResponseDataItemsType `json:"type"` + Id *uuid.UUID `json:"id"` + Type *AppDefinitionType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_delete_apps_response_data_items_type.go b/api/datadogV2/model_delete_apps_response_data_items_type.go deleted file mode 100644 index a165d9c834c..00000000000 --- a/api/datadogV2/model_delete_apps_response_data_items_type.go +++ /dev/null @@ -1,64 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// DeleteAppsResponseDataItemsType The definition of `DeleteAppsResponseDataItemsType` object. -type DeleteAppsResponseDataItemsType string - -// List of DeleteAppsResponseDataItemsType. -const ( - DELETEAPPSRESPONSEDATAITEMSTYPE_APPDEFINITIONS DeleteAppsResponseDataItemsType = "appDefinitions" -) - -var allowedDeleteAppsResponseDataItemsTypeEnumValues = []DeleteAppsResponseDataItemsType{ - DELETEAPPSRESPONSEDATAITEMSTYPE_APPDEFINITIONS, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *DeleteAppsResponseDataItemsType) GetAllowedValues() []DeleteAppsResponseDataItemsType { - return allowedDeleteAppsResponseDataItemsTypeEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *DeleteAppsResponseDataItemsType) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = DeleteAppsResponseDataItemsType(value) - return nil -} - -// NewDeleteAppsResponseDataItemsTypeFromValue returns a pointer to a valid DeleteAppsResponseDataItemsType -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewDeleteAppsResponseDataItemsTypeFromValue(v string) (*DeleteAppsResponseDataItemsType, error) { - ev := DeleteAppsResponseDataItemsType(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for DeleteAppsResponseDataItemsType: valid values are %v", v, allowedDeleteAppsResponseDataItemsTypeEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v DeleteAppsResponseDataItemsType) IsValid() bool { - for _, existing := range allowedDeleteAppsResponseDataItemsTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to DeleteAppsResponseDataItemsType value. -func (v DeleteAppsResponseDataItemsType) Ptr() *DeleteAppsResponseDataItemsType { - return &v -} diff --git a/api/datadogV2/model_deploy_app_response.go b/api/datadogV2/model_deploy_app_response.go deleted file mode 100644 index 307ef711ac2..00000000000 --- a/api/datadogV2/model_deploy_app_response.go +++ /dev/null @@ -1,111 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// DeployAppResponse The definition of `DeployAppResponse` object. -type DeployAppResponse struct { - // The definition of `DeployAppResponseData` object. - Data *DeployAppResponseData `json:"data,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewDeployAppResponse instantiates a new DeployAppResponse object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewDeployAppResponse() *DeployAppResponse { - this := DeployAppResponse{} - return &this -} - -// NewDeployAppResponseWithDefaults instantiates a new DeployAppResponse object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewDeployAppResponseWithDefaults() *DeployAppResponse { - this := DeployAppResponse{} - return &this -} - -// GetData returns the Data field value if set, zero value otherwise. -func (o *DeployAppResponse) GetData() DeployAppResponseData { - if o == nil || o.Data == nil { - var ret DeployAppResponseData - return ret - } - return *o.Data -} - -// GetDataOk returns a tuple with the Data field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DeployAppResponse) GetDataOk() (*DeployAppResponseData, bool) { - if o == nil || o.Data == nil { - return nil, false - } - return o.Data, true -} - -// HasData returns a boolean if a field has been set. -func (o *DeployAppResponse) HasData() bool { - return o != nil && o.Data != nil -} - -// SetData gets a reference to the given DeployAppResponseData and assigns it to the Data field. -func (o *DeployAppResponse) SetData(v DeployAppResponseData) { - o.Data = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o DeployAppResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Data != nil { - toSerialize["data"] = o.Data - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *DeployAppResponse) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Data *DeployAppResponseData `json:"data,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"data"}) - } else { - return err - } - - hasInvalidField := false - if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Data = all.Data - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_deploy_app_response_data_attributes.go b/api/datadogV2/model_deploy_app_response_data_attributes.go deleted file mode 100644 index bf2fbd7df0e..00000000000 --- a/api/datadogV2/model_deploy_app_response_data_attributes.go +++ /dev/null @@ -1,102 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// DeployAppResponseDataAttributes The definition of `DeployAppResponseDataAttributes` object. -type DeployAppResponseDataAttributes struct { - // The `attributes` `app_version_id`. - AppVersionId *string `json:"app_version_id,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewDeployAppResponseDataAttributes instantiates a new DeployAppResponseDataAttributes object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewDeployAppResponseDataAttributes() *DeployAppResponseDataAttributes { - this := DeployAppResponseDataAttributes{} - return &this -} - -// NewDeployAppResponseDataAttributesWithDefaults instantiates a new DeployAppResponseDataAttributes object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewDeployAppResponseDataAttributesWithDefaults() *DeployAppResponseDataAttributes { - this := DeployAppResponseDataAttributes{} - return &this -} - -// GetAppVersionId returns the AppVersionId field value if set, zero value otherwise. -func (o *DeployAppResponseDataAttributes) GetAppVersionId() string { - if o == nil || o.AppVersionId == nil { - var ret string - return ret - } - return *o.AppVersionId -} - -// GetAppVersionIdOk returns a tuple with the AppVersionId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DeployAppResponseDataAttributes) GetAppVersionIdOk() (*string, bool) { - if o == nil || o.AppVersionId == nil { - return nil, false - } - return o.AppVersionId, true -} - -// HasAppVersionId returns a boolean if a field has been set. -func (o *DeployAppResponseDataAttributes) HasAppVersionId() bool { - return o != nil && o.AppVersionId != nil -} - -// SetAppVersionId gets a reference to the given string and assigns it to the AppVersionId field. -func (o *DeployAppResponseDataAttributes) SetAppVersionId(v string) { - o.AppVersionId = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o DeployAppResponseDataAttributes) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.AppVersionId != nil { - toSerialize["app_version_id"] = o.AppVersionId - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *DeployAppResponseDataAttributes) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - AppVersionId *string `json:"app_version_id,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"app_version_id"}) - } else { - return err - } - o.AppVersionId = all.AppVersionId - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_deploy_app_response_data_type.go b/api/datadogV2/model_deploy_app_response_data_type.go deleted file mode 100644 index d9b00fda85e..00000000000 --- a/api/datadogV2/model_deploy_app_response_data_type.go +++ /dev/null @@ -1,64 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// DeployAppResponseDataType The definition of `DeployAppResponseDataType` object. -type DeployAppResponseDataType string - -// List of DeployAppResponseDataType. -const ( - DEPLOYAPPRESPONSEDATATYPE_DEPLOYMENT DeployAppResponseDataType = "deployment" -) - -var allowedDeployAppResponseDataTypeEnumValues = []DeployAppResponseDataType{ - DEPLOYAPPRESPONSEDATATYPE_DEPLOYMENT, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *DeployAppResponseDataType) GetAllowedValues() []DeployAppResponseDataType { - return allowedDeployAppResponseDataTypeEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *DeployAppResponseDataType) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = DeployAppResponseDataType(value) - return nil -} - -// NewDeployAppResponseDataTypeFromValue returns a pointer to a valid DeployAppResponseDataType -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewDeployAppResponseDataTypeFromValue(v string) (*DeployAppResponseDataType, error) { - ev := DeployAppResponseDataType(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for DeployAppResponseDataType: valid values are %v", v, allowedDeployAppResponseDataTypeEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v DeployAppResponseDataType) IsValid() bool { - for _, existing := range allowedDeployAppResponseDataTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to DeployAppResponseDataType value. -func (v DeployAppResponseDataType) Ptr() *DeployAppResponseDataType { - return &v -} diff --git a/api/datadogV2/model_deploy_app_response_data.go b/api/datadogV2/model_deployment.go similarity index 60% rename from api/datadogV2/model_deploy_app_response_data.go rename to api/datadogV2/model_deployment.go index 348b537c622..a8f55480f1d 100644 --- a/api/datadogV2/model_deploy_app_response_data.go +++ b/api/datadogV2/model_deployment.go @@ -5,49 +5,51 @@ package datadogV2 import ( + "github.com/google/uuid" + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// DeployAppResponseData The definition of `DeployAppResponseData` object. -type DeployAppResponseData struct { - // The definition of `DeployAppResponseDataAttributes` object. - Attributes *DeployAppResponseDataAttributes `json:"attributes,omitempty"` - // The `data` `id`. - Id *string `json:"id,omitempty"` - // The definition of `DeploymentMeta` object. - Meta *DeploymentMeta `json:"meta,omitempty"` - // The definition of `DeployAppResponseDataType` object. - Type *DeployAppResponseDataType `json:"type,omitempty"` +// Deployment The version of the app that was published. +type Deployment struct { + // The attributes object containing the version ID of the published app. + Attributes *DeploymentAttributes `json:"attributes,omitempty"` + // The deployment ID. + Id *uuid.UUID `json:"id,omitempty"` + // Metadata object containing the publication creation information. + Meta *DeploymentMetadata `json:"meta,omitempty"` + // The deployment type. + Type *AppDeploymentType `json:"type,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } -// NewDeployAppResponseData instantiates a new DeployAppResponseData object. +// NewDeployment instantiates a new Deployment object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewDeployAppResponseData() *DeployAppResponseData { - this := DeployAppResponseData{} - var typeVar DeployAppResponseDataType = DEPLOYAPPRESPONSEDATATYPE_DEPLOYMENT +func NewDeployment() *Deployment { + this := Deployment{} + var typeVar AppDeploymentType = APPDEPLOYMENTTYPE_DEPLOYMENT this.Type = &typeVar return &this } -// NewDeployAppResponseDataWithDefaults instantiates a new DeployAppResponseData object. +// NewDeploymentWithDefaults instantiates a new Deployment object. // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set. -func NewDeployAppResponseDataWithDefaults() *DeployAppResponseData { - this := DeployAppResponseData{} - var typeVar DeployAppResponseDataType = DEPLOYAPPRESPONSEDATATYPE_DEPLOYMENT +func NewDeploymentWithDefaults() *Deployment { + this := Deployment{} + var typeVar AppDeploymentType = APPDEPLOYMENTTYPE_DEPLOYMENT this.Type = &typeVar return &this } // GetAttributes returns the Attributes field value if set, zero value otherwise. -func (o *DeployAppResponseData) GetAttributes() DeployAppResponseDataAttributes { +func (o *Deployment) GetAttributes() DeploymentAttributes { if o == nil || o.Attributes == nil { - var ret DeployAppResponseDataAttributes + var ret DeploymentAttributes return ret } return *o.Attributes @@ -55,7 +57,7 @@ func (o *DeployAppResponseData) GetAttributes() DeployAppResponseDataAttributes // GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DeployAppResponseData) GetAttributesOk() (*DeployAppResponseDataAttributes, bool) { +func (o *Deployment) GetAttributesOk() (*DeploymentAttributes, bool) { if o == nil || o.Attributes == nil { return nil, false } @@ -63,19 +65,19 @@ func (o *DeployAppResponseData) GetAttributesOk() (*DeployAppResponseDataAttribu } // HasAttributes returns a boolean if a field has been set. -func (o *DeployAppResponseData) HasAttributes() bool { +func (o *Deployment) HasAttributes() bool { return o != nil && o.Attributes != nil } -// SetAttributes gets a reference to the given DeployAppResponseDataAttributes and assigns it to the Attributes field. -func (o *DeployAppResponseData) SetAttributes(v DeployAppResponseDataAttributes) { +// SetAttributes gets a reference to the given DeploymentAttributes and assigns it to the Attributes field. +func (o *Deployment) SetAttributes(v DeploymentAttributes) { o.Attributes = &v } // GetId returns the Id field value if set, zero value otherwise. -func (o *DeployAppResponseData) GetId() string { +func (o *Deployment) GetId() uuid.UUID { if o == nil || o.Id == nil { - var ret string + var ret uuid.UUID return ret } return *o.Id @@ -83,7 +85,7 @@ func (o *DeployAppResponseData) GetId() string { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DeployAppResponseData) GetIdOk() (*string, bool) { +func (o *Deployment) GetIdOk() (*uuid.UUID, bool) { if o == nil || o.Id == nil { return nil, false } @@ -91,19 +93,19 @@ func (o *DeployAppResponseData) GetIdOk() (*string, bool) { } // HasId returns a boolean if a field has been set. -func (o *DeployAppResponseData) HasId() bool { +func (o *Deployment) HasId() bool { return o != nil && o.Id != nil } -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *DeployAppResponseData) SetId(v string) { +// SetId gets a reference to the given uuid.UUID and assigns it to the Id field. +func (o *Deployment) SetId(v uuid.UUID) { o.Id = &v } // GetMeta returns the Meta field value if set, zero value otherwise. -func (o *DeployAppResponseData) GetMeta() DeploymentMeta { +func (o *Deployment) GetMeta() DeploymentMetadata { if o == nil || o.Meta == nil { - var ret DeploymentMeta + var ret DeploymentMetadata return ret } return *o.Meta @@ -111,7 +113,7 @@ func (o *DeployAppResponseData) GetMeta() DeploymentMeta { // GetMetaOk returns a tuple with the Meta field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DeployAppResponseData) GetMetaOk() (*DeploymentMeta, bool) { +func (o *Deployment) GetMetaOk() (*DeploymentMetadata, bool) { if o == nil || o.Meta == nil { return nil, false } @@ -119,19 +121,19 @@ func (o *DeployAppResponseData) GetMetaOk() (*DeploymentMeta, bool) { } // HasMeta returns a boolean if a field has been set. -func (o *DeployAppResponseData) HasMeta() bool { +func (o *Deployment) HasMeta() bool { return o != nil && o.Meta != nil } -// SetMeta gets a reference to the given DeploymentMeta and assigns it to the Meta field. -func (o *DeployAppResponseData) SetMeta(v DeploymentMeta) { +// SetMeta gets a reference to the given DeploymentMetadata and assigns it to the Meta field. +func (o *Deployment) SetMeta(v DeploymentMetadata) { o.Meta = &v } // GetType returns the Type field value if set, zero value otherwise. -func (o *DeployAppResponseData) GetType() DeployAppResponseDataType { +func (o *Deployment) GetType() AppDeploymentType { if o == nil || o.Type == nil { - var ret DeployAppResponseDataType + var ret AppDeploymentType return ret } return *o.Type @@ -139,7 +141,7 @@ func (o *DeployAppResponseData) GetType() DeployAppResponseDataType { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DeployAppResponseData) GetTypeOk() (*DeployAppResponseDataType, bool) { +func (o *Deployment) GetTypeOk() (*AppDeploymentType, bool) { if o == nil || o.Type == nil { return nil, false } @@ -147,17 +149,17 @@ func (o *DeployAppResponseData) GetTypeOk() (*DeployAppResponseDataType, bool) { } // HasType returns a boolean if a field has been set. -func (o *DeployAppResponseData) HasType() bool { +func (o *Deployment) HasType() bool { return o != nil && o.Type != nil } -// SetType gets a reference to the given DeployAppResponseDataType and assigns it to the Type field. -func (o *DeployAppResponseData) SetType(v DeployAppResponseDataType) { +// SetType gets a reference to the given AppDeploymentType and assigns it to the Type field. +func (o *Deployment) SetType(v AppDeploymentType) { o.Type = &v } // MarshalJSON serializes the struct using spec logic. -func (o DeployAppResponseData) MarshalJSON() ([]byte, error) { +func (o Deployment) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) @@ -182,12 +184,12 @@ func (o DeployAppResponseData) MarshalJSON() ([]byte, error) { } // UnmarshalJSON deserializes the given payload. -func (o *DeployAppResponseData) UnmarshalJSON(bytes []byte) (err error) { +func (o *Deployment) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Attributes *DeployAppResponseDataAttributes `json:"attributes,omitempty"` - Id *string `json:"id,omitempty"` - Meta *DeploymentMeta `json:"meta,omitempty"` - Type *DeployAppResponseDataType `json:"type,omitempty"` + Attributes *DeploymentAttributes `json:"attributes,omitempty"` + Id *uuid.UUID `json:"id,omitempty"` + Meta *DeploymentMetadata `json:"meta,omitempty"` + Type *AppDeploymentType `json:"type,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_deployment_included_attributes.go b/api/datadogV2/model_deployment_attributes.go similarity index 65% rename from api/datadogV2/model_deployment_included_attributes.go rename to api/datadogV2/model_deployment_attributes.go index 77f08f2ca80..1926dcfe853 100644 --- a/api/datadogV2/model_deployment_included_attributes.go +++ b/api/datadogV2/model_deployment_attributes.go @@ -5,39 +5,41 @@ package datadogV2 import ( + "github.com/google/uuid" + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// DeploymentIncludedAttributes The definition of `DeploymentIncludedAttributes` object. -type DeploymentIncludedAttributes struct { - // The `attributes` `app_version_id`. - AppVersionId *string `json:"app_version_id,omitempty"` +// DeploymentAttributes The attributes object containing the version ID of the published app. +type DeploymentAttributes struct { + // The version ID of the app that was published. For an unpublished app, this will always be the nil UUID (`00000000-0000-0000-0000-000000000000`). + AppVersionId *uuid.UUID `json:"app_version_id,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } -// NewDeploymentIncludedAttributes instantiates a new DeploymentIncludedAttributes object. +// NewDeploymentAttributes instantiates a new DeploymentAttributes object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewDeploymentIncludedAttributes() *DeploymentIncludedAttributes { - this := DeploymentIncludedAttributes{} +func NewDeploymentAttributes() *DeploymentAttributes { + this := DeploymentAttributes{} return &this } -// NewDeploymentIncludedAttributesWithDefaults instantiates a new DeploymentIncludedAttributes object. +// NewDeploymentAttributesWithDefaults instantiates a new DeploymentAttributes object. // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set. -func NewDeploymentIncludedAttributesWithDefaults() *DeploymentIncludedAttributes { - this := DeploymentIncludedAttributes{} +func NewDeploymentAttributesWithDefaults() *DeploymentAttributes { + this := DeploymentAttributes{} return &this } // GetAppVersionId returns the AppVersionId field value if set, zero value otherwise. -func (o *DeploymentIncludedAttributes) GetAppVersionId() string { +func (o *DeploymentAttributes) GetAppVersionId() uuid.UUID { if o == nil || o.AppVersionId == nil { - var ret string + var ret uuid.UUID return ret } return *o.AppVersionId @@ -45,7 +47,7 @@ func (o *DeploymentIncludedAttributes) GetAppVersionId() string { // GetAppVersionIdOk returns a tuple with the AppVersionId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DeploymentIncludedAttributes) GetAppVersionIdOk() (*string, bool) { +func (o *DeploymentAttributes) GetAppVersionIdOk() (*uuid.UUID, bool) { if o == nil || o.AppVersionId == nil { return nil, false } @@ -53,17 +55,17 @@ func (o *DeploymentIncludedAttributes) GetAppVersionIdOk() (*string, bool) { } // HasAppVersionId returns a boolean if a field has been set. -func (o *DeploymentIncludedAttributes) HasAppVersionId() bool { +func (o *DeploymentAttributes) HasAppVersionId() bool { return o != nil && o.AppVersionId != nil } -// SetAppVersionId gets a reference to the given string and assigns it to the AppVersionId field. -func (o *DeploymentIncludedAttributes) SetAppVersionId(v string) { +// SetAppVersionId gets a reference to the given uuid.UUID and assigns it to the AppVersionId field. +func (o *DeploymentAttributes) SetAppVersionId(v uuid.UUID) { o.AppVersionId = &v } // MarshalJSON serializes the struct using spec logic. -func (o DeploymentIncludedAttributes) MarshalJSON() ([]byte, error) { +func (o DeploymentAttributes) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) @@ -79,9 +81,9 @@ func (o DeploymentIncludedAttributes) MarshalJSON() ([]byte, error) { } // UnmarshalJSON deserializes the given payload. -func (o *DeploymentIncludedAttributes) UnmarshalJSON(bytes []byte) (err error) { +func (o *DeploymentAttributes) UnmarshalJSON(bytes []byte) (err error) { all := struct { - AppVersionId *string `json:"app_version_id,omitempty"` + AppVersionId *uuid.UUID `json:"app_version_id,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_deployment_included.go b/api/datadogV2/model_deployment_included.go deleted file mode 100644 index 0c353fe6866..00000000000 --- a/api/datadogV2/model_deployment_included.go +++ /dev/null @@ -1,227 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// DeploymentIncluded The definition of `DeploymentIncluded` object. -type DeploymentIncluded struct { - // The definition of `DeploymentIncludedAttributes` object. - Attributes *DeploymentIncludedAttributes `json:"attributes,omitempty"` - // The `DeploymentIncluded` `id`. - Id *string `json:"id,omitempty"` - // The definition of `DeploymentIncludedMeta` object. - Meta *DeploymentIncludedMeta `json:"meta,omitempty"` - // The definition of `DeploymentIncludedType` object. - Type *DeploymentIncludedType `json:"type,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewDeploymentIncluded instantiates a new DeploymentIncluded object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewDeploymentIncluded() *DeploymentIncluded { - this := DeploymentIncluded{} - var typeVar DeploymentIncludedType = DEPLOYMENTINCLUDEDTYPE_DEPLOYMENT - this.Type = &typeVar - return &this -} - -// NewDeploymentIncludedWithDefaults instantiates a new DeploymentIncluded object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewDeploymentIncludedWithDefaults() *DeploymentIncluded { - this := DeploymentIncluded{} - var typeVar DeploymentIncludedType = DEPLOYMENTINCLUDEDTYPE_DEPLOYMENT - this.Type = &typeVar - return &this -} - -// GetAttributes returns the Attributes field value if set, zero value otherwise. -func (o *DeploymentIncluded) GetAttributes() DeploymentIncludedAttributes { - if o == nil || o.Attributes == nil { - var ret DeploymentIncludedAttributes - return ret - } - return *o.Attributes -} - -// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DeploymentIncluded) GetAttributesOk() (*DeploymentIncludedAttributes, bool) { - if o == nil || o.Attributes == nil { - return nil, false - } - return o.Attributes, true -} - -// HasAttributes returns a boolean if a field has been set. -func (o *DeploymentIncluded) HasAttributes() bool { - return o != nil && o.Attributes != nil -} - -// SetAttributes gets a reference to the given DeploymentIncludedAttributes and assigns it to the Attributes field. -func (o *DeploymentIncluded) SetAttributes(v DeploymentIncludedAttributes) { - o.Attributes = &v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *DeploymentIncluded) GetId() string { - if o == nil || o.Id == nil { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DeploymentIncluded) GetIdOk() (*string, bool) { - if o == nil || o.Id == nil { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *DeploymentIncluded) HasId() bool { - return o != nil && o.Id != nil -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *DeploymentIncluded) SetId(v string) { - o.Id = &v -} - -// GetMeta returns the Meta field value if set, zero value otherwise. -func (o *DeploymentIncluded) GetMeta() DeploymentIncludedMeta { - if o == nil || o.Meta == nil { - var ret DeploymentIncludedMeta - return ret - } - return *o.Meta -} - -// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DeploymentIncluded) GetMetaOk() (*DeploymentIncludedMeta, bool) { - if o == nil || o.Meta == nil { - return nil, false - } - return o.Meta, true -} - -// HasMeta returns a boolean if a field has been set. -func (o *DeploymentIncluded) HasMeta() bool { - return o != nil && o.Meta != nil -} - -// SetMeta gets a reference to the given DeploymentIncludedMeta and assigns it to the Meta field. -func (o *DeploymentIncluded) SetMeta(v DeploymentIncludedMeta) { - o.Meta = &v -} - -// GetType returns the Type field value if set, zero value otherwise. -func (o *DeploymentIncluded) GetType() DeploymentIncludedType { - if o == nil || o.Type == nil { - var ret DeploymentIncludedType - return ret - } - return *o.Type -} - -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DeploymentIncluded) GetTypeOk() (*DeploymentIncludedType, bool) { - if o == nil || o.Type == nil { - return nil, false - } - return o.Type, true -} - -// HasType returns a boolean if a field has been set. -func (o *DeploymentIncluded) HasType() bool { - return o != nil && o.Type != nil -} - -// SetType gets a reference to the given DeploymentIncludedType and assigns it to the Type field. -func (o *DeploymentIncluded) SetType(v DeploymentIncludedType) { - o.Type = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o DeploymentIncluded) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Attributes != nil { - toSerialize["attributes"] = o.Attributes - } - if o.Id != nil { - toSerialize["id"] = o.Id - } - if o.Meta != nil { - toSerialize["meta"] = o.Meta - } - if o.Type != nil { - toSerialize["type"] = o.Type - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *DeploymentIncluded) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Attributes *DeploymentIncludedAttributes `json:"attributes,omitempty"` - Id *string `json:"id,omitempty"` - Meta *DeploymentIncludedMeta `json:"meta,omitempty"` - Type *DeploymentIncludedType `json:"type,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "meta", "type"}) - } else { - return err - } - - hasInvalidField := false - if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Attributes = all.Attributes - o.Id = all.Id - if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Meta = all.Meta - if all.Type != nil && !all.Type.IsValid() { - hasInvalidField = true - } else { - o.Type = all.Type - } - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_deployment_included_meta.go b/api/datadogV2/model_deployment_included_meta.go deleted file mode 100644 index 6a2ed5661f4..00000000000 --- a/api/datadogV2/model_deployment_included_meta.go +++ /dev/null @@ -1,209 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/google/uuid" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// DeploymentIncludedMeta The definition of `DeploymentIncludedMeta` object. -type DeploymentIncludedMeta struct { - // The `meta` `created_at`. - CreatedAt *string `json:"created_at,omitempty"` - // The `meta` `user_id`. - UserId *int64 `json:"user_id,omitempty"` - // The `meta` `user_name`. - UserName *string `json:"user_name,omitempty"` - // The `meta` `user_uuid`. - UserUuid *uuid.UUID `json:"user_uuid,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewDeploymentIncludedMeta instantiates a new DeploymentIncludedMeta object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewDeploymentIncludedMeta() *DeploymentIncludedMeta { - this := DeploymentIncludedMeta{} - return &this -} - -// NewDeploymentIncludedMetaWithDefaults instantiates a new DeploymentIncludedMeta object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewDeploymentIncludedMetaWithDefaults() *DeploymentIncludedMeta { - this := DeploymentIncludedMeta{} - return &this -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *DeploymentIncludedMeta) GetCreatedAt() string { - if o == nil || o.CreatedAt == nil { - var ret string - return ret - } - return *o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DeploymentIncludedMeta) GetCreatedAtOk() (*string, bool) { - if o == nil || o.CreatedAt == nil { - return nil, false - } - return o.CreatedAt, true -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *DeploymentIncludedMeta) HasCreatedAt() bool { - return o != nil && o.CreatedAt != nil -} - -// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field. -func (o *DeploymentIncludedMeta) SetCreatedAt(v string) { - o.CreatedAt = &v -} - -// GetUserId returns the UserId field value if set, zero value otherwise. -func (o *DeploymentIncludedMeta) GetUserId() int64 { - if o == nil || o.UserId == nil { - var ret int64 - return ret - } - return *o.UserId -} - -// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DeploymentIncludedMeta) GetUserIdOk() (*int64, bool) { - if o == nil || o.UserId == nil { - return nil, false - } - return o.UserId, true -} - -// HasUserId returns a boolean if a field has been set. -func (o *DeploymentIncludedMeta) HasUserId() bool { - return o != nil && o.UserId != nil -} - -// SetUserId gets a reference to the given int64 and assigns it to the UserId field. -func (o *DeploymentIncludedMeta) SetUserId(v int64) { - o.UserId = &v -} - -// GetUserName returns the UserName field value if set, zero value otherwise. -func (o *DeploymentIncludedMeta) GetUserName() string { - if o == nil || o.UserName == nil { - var ret string - return ret - } - return *o.UserName -} - -// GetUserNameOk returns a tuple with the UserName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DeploymentIncludedMeta) GetUserNameOk() (*string, bool) { - if o == nil || o.UserName == nil { - return nil, false - } - return o.UserName, true -} - -// HasUserName returns a boolean if a field has been set. -func (o *DeploymentIncludedMeta) HasUserName() bool { - return o != nil && o.UserName != nil -} - -// SetUserName gets a reference to the given string and assigns it to the UserName field. -func (o *DeploymentIncludedMeta) SetUserName(v string) { - o.UserName = &v -} - -// GetUserUuid returns the UserUuid field value if set, zero value otherwise. -func (o *DeploymentIncludedMeta) GetUserUuid() uuid.UUID { - if o == nil || o.UserUuid == nil { - var ret uuid.UUID - return ret - } - return *o.UserUuid -} - -// GetUserUuidOk returns a tuple with the UserUuid field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DeploymentIncludedMeta) GetUserUuidOk() (*uuid.UUID, bool) { - if o == nil || o.UserUuid == nil { - return nil, false - } - return o.UserUuid, true -} - -// HasUserUuid returns a boolean if a field has been set. -func (o *DeploymentIncludedMeta) HasUserUuid() bool { - return o != nil && o.UserUuid != nil -} - -// SetUserUuid gets a reference to the given uuid.UUID and assigns it to the UserUuid field. -func (o *DeploymentIncludedMeta) SetUserUuid(v uuid.UUID) { - o.UserUuid = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o DeploymentIncludedMeta) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.CreatedAt != nil { - toSerialize["created_at"] = o.CreatedAt - } - if o.UserId != nil { - toSerialize["user_id"] = o.UserId - } - if o.UserName != nil { - toSerialize["user_name"] = o.UserName - } - if o.UserUuid != nil { - toSerialize["user_uuid"] = o.UserUuid - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *DeploymentIncludedMeta) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - CreatedAt *string `json:"created_at,omitempty"` - UserId *int64 `json:"user_id,omitempty"` - UserName *string `json:"user_name,omitempty"` - UserUuid *uuid.UUID `json:"user_uuid,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "user_id", "user_name", "user_uuid"}) - } else { - return err - } - o.CreatedAt = all.CreatedAt - o.UserId = all.UserId - o.UserName = all.UserName - o.UserUuid = all.UserUuid - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_deployment_included_type.go b/api/datadogV2/model_deployment_included_type.go deleted file mode 100644 index 18814099227..00000000000 --- a/api/datadogV2/model_deployment_included_type.go +++ /dev/null @@ -1,64 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// DeploymentIncludedType The definition of `DeploymentIncludedType` object. -type DeploymentIncludedType string - -// List of DeploymentIncludedType. -const ( - DEPLOYMENTINCLUDEDTYPE_DEPLOYMENT DeploymentIncludedType = "deployment" -) - -var allowedDeploymentIncludedTypeEnumValues = []DeploymentIncludedType{ - DEPLOYMENTINCLUDEDTYPE_DEPLOYMENT, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *DeploymentIncludedType) GetAllowedValues() []DeploymentIncludedType { - return allowedDeploymentIncludedTypeEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *DeploymentIncludedType) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = DeploymentIncludedType(value) - return nil -} - -// NewDeploymentIncludedTypeFromValue returns a pointer to a valid DeploymentIncludedType -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewDeploymentIncludedTypeFromValue(v string) (*DeploymentIncludedType, error) { - ev := DeploymentIncludedType(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for DeploymentIncludedType: valid values are %v", v, allowedDeploymentIncludedTypeEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v DeploymentIncludedType) IsValid() bool { - for _, existing := range allowedDeploymentIncludedTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to DeploymentIncludedType value. -func (v DeploymentIncludedType) Ptr() *DeploymentIncludedType { - return &v -} diff --git a/api/datadogV2/model_deployment_meta.go b/api/datadogV2/model_deployment_metadata.go similarity index 69% rename from api/datadogV2/model_deployment_meta.go rename to api/datadogV2/model_deployment_metadata.go index b254114132c..558f1d1c09d 100644 --- a/api/datadogV2/model_deployment_meta.go +++ b/api/datadogV2/model_deployment_metadata.go @@ -5,47 +5,49 @@ package datadogV2 import ( + "time" + "github.com/google/uuid" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// DeploymentMeta The definition of `DeploymentMeta` object. -type DeploymentMeta struct { - // The `DeploymentMeta` `created_at`. - CreatedAt *string `json:"created_at,omitempty"` - // The `DeploymentMeta` `user_id`. +// DeploymentMetadata Metadata object containing the publication creation information. +type DeploymentMetadata struct { + // Timestamp of when the app was published. + CreatedAt *time.Time `json:"created_at,omitempty"` + // The ID of the user who published the app. UserId *int64 `json:"user_id,omitempty"` - // The `DeploymentMeta` `user_name`. + // The name (or email address) of the user who published the app. UserName *string `json:"user_name,omitempty"` - // The `DeploymentMeta` `user_uuid`. + // The UUID of the user who published the app. UserUuid *uuid.UUID `json:"user_uuid,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } -// NewDeploymentMeta instantiates a new DeploymentMeta object. +// NewDeploymentMetadata instantiates a new DeploymentMetadata object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewDeploymentMeta() *DeploymentMeta { - this := DeploymentMeta{} +func NewDeploymentMetadata() *DeploymentMetadata { + this := DeploymentMetadata{} return &this } -// NewDeploymentMetaWithDefaults instantiates a new DeploymentMeta object. +// NewDeploymentMetadataWithDefaults instantiates a new DeploymentMetadata object. // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set. -func NewDeploymentMetaWithDefaults() *DeploymentMeta { - this := DeploymentMeta{} +func NewDeploymentMetadataWithDefaults() *DeploymentMetadata { + this := DeploymentMetadata{} return &this } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *DeploymentMeta) GetCreatedAt() string { +func (o *DeploymentMetadata) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { - var ret string + var ret time.Time return ret } return *o.CreatedAt @@ -53,7 +55,7 @@ func (o *DeploymentMeta) GetCreatedAt() string { // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DeploymentMeta) GetCreatedAtOk() (*string, bool) { +func (o *DeploymentMetadata) GetCreatedAtOk() (*time.Time, bool) { if o == nil || o.CreatedAt == nil { return nil, false } @@ -61,17 +63,17 @@ func (o *DeploymentMeta) GetCreatedAtOk() (*string, bool) { } // HasCreatedAt returns a boolean if a field has been set. -func (o *DeploymentMeta) HasCreatedAt() bool { +func (o *DeploymentMetadata) HasCreatedAt() bool { return o != nil && o.CreatedAt != nil } -// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field. -func (o *DeploymentMeta) SetCreatedAt(v string) { +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *DeploymentMetadata) SetCreatedAt(v time.Time) { o.CreatedAt = &v } // GetUserId returns the UserId field value if set, zero value otherwise. -func (o *DeploymentMeta) GetUserId() int64 { +func (o *DeploymentMetadata) GetUserId() int64 { if o == nil || o.UserId == nil { var ret int64 return ret @@ -81,7 +83,7 @@ func (o *DeploymentMeta) GetUserId() int64 { // GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DeploymentMeta) GetUserIdOk() (*int64, bool) { +func (o *DeploymentMetadata) GetUserIdOk() (*int64, bool) { if o == nil || o.UserId == nil { return nil, false } @@ -89,17 +91,17 @@ func (o *DeploymentMeta) GetUserIdOk() (*int64, bool) { } // HasUserId returns a boolean if a field has been set. -func (o *DeploymentMeta) HasUserId() bool { +func (o *DeploymentMetadata) HasUserId() bool { return o != nil && o.UserId != nil } // SetUserId gets a reference to the given int64 and assigns it to the UserId field. -func (o *DeploymentMeta) SetUserId(v int64) { +func (o *DeploymentMetadata) SetUserId(v int64) { o.UserId = &v } // GetUserName returns the UserName field value if set, zero value otherwise. -func (o *DeploymentMeta) GetUserName() string { +func (o *DeploymentMetadata) GetUserName() string { if o == nil || o.UserName == nil { var ret string return ret @@ -109,7 +111,7 @@ func (o *DeploymentMeta) GetUserName() string { // GetUserNameOk returns a tuple with the UserName field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DeploymentMeta) GetUserNameOk() (*string, bool) { +func (o *DeploymentMetadata) GetUserNameOk() (*string, bool) { if o == nil || o.UserName == nil { return nil, false } @@ -117,17 +119,17 @@ func (o *DeploymentMeta) GetUserNameOk() (*string, bool) { } // HasUserName returns a boolean if a field has been set. -func (o *DeploymentMeta) HasUserName() bool { +func (o *DeploymentMetadata) HasUserName() bool { return o != nil && o.UserName != nil } // SetUserName gets a reference to the given string and assigns it to the UserName field. -func (o *DeploymentMeta) SetUserName(v string) { +func (o *DeploymentMetadata) SetUserName(v string) { o.UserName = &v } // GetUserUuid returns the UserUuid field value if set, zero value otherwise. -func (o *DeploymentMeta) GetUserUuid() uuid.UUID { +func (o *DeploymentMetadata) GetUserUuid() uuid.UUID { if o == nil || o.UserUuid == nil { var ret uuid.UUID return ret @@ -137,7 +139,7 @@ func (o *DeploymentMeta) GetUserUuid() uuid.UUID { // GetUserUuidOk returns a tuple with the UserUuid field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DeploymentMeta) GetUserUuidOk() (*uuid.UUID, bool) { +func (o *DeploymentMetadata) GetUserUuidOk() (*uuid.UUID, bool) { if o == nil || o.UserUuid == nil { return nil, false } @@ -145,23 +147,27 @@ func (o *DeploymentMeta) GetUserUuidOk() (*uuid.UUID, bool) { } // HasUserUuid returns a boolean if a field has been set. -func (o *DeploymentMeta) HasUserUuid() bool { +func (o *DeploymentMetadata) HasUserUuid() bool { return o != nil && o.UserUuid != nil } // SetUserUuid gets a reference to the given uuid.UUID and assigns it to the UserUuid field. -func (o *DeploymentMeta) SetUserUuid(v uuid.UUID) { +func (o *DeploymentMetadata) SetUserUuid(v uuid.UUID) { o.UserUuid = &v } // MarshalJSON serializes the struct using spec logic. -func (o DeploymentMeta) MarshalJSON() ([]byte, error) { +func (o DeploymentMetadata) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) } if o.CreatedAt != nil { - toSerialize["created_at"] = o.CreatedAt + if o.CreatedAt.Nanosecond() == 0 { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } } if o.UserId != nil { toSerialize["user_id"] = o.UserId @@ -180,9 +186,9 @@ func (o DeploymentMeta) MarshalJSON() ([]byte, error) { } // UnmarshalJSON deserializes the given payload. -func (o *DeploymentMeta) UnmarshalJSON(bytes []byte) (err error) { +func (o *DeploymentMetadata) UnmarshalJSON(bytes []byte) (err error) { all := struct { - CreatedAt *string `json:"created_at,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` UserId *int64 `json:"user_id,omitempty"` UserName *string `json:"user_name,omitempty"` UserUuid *uuid.UUID `json:"user_uuid,omitempty"` diff --git a/api/datadogV2/model_deployment_relationship.go b/api/datadogV2/model_deployment_relationship.go index 1c57379dc0a..c63f774f1de 100644 --- a/api/datadogV2/model_deployment_relationship.go +++ b/api/datadogV2/model_deployment_relationship.go @@ -8,12 +8,12 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// DeploymentRelationship The definition of `DeploymentRelationship` object. +// DeploymentRelationship Information pointing to the app's publication status. type DeploymentRelationship struct { - // The definition of `DeploymentRelationshipData` object. + // Data object containing the deployment ID. Data *DeploymentRelationshipData `json:"data,omitempty"` - // The definition of `DeploymentRelationshipMeta` object. - Meta *DeploymentRelationshipMeta `json:"meta,omitempty"` + // Metadata object containing the publication creation information. + Meta *DeploymentMetadata `json:"meta,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -65,9 +65,9 @@ func (o *DeploymentRelationship) SetData(v DeploymentRelationshipData) { } // GetMeta returns the Meta field value if set, zero value otherwise. -func (o *DeploymentRelationship) GetMeta() DeploymentRelationshipMeta { +func (o *DeploymentRelationship) GetMeta() DeploymentMetadata { if o == nil || o.Meta == nil { - var ret DeploymentRelationshipMeta + var ret DeploymentMetadata return ret } return *o.Meta @@ -75,7 +75,7 @@ func (o *DeploymentRelationship) GetMeta() DeploymentRelationshipMeta { // GetMetaOk returns a tuple with the Meta field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DeploymentRelationship) GetMetaOk() (*DeploymentRelationshipMeta, bool) { +func (o *DeploymentRelationship) GetMetaOk() (*DeploymentMetadata, bool) { if o == nil || o.Meta == nil { return nil, false } @@ -87,8 +87,8 @@ func (o *DeploymentRelationship) HasMeta() bool { return o != nil && o.Meta != nil } -// SetMeta gets a reference to the given DeploymentRelationshipMeta and assigns it to the Meta field. -func (o *DeploymentRelationship) SetMeta(v DeploymentRelationshipMeta) { +// SetMeta gets a reference to the given DeploymentMetadata and assigns it to the Meta field. +func (o *DeploymentRelationship) SetMeta(v DeploymentMetadata) { o.Meta = &v } @@ -115,7 +115,7 @@ func (o DeploymentRelationship) MarshalJSON() ([]byte, error) { func (o *DeploymentRelationship) UnmarshalJSON(bytes []byte) (err error) { all := struct { Data *DeploymentRelationshipData `json:"data,omitempty"` - Meta *DeploymentRelationshipMeta `json:"meta,omitempty"` + Meta *DeploymentMetadata `json:"meta,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_deployment_relationship_data.go b/api/datadogV2/model_deployment_relationship_data.go index ca66e1a6b04..3d737013ce1 100644 --- a/api/datadogV2/model_deployment_relationship_data.go +++ b/api/datadogV2/model_deployment_relationship_data.go @@ -5,15 +5,17 @@ package datadogV2 import ( + "github.com/google/uuid" + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// DeploymentRelationshipData The definition of `DeploymentRelationshipData` object. +// DeploymentRelationshipData Data object containing the deployment ID. type DeploymentRelationshipData struct { - // The `data` `id`. - Id *string `json:"id,omitempty"` - // The definition of `DeploymentRelationshipDataType` object. - Type *DeploymentRelationshipDataType `json:"type,omitempty"` + // The deployment ID. + Id *uuid.UUID `json:"id,omitempty"` + // The deployment type. + Type *AppDeploymentType `json:"type,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -25,7 +27,7 @@ type DeploymentRelationshipData struct { // will change when the set of required properties is changed. func NewDeploymentRelationshipData() *DeploymentRelationshipData { this := DeploymentRelationshipData{} - var typeVar DeploymentRelationshipDataType = DEPLOYMENTRELATIONSHIPDATATYPE_DEPLOYMENT + var typeVar AppDeploymentType = APPDEPLOYMENTTYPE_DEPLOYMENT this.Type = &typeVar return &this } @@ -35,15 +37,15 @@ func NewDeploymentRelationshipData() *DeploymentRelationshipData { // but it doesn't guarantee that properties required by API are set. func NewDeploymentRelationshipDataWithDefaults() *DeploymentRelationshipData { this := DeploymentRelationshipData{} - var typeVar DeploymentRelationshipDataType = DEPLOYMENTRELATIONSHIPDATATYPE_DEPLOYMENT + var typeVar AppDeploymentType = APPDEPLOYMENTTYPE_DEPLOYMENT this.Type = &typeVar return &this } // GetId returns the Id field value if set, zero value otherwise. -func (o *DeploymentRelationshipData) GetId() string { +func (o *DeploymentRelationshipData) GetId() uuid.UUID { if o == nil || o.Id == nil { - var ret string + var ret uuid.UUID return ret } return *o.Id @@ -51,7 +53,7 @@ func (o *DeploymentRelationshipData) GetId() string { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DeploymentRelationshipData) GetIdOk() (*string, bool) { +func (o *DeploymentRelationshipData) GetIdOk() (*uuid.UUID, bool) { if o == nil || o.Id == nil { return nil, false } @@ -63,15 +65,15 @@ func (o *DeploymentRelationshipData) HasId() bool { return o != nil && o.Id != nil } -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *DeploymentRelationshipData) SetId(v string) { +// SetId gets a reference to the given uuid.UUID and assigns it to the Id field. +func (o *DeploymentRelationshipData) SetId(v uuid.UUID) { o.Id = &v } // GetType returns the Type field value if set, zero value otherwise. -func (o *DeploymentRelationshipData) GetType() DeploymentRelationshipDataType { +func (o *DeploymentRelationshipData) GetType() AppDeploymentType { if o == nil || o.Type == nil { - var ret DeploymentRelationshipDataType + var ret AppDeploymentType return ret } return *o.Type @@ -79,7 +81,7 @@ func (o *DeploymentRelationshipData) GetType() DeploymentRelationshipDataType { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DeploymentRelationshipData) GetTypeOk() (*DeploymentRelationshipDataType, bool) { +func (o *DeploymentRelationshipData) GetTypeOk() (*AppDeploymentType, bool) { if o == nil || o.Type == nil { return nil, false } @@ -91,8 +93,8 @@ func (o *DeploymentRelationshipData) HasType() bool { return o != nil && o.Type != nil } -// SetType gets a reference to the given DeploymentRelationshipDataType and assigns it to the Type field. -func (o *DeploymentRelationshipData) SetType(v DeploymentRelationshipDataType) { +// SetType gets a reference to the given AppDeploymentType and assigns it to the Type field. +func (o *DeploymentRelationshipData) SetType(v AppDeploymentType) { o.Type = &v } @@ -118,8 +120,8 @@ func (o DeploymentRelationshipData) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *DeploymentRelationshipData) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - Type *DeploymentRelationshipDataType `json:"type,omitempty"` + Id *uuid.UUID `json:"id,omitempty"` + Type *AppDeploymentType `json:"type,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_deployment_relationship_data_type.go b/api/datadogV2/model_deployment_relationship_data_type.go deleted file mode 100644 index 18f939befbc..00000000000 --- a/api/datadogV2/model_deployment_relationship_data_type.go +++ /dev/null @@ -1,64 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// DeploymentRelationshipDataType The definition of `DeploymentRelationshipDataType` object. -type DeploymentRelationshipDataType string - -// List of DeploymentRelationshipDataType. -const ( - DEPLOYMENTRELATIONSHIPDATATYPE_DEPLOYMENT DeploymentRelationshipDataType = "deployment" -) - -var allowedDeploymentRelationshipDataTypeEnumValues = []DeploymentRelationshipDataType{ - DEPLOYMENTRELATIONSHIPDATATYPE_DEPLOYMENT, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *DeploymentRelationshipDataType) GetAllowedValues() []DeploymentRelationshipDataType { - return allowedDeploymentRelationshipDataTypeEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *DeploymentRelationshipDataType) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = DeploymentRelationshipDataType(value) - return nil -} - -// NewDeploymentRelationshipDataTypeFromValue returns a pointer to a valid DeploymentRelationshipDataType -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewDeploymentRelationshipDataTypeFromValue(v string) (*DeploymentRelationshipDataType, error) { - ev := DeploymentRelationshipDataType(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for DeploymentRelationshipDataType: valid values are %v", v, allowedDeploymentRelationshipDataTypeEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v DeploymentRelationshipDataType) IsValid() bool { - for _, existing := range allowedDeploymentRelationshipDataTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to DeploymentRelationshipDataType value. -func (v DeploymentRelationshipDataType) Ptr() *DeploymentRelationshipDataType { - return &v -} diff --git a/api/datadogV2/model_deployment_relationship_meta.go b/api/datadogV2/model_deployment_relationship_meta.go deleted file mode 100644 index d622add5b3a..00000000000 --- a/api/datadogV2/model_deployment_relationship_meta.go +++ /dev/null @@ -1,209 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/google/uuid" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// DeploymentRelationshipMeta The definition of `DeploymentRelationshipMeta` object. -type DeploymentRelationshipMeta struct { - // The `meta` `created_at`. - CreatedAt *string `json:"created_at,omitempty"` - // The `meta` `user_id`. - UserId *int64 `json:"user_id,omitempty"` - // The `meta` `user_name`. - UserName *string `json:"user_name,omitempty"` - // The `meta` `user_uuid`. - UserUuid *uuid.UUID `json:"user_uuid,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewDeploymentRelationshipMeta instantiates a new DeploymentRelationshipMeta object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewDeploymentRelationshipMeta() *DeploymentRelationshipMeta { - this := DeploymentRelationshipMeta{} - return &this -} - -// NewDeploymentRelationshipMetaWithDefaults instantiates a new DeploymentRelationshipMeta object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewDeploymentRelationshipMetaWithDefaults() *DeploymentRelationshipMeta { - this := DeploymentRelationshipMeta{} - return &this -} - -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *DeploymentRelationshipMeta) GetCreatedAt() string { - if o == nil || o.CreatedAt == nil { - var ret string - return ret - } - return *o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DeploymentRelationshipMeta) GetCreatedAtOk() (*string, bool) { - if o == nil || o.CreatedAt == nil { - return nil, false - } - return o.CreatedAt, true -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *DeploymentRelationshipMeta) HasCreatedAt() bool { - return o != nil && o.CreatedAt != nil -} - -// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field. -func (o *DeploymentRelationshipMeta) SetCreatedAt(v string) { - o.CreatedAt = &v -} - -// GetUserId returns the UserId field value if set, zero value otherwise. -func (o *DeploymentRelationshipMeta) GetUserId() int64 { - if o == nil || o.UserId == nil { - var ret int64 - return ret - } - return *o.UserId -} - -// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DeploymentRelationshipMeta) GetUserIdOk() (*int64, bool) { - if o == nil || o.UserId == nil { - return nil, false - } - return o.UserId, true -} - -// HasUserId returns a boolean if a field has been set. -func (o *DeploymentRelationshipMeta) HasUserId() bool { - return o != nil && o.UserId != nil -} - -// SetUserId gets a reference to the given int64 and assigns it to the UserId field. -func (o *DeploymentRelationshipMeta) SetUserId(v int64) { - o.UserId = &v -} - -// GetUserName returns the UserName field value if set, zero value otherwise. -func (o *DeploymentRelationshipMeta) GetUserName() string { - if o == nil || o.UserName == nil { - var ret string - return ret - } - return *o.UserName -} - -// GetUserNameOk returns a tuple with the UserName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DeploymentRelationshipMeta) GetUserNameOk() (*string, bool) { - if o == nil || o.UserName == nil { - return nil, false - } - return o.UserName, true -} - -// HasUserName returns a boolean if a field has been set. -func (o *DeploymentRelationshipMeta) HasUserName() bool { - return o != nil && o.UserName != nil -} - -// SetUserName gets a reference to the given string and assigns it to the UserName field. -func (o *DeploymentRelationshipMeta) SetUserName(v string) { - o.UserName = &v -} - -// GetUserUuid returns the UserUuid field value if set, zero value otherwise. -func (o *DeploymentRelationshipMeta) GetUserUuid() uuid.UUID { - if o == nil || o.UserUuid == nil { - var ret uuid.UUID - return ret - } - return *o.UserUuid -} - -// GetUserUuidOk returns a tuple with the UserUuid field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DeploymentRelationshipMeta) GetUserUuidOk() (*uuid.UUID, bool) { - if o == nil || o.UserUuid == nil { - return nil, false - } - return o.UserUuid, true -} - -// HasUserUuid returns a boolean if a field has been set. -func (o *DeploymentRelationshipMeta) HasUserUuid() bool { - return o != nil && o.UserUuid != nil -} - -// SetUserUuid gets a reference to the given uuid.UUID and assigns it to the UserUuid field. -func (o *DeploymentRelationshipMeta) SetUserUuid(v uuid.UUID) { - o.UserUuid = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o DeploymentRelationshipMeta) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.CreatedAt != nil { - toSerialize["created_at"] = o.CreatedAt - } - if o.UserId != nil { - toSerialize["user_id"] = o.UserId - } - if o.UserName != nil { - toSerialize["user_name"] = o.UserName - } - if o.UserUuid != nil { - toSerialize["user_uuid"] = o.UserUuid - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *DeploymentRelationshipMeta) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - CreatedAt *string `json:"created_at,omitempty"` - UserId *int64 `json:"user_id,omitempty"` - UserName *string `json:"user_name,omitempty"` - UserUuid *uuid.UUID `json:"user_uuid,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "user_id", "user_name", "user_uuid"}) - } else { - return err - } - o.CreatedAt = all.CreatedAt - o.UserId = all.UserId - o.UserName = all.UserName - o.UserUuid = all.UserUuid - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_disable_app_response.go b/api/datadogV2/model_disable_app_response.go deleted file mode 100644 index c8c454762b5..00000000000 --- a/api/datadogV2/model_disable_app_response.go +++ /dev/null @@ -1,111 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// DisableAppResponse The definition of `DisableAppResponse` object. -type DisableAppResponse struct { - // The definition of `DisableAppResponseData` object. - Data *DisableAppResponseData `json:"data,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewDisableAppResponse instantiates a new DisableAppResponse object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewDisableAppResponse() *DisableAppResponse { - this := DisableAppResponse{} - return &this -} - -// NewDisableAppResponseWithDefaults instantiates a new DisableAppResponse object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewDisableAppResponseWithDefaults() *DisableAppResponse { - this := DisableAppResponse{} - return &this -} - -// GetData returns the Data field value if set, zero value otherwise. -func (o *DisableAppResponse) GetData() DisableAppResponseData { - if o == nil || o.Data == nil { - var ret DisableAppResponseData - return ret - } - return *o.Data -} - -// GetDataOk returns a tuple with the Data field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DisableAppResponse) GetDataOk() (*DisableAppResponseData, bool) { - if o == nil || o.Data == nil { - return nil, false - } - return o.Data, true -} - -// HasData returns a boolean if a field has been set. -func (o *DisableAppResponse) HasData() bool { - return o != nil && o.Data != nil -} - -// SetData gets a reference to the given DisableAppResponseData and assigns it to the Data field. -func (o *DisableAppResponse) SetData(v DisableAppResponseData) { - o.Data = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o DisableAppResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Data != nil { - toSerialize["data"] = o.Data - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *DisableAppResponse) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Data *DisableAppResponseData `json:"data,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"data"}) - } else { - return err - } - - hasInvalidField := false - if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Data = all.Data - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_disable_app_response_data.go b/api/datadogV2/model_disable_app_response_data.go deleted file mode 100644 index 65c94ea3ab3..00000000000 --- a/api/datadogV2/model_disable_app_response_data.go +++ /dev/null @@ -1,227 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// DisableAppResponseData The definition of `DisableAppResponseData` object. -type DisableAppResponseData struct { - // The definition of `DisableAppResponseDataAttributes` object. - Attributes *DisableAppResponseDataAttributes `json:"attributes,omitempty"` - // The `data` `id`. - Id *string `json:"id,omitempty"` - // The definition of `DeploymentMeta` object. - Meta *DeploymentMeta `json:"meta,omitempty"` - // The definition of `DisableAppResponseDataType` object. - Type *DisableAppResponseDataType `json:"type,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewDisableAppResponseData instantiates a new DisableAppResponseData object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewDisableAppResponseData() *DisableAppResponseData { - this := DisableAppResponseData{} - var typeVar DisableAppResponseDataType = DISABLEAPPRESPONSEDATATYPE_DEPLOYMENT - this.Type = &typeVar - return &this -} - -// NewDisableAppResponseDataWithDefaults instantiates a new DisableAppResponseData object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewDisableAppResponseDataWithDefaults() *DisableAppResponseData { - this := DisableAppResponseData{} - var typeVar DisableAppResponseDataType = DISABLEAPPRESPONSEDATATYPE_DEPLOYMENT - this.Type = &typeVar - return &this -} - -// GetAttributes returns the Attributes field value if set, zero value otherwise. -func (o *DisableAppResponseData) GetAttributes() DisableAppResponseDataAttributes { - if o == nil || o.Attributes == nil { - var ret DisableAppResponseDataAttributes - return ret - } - return *o.Attributes -} - -// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DisableAppResponseData) GetAttributesOk() (*DisableAppResponseDataAttributes, bool) { - if o == nil || o.Attributes == nil { - return nil, false - } - return o.Attributes, true -} - -// HasAttributes returns a boolean if a field has been set. -func (o *DisableAppResponseData) HasAttributes() bool { - return o != nil && o.Attributes != nil -} - -// SetAttributes gets a reference to the given DisableAppResponseDataAttributes and assigns it to the Attributes field. -func (o *DisableAppResponseData) SetAttributes(v DisableAppResponseDataAttributes) { - o.Attributes = &v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *DisableAppResponseData) GetId() string { - if o == nil || o.Id == nil { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DisableAppResponseData) GetIdOk() (*string, bool) { - if o == nil || o.Id == nil { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *DisableAppResponseData) HasId() bool { - return o != nil && o.Id != nil -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *DisableAppResponseData) SetId(v string) { - o.Id = &v -} - -// GetMeta returns the Meta field value if set, zero value otherwise. -func (o *DisableAppResponseData) GetMeta() DeploymentMeta { - if o == nil || o.Meta == nil { - var ret DeploymentMeta - return ret - } - return *o.Meta -} - -// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DisableAppResponseData) GetMetaOk() (*DeploymentMeta, bool) { - if o == nil || o.Meta == nil { - return nil, false - } - return o.Meta, true -} - -// HasMeta returns a boolean if a field has been set. -func (o *DisableAppResponseData) HasMeta() bool { - return o != nil && o.Meta != nil -} - -// SetMeta gets a reference to the given DeploymentMeta and assigns it to the Meta field. -func (o *DisableAppResponseData) SetMeta(v DeploymentMeta) { - o.Meta = &v -} - -// GetType returns the Type field value if set, zero value otherwise. -func (o *DisableAppResponseData) GetType() DisableAppResponseDataType { - if o == nil || o.Type == nil { - var ret DisableAppResponseDataType - return ret - } - return *o.Type -} - -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DisableAppResponseData) GetTypeOk() (*DisableAppResponseDataType, bool) { - if o == nil || o.Type == nil { - return nil, false - } - return o.Type, true -} - -// HasType returns a boolean if a field has been set. -func (o *DisableAppResponseData) HasType() bool { - return o != nil && o.Type != nil -} - -// SetType gets a reference to the given DisableAppResponseDataType and assigns it to the Type field. -func (o *DisableAppResponseData) SetType(v DisableAppResponseDataType) { - o.Type = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o DisableAppResponseData) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Attributes != nil { - toSerialize["attributes"] = o.Attributes - } - if o.Id != nil { - toSerialize["id"] = o.Id - } - if o.Meta != nil { - toSerialize["meta"] = o.Meta - } - if o.Type != nil { - toSerialize["type"] = o.Type - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *DisableAppResponseData) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Attributes *DisableAppResponseDataAttributes `json:"attributes,omitempty"` - Id *string `json:"id,omitempty"` - Meta *DeploymentMeta `json:"meta,omitempty"` - Type *DisableAppResponseDataType `json:"type,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "meta", "type"}) - } else { - return err - } - - hasInvalidField := false - if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Attributes = all.Attributes - o.Id = all.Id - if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Meta = all.Meta - if all.Type != nil && !all.Type.IsValid() { - hasInvalidField = true - } else { - o.Type = all.Type - } - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_disable_app_response_data_attributes.go b/api/datadogV2/model_disable_app_response_data_attributes.go deleted file mode 100644 index fb06539a7b9..00000000000 --- a/api/datadogV2/model_disable_app_response_data_attributes.go +++ /dev/null @@ -1,102 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// DisableAppResponseDataAttributes The definition of `DisableAppResponseDataAttributes` object. -type DisableAppResponseDataAttributes struct { - // The `attributes` `app_version_id`. - AppVersionId *string `json:"app_version_id,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewDisableAppResponseDataAttributes instantiates a new DisableAppResponseDataAttributes object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewDisableAppResponseDataAttributes() *DisableAppResponseDataAttributes { - this := DisableAppResponseDataAttributes{} - return &this -} - -// NewDisableAppResponseDataAttributesWithDefaults instantiates a new DisableAppResponseDataAttributes object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewDisableAppResponseDataAttributesWithDefaults() *DisableAppResponseDataAttributes { - this := DisableAppResponseDataAttributes{} - return &this -} - -// GetAppVersionId returns the AppVersionId field value if set, zero value otherwise. -func (o *DisableAppResponseDataAttributes) GetAppVersionId() string { - if o == nil || o.AppVersionId == nil { - var ret string - return ret - } - return *o.AppVersionId -} - -// GetAppVersionIdOk returns a tuple with the AppVersionId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DisableAppResponseDataAttributes) GetAppVersionIdOk() (*string, bool) { - if o == nil || o.AppVersionId == nil { - return nil, false - } - return o.AppVersionId, true -} - -// HasAppVersionId returns a boolean if a field has been set. -func (o *DisableAppResponseDataAttributes) HasAppVersionId() bool { - return o != nil && o.AppVersionId != nil -} - -// SetAppVersionId gets a reference to the given string and assigns it to the AppVersionId field. -func (o *DisableAppResponseDataAttributes) SetAppVersionId(v string) { - o.AppVersionId = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o DisableAppResponseDataAttributes) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.AppVersionId != nil { - toSerialize["app_version_id"] = o.AppVersionId - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *DisableAppResponseDataAttributes) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - AppVersionId *string `json:"app_version_id,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"app_version_id"}) - } else { - return err - } - o.AppVersionId = all.AppVersionId - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_disable_app_response_data_type.go b/api/datadogV2/model_disable_app_response_data_type.go deleted file mode 100644 index 70ff1e74b62..00000000000 --- a/api/datadogV2/model_disable_app_response_data_type.go +++ /dev/null @@ -1,64 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// DisableAppResponseDataType The definition of `DisableAppResponseDataType` object. -type DisableAppResponseDataType string - -// List of DisableAppResponseDataType. -const ( - DISABLEAPPRESPONSEDATATYPE_DEPLOYMENT DisableAppResponseDataType = "deployment" -) - -var allowedDisableAppResponseDataTypeEnumValues = []DisableAppResponseDataType{ - DISABLEAPPRESPONSEDATATYPE_DEPLOYMENT, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *DisableAppResponseDataType) GetAllowedValues() []DisableAppResponseDataType { - return allowedDisableAppResponseDataTypeEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *DisableAppResponseDataType) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = DisableAppResponseDataType(value) - return nil -} - -// NewDisableAppResponseDataTypeFromValue returns a pointer to a valid DisableAppResponseDataType -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewDisableAppResponseDataTypeFromValue(v string) (*DisableAppResponseDataType, error) { - ev := DisableAppResponseDataType(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for DisableAppResponseDataType: valid values are %v", v, allowedDisableAppResponseDataTypeEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v DisableAppResponseDataType) IsValid() bool { - for _, existing := range allowedDisableAppResponseDataTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to DisableAppResponseDataType value. -func (v DisableAppResponseDataType) Ptr() *DisableAppResponseDataType { - return &v -} diff --git a/api/datadogV2/model_get_app_response.go b/api/datadogV2/model_get_app_response.go index 576843f04de..0942b33911d 100644 --- a/api/datadogV2/model_get_app_response.go +++ b/api/datadogV2/model_get_app_response.go @@ -8,16 +8,16 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// GetAppResponse The definition of `GetAppResponse` object. +// GetAppResponse The full app definition response object. type GetAppResponse struct { - // The definition of `GetAppResponseData` object. + // The data object containing the app definition. Data *GetAppResponseData `json:"data,omitempty"` - // The `GetAppResponse` `included`. - Included []DeploymentIncluded `json:"included,omitempty"` - // The definition of `AppMeta` object. + // Data on the version of the app that was published. + Included []Deployment `json:"included,omitempty"` + // Metadata of an app. Meta *AppMeta `json:"meta,omitempty"` - // The definition of `GetAppResponseRelationship` object. - Relationship *GetAppResponseRelationship `json:"relationship,omitempty"` + // The app's publication relationship and custom connections. + Relationship *AppRelationship `json:"relationship,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -69,9 +69,9 @@ func (o *GetAppResponse) SetData(v GetAppResponseData) { } // GetIncluded returns the Included field value if set, zero value otherwise. -func (o *GetAppResponse) GetIncluded() []DeploymentIncluded { +func (o *GetAppResponse) GetIncluded() []Deployment { if o == nil || o.Included == nil { - var ret []DeploymentIncluded + var ret []Deployment return ret } return o.Included @@ -79,7 +79,7 @@ func (o *GetAppResponse) GetIncluded() []DeploymentIncluded { // GetIncludedOk returns a tuple with the Included field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GetAppResponse) GetIncludedOk() (*[]DeploymentIncluded, bool) { +func (o *GetAppResponse) GetIncludedOk() (*[]Deployment, bool) { if o == nil || o.Included == nil { return nil, false } @@ -91,8 +91,8 @@ func (o *GetAppResponse) HasIncluded() bool { return o != nil && o.Included != nil } -// SetIncluded gets a reference to the given []DeploymentIncluded and assigns it to the Included field. -func (o *GetAppResponse) SetIncluded(v []DeploymentIncluded) { +// SetIncluded gets a reference to the given []Deployment and assigns it to the Included field. +func (o *GetAppResponse) SetIncluded(v []Deployment) { o.Included = v } @@ -125,9 +125,9 @@ func (o *GetAppResponse) SetMeta(v AppMeta) { } // GetRelationship returns the Relationship field value if set, zero value otherwise. -func (o *GetAppResponse) GetRelationship() GetAppResponseRelationship { +func (o *GetAppResponse) GetRelationship() AppRelationship { if o == nil || o.Relationship == nil { - var ret GetAppResponseRelationship + var ret AppRelationship return ret } return *o.Relationship @@ -135,7 +135,7 @@ func (o *GetAppResponse) GetRelationship() GetAppResponseRelationship { // GetRelationshipOk returns a tuple with the Relationship field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GetAppResponse) GetRelationshipOk() (*GetAppResponseRelationship, bool) { +func (o *GetAppResponse) GetRelationshipOk() (*AppRelationship, bool) { if o == nil || o.Relationship == nil { return nil, false } @@ -147,8 +147,8 @@ func (o *GetAppResponse) HasRelationship() bool { return o != nil && o.Relationship != nil } -// SetRelationship gets a reference to the given GetAppResponseRelationship and assigns it to the Relationship field. -func (o *GetAppResponse) SetRelationship(v GetAppResponseRelationship) { +// SetRelationship gets a reference to the given AppRelationship and assigns it to the Relationship field. +func (o *GetAppResponse) SetRelationship(v AppRelationship) { o.Relationship = &v } @@ -180,10 +180,10 @@ func (o GetAppResponse) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *GetAppResponse) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Data *GetAppResponseData `json:"data,omitempty"` - Included []DeploymentIncluded `json:"included,omitempty"` - Meta *AppMeta `json:"meta,omitempty"` - Relationship *GetAppResponseRelationship `json:"relationship,omitempty"` + Data *GetAppResponseData `json:"data,omitempty"` + Included []Deployment `json:"included,omitempty"` + Meta *AppMeta `json:"meta,omitempty"` + Relationship *AppRelationship `json:"relationship,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_get_app_response_data.go b/api/datadogV2/model_get_app_response_data.go index f80cbb380b2..7b6f4de9a8f 100644 --- a/api/datadogV2/model_get_app_response_data.go +++ b/api/datadogV2/model_get_app_response_data.go @@ -7,17 +7,19 @@ package datadogV2 import ( "fmt" + "github.com/google/uuid" + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// GetAppResponseData The definition of `GetAppResponseData` object. +// GetAppResponseData The data object containing the app definition. type GetAppResponseData struct { - // The definition of `GetAppResponseDataAttributes` object. + // The app definition attributes, such as name, description, and components. Attributes GetAppResponseDataAttributes `json:"attributes"` - // The `data` `id`. - Id string `json:"id"` - // The definition of `GetAppResponseDataType` object. - Type GetAppResponseDataType `json:"type"` + // The ID of the app. + Id uuid.UUID `json:"id"` + // The app definition type. + Type AppDefinitionType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -27,7 +29,7 @@ type GetAppResponseData struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewGetAppResponseData(attributes GetAppResponseDataAttributes, id string, typeVar GetAppResponseDataType) *GetAppResponseData { +func NewGetAppResponseData(attributes GetAppResponseDataAttributes, id uuid.UUID, typeVar AppDefinitionType) *GetAppResponseData { this := GetAppResponseData{} this.Attributes = attributes this.Id = id @@ -40,7 +42,7 @@ func NewGetAppResponseData(attributes GetAppResponseDataAttributes, id string, t // but it doesn't guarantee that properties required by API are set. func NewGetAppResponseDataWithDefaults() *GetAppResponseData { this := GetAppResponseData{} - var typeVar GetAppResponseDataType = GETAPPRESPONSEDATATYPE_APPDEFINITIONS + var typeVar AppDefinitionType = APPDEFINITIONTYPE_APPDEFINITIONS this.Type = typeVar return &this } @@ -69,9 +71,9 @@ func (o *GetAppResponseData) SetAttributes(v GetAppResponseDataAttributes) { } // GetId returns the Id field value. -func (o *GetAppResponseData) GetId() string { +func (o *GetAppResponseData) GetId() uuid.UUID { if o == nil { - var ret string + var ret uuid.UUID return ret } return o.Id @@ -79,7 +81,7 @@ func (o *GetAppResponseData) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *GetAppResponseData) GetIdOk() (*string, bool) { +func (o *GetAppResponseData) GetIdOk() (*uuid.UUID, bool) { if o == nil { return nil, false } @@ -87,14 +89,14 @@ func (o *GetAppResponseData) GetIdOk() (*string, bool) { } // SetId sets field value. -func (o *GetAppResponseData) SetId(v string) { +func (o *GetAppResponseData) SetId(v uuid.UUID) { o.Id = v } // GetType returns the Type field value. -func (o *GetAppResponseData) GetType() GetAppResponseDataType { +func (o *GetAppResponseData) GetType() AppDefinitionType { if o == nil { - var ret GetAppResponseDataType + var ret AppDefinitionType return ret } return o.Type @@ -102,7 +104,7 @@ func (o *GetAppResponseData) GetType() GetAppResponseDataType { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *GetAppResponseData) GetTypeOk() (*GetAppResponseDataType, bool) { +func (o *GetAppResponseData) GetTypeOk() (*AppDefinitionType, bool) { if o == nil { return nil, false } @@ -110,7 +112,7 @@ func (o *GetAppResponseData) GetTypeOk() (*GetAppResponseDataType, bool) { } // SetType sets field value. -func (o *GetAppResponseData) SetType(v GetAppResponseDataType) { +func (o *GetAppResponseData) SetType(v AppDefinitionType) { o.Type = v } @@ -134,8 +136,8 @@ func (o GetAppResponseData) MarshalJSON() ([]byte, error) { func (o *GetAppResponseData) UnmarshalJSON(bytes []byte) (err error) { all := struct { Attributes *GetAppResponseDataAttributes `json:"attributes"` - Id *string `json:"id"` - Type *GetAppResponseDataType `json:"type"` + Id *uuid.UUID `json:"id"` + Type *AppDefinitionType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_get_app_response_data_attributes.go b/api/datadogV2/model_get_app_response_data_attributes.go index 62c13b900cb..49c1c2c2d20 100644 --- a/api/datadogV2/model_get_app_response_data_attributes.go +++ b/api/datadogV2/model_get_app_response_data_attributes.go @@ -8,25 +8,21 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// GetAppResponseDataAttributes The definition of `GetAppResponseDataAttributes` object. +// GetAppResponseDataAttributes The app definition attributes, such as name, description, and components. type GetAppResponseDataAttributes struct { - // The `attributes` `components`. + // The UI components that make up the app. Components []ComponentGrid `json:"components,omitempty"` - // The `attributes` `description`. + // A human-readable description for the app. Description *string `json:"description,omitempty"` - // The `attributes` `embeddedQueries`. + // An array of queries, such as external actions and state variables, that the app uses. EmbeddedQueries []Query `json:"embeddedQueries,omitempty"` - // The `attributes` `favorite`. + // Whether the app is marked as a favorite by the current user. Favorite *bool `json:"favorite,omitempty"` - // The definition of `InputSchema` object. - InputSchema *InputSchema `json:"inputSchema,omitempty"` - // The `attributes` `name`. + // The name of the app. Name *string `json:"name,omitempty"` - // The `attributes` `rootInstanceName`. + // The name of the root component of the app. This must be a `grid` component that contains all other components. RootInstanceName *string `json:"rootInstanceName,omitempty"` - // The `attributes` `scripts`. - Scripts []Script `json:"scripts,omitempty"` - // The `attributes` `tags`. + // A list of tags for the app, which can be used to filter apps. Tags []string `json:"tags,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` @@ -162,34 +158,6 @@ func (o *GetAppResponseDataAttributes) SetFavorite(v bool) { o.Favorite = &v } -// GetInputSchema returns the InputSchema field value if set, zero value otherwise. -func (o *GetAppResponseDataAttributes) GetInputSchema() InputSchema { - if o == nil || o.InputSchema == nil { - var ret InputSchema - return ret - } - return *o.InputSchema -} - -// GetInputSchemaOk returns a tuple with the InputSchema field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GetAppResponseDataAttributes) GetInputSchemaOk() (*InputSchema, bool) { - if o == nil || o.InputSchema == nil { - return nil, false - } - return o.InputSchema, true -} - -// HasInputSchema returns a boolean if a field has been set. -func (o *GetAppResponseDataAttributes) HasInputSchema() bool { - return o != nil && o.InputSchema != nil -} - -// SetInputSchema gets a reference to the given InputSchema and assigns it to the InputSchema field. -func (o *GetAppResponseDataAttributes) SetInputSchema(v InputSchema) { - o.InputSchema = &v -} - // GetName returns the Name field value if set, zero value otherwise. func (o *GetAppResponseDataAttributes) GetName() string { if o == nil || o.Name == nil { @@ -246,34 +214,6 @@ func (o *GetAppResponseDataAttributes) SetRootInstanceName(v string) { o.RootInstanceName = &v } -// GetScripts returns the Scripts field value if set, zero value otherwise. -func (o *GetAppResponseDataAttributes) GetScripts() []Script { - if o == nil || o.Scripts == nil { - var ret []Script - return ret - } - return o.Scripts -} - -// GetScriptsOk returns a tuple with the Scripts field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GetAppResponseDataAttributes) GetScriptsOk() (*[]Script, bool) { - if o == nil || o.Scripts == nil { - return nil, false - } - return &o.Scripts, true -} - -// HasScripts returns a boolean if a field has been set. -func (o *GetAppResponseDataAttributes) HasScripts() bool { - return o != nil && o.Scripts != nil -} - -// SetScripts gets a reference to the given []Script and assigns it to the Scripts field. -func (o *GetAppResponseDataAttributes) SetScripts(v []Script) { - o.Scripts = v -} - // GetTags returns the Tags field value if set, zero value otherwise. func (o *GetAppResponseDataAttributes) GetTags() []string { if o == nil || o.Tags == nil { @@ -320,18 +260,12 @@ func (o GetAppResponseDataAttributes) MarshalJSON() ([]byte, error) { if o.Favorite != nil { toSerialize["favorite"] = o.Favorite } - if o.InputSchema != nil { - toSerialize["inputSchema"] = o.InputSchema - } if o.Name != nil { toSerialize["name"] = o.Name } if o.RootInstanceName != nil { toSerialize["rootInstanceName"] = o.RootInstanceName } - if o.Scripts != nil { - toSerialize["scripts"] = o.Scripts - } if o.Tags != nil { toSerialize["tags"] = o.Tags } @@ -349,10 +283,8 @@ func (o *GetAppResponseDataAttributes) UnmarshalJSON(bytes []byte) (err error) { Description *string `json:"description,omitempty"` EmbeddedQueries []Query `json:"embeddedQueries,omitempty"` Favorite *bool `json:"favorite,omitempty"` - InputSchema *InputSchema `json:"inputSchema,omitempty"` Name *string `json:"name,omitempty"` RootInstanceName *string `json:"rootInstanceName,omitempty"` - Scripts []Script `json:"scripts,omitempty"` Tags []string `json:"tags,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { @@ -360,32 +292,21 @@ func (o *GetAppResponseDataAttributes) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"components", "description", "embeddedQueries", "favorite", "inputSchema", "name", "rootInstanceName", "scripts", "tags"}) + datadog.DeleteKeys(additionalProperties, &[]string{"components", "description", "embeddedQueries", "favorite", "name", "rootInstanceName", "tags"}) } else { return err } - - hasInvalidField := false o.Components = all.Components o.Description = all.Description o.EmbeddedQueries = all.EmbeddedQueries o.Favorite = all.Favorite - if all.InputSchema != nil && all.InputSchema.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.InputSchema = all.InputSchema o.Name = all.Name o.RootInstanceName = all.RootInstanceName - o.Scripts = all.Scripts o.Tags = all.Tags if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties } - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - return nil } diff --git a/api/datadogV2/model_get_app_response_data_type.go b/api/datadogV2/model_get_app_response_data_type.go deleted file mode 100644 index d1e8aafd18e..00000000000 --- a/api/datadogV2/model_get_app_response_data_type.go +++ /dev/null @@ -1,64 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// GetAppResponseDataType The definition of `GetAppResponseDataType` object. -type GetAppResponseDataType string - -// List of GetAppResponseDataType. -const ( - GETAPPRESPONSEDATATYPE_APPDEFINITIONS GetAppResponseDataType = "appDefinitions" -) - -var allowedGetAppResponseDataTypeEnumValues = []GetAppResponseDataType{ - GETAPPRESPONSEDATATYPE_APPDEFINITIONS, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *GetAppResponseDataType) GetAllowedValues() []GetAppResponseDataType { - return allowedGetAppResponseDataTypeEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *GetAppResponseDataType) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = GetAppResponseDataType(value) - return nil -} - -// NewGetAppResponseDataTypeFromValue returns a pointer to a valid GetAppResponseDataType -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewGetAppResponseDataTypeFromValue(v string) (*GetAppResponseDataType, error) { - ev := GetAppResponseDataType(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for GetAppResponseDataType: valid values are %v", v, allowedGetAppResponseDataTypeEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v GetAppResponseDataType) IsValid() bool { - for _, existing := range allowedGetAppResponseDataTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to GetAppResponseDataType value. -func (v GetAppResponseDataType) Ptr() *GetAppResponseDataType { - return &v -} diff --git a/api/datadogV2/model_input_schema_data.go b/api/datadogV2/model_input_schema_data.go deleted file mode 100644 index f970df66849..00000000000 --- a/api/datadogV2/model_input_schema_data.go +++ /dev/null @@ -1,189 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// InputSchemaData The definition of `InputSchemaData` object. -type InputSchemaData struct { - // The definition of `InputSchemaDataAttributes` object. - Attributes *InputSchemaDataAttributes `json:"attributes,omitempty"` - // The `data` `id`. - Id *string `json:"id,omitempty"` - // The definition of `InputSchemaDataType` object. - Type *InputSchemaDataType `json:"type,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewInputSchemaData instantiates a new InputSchemaData object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewInputSchemaData() *InputSchemaData { - this := InputSchemaData{} - var typeVar InputSchemaDataType = INPUTSCHEMADATATYPE_INPUTSCHEMA - this.Type = &typeVar - return &this -} - -// NewInputSchemaDataWithDefaults instantiates a new InputSchemaData object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewInputSchemaDataWithDefaults() *InputSchemaData { - this := InputSchemaData{} - var typeVar InputSchemaDataType = INPUTSCHEMADATATYPE_INPUTSCHEMA - this.Type = &typeVar - return &this -} - -// GetAttributes returns the Attributes field value if set, zero value otherwise. -func (o *InputSchemaData) GetAttributes() InputSchemaDataAttributes { - if o == nil || o.Attributes == nil { - var ret InputSchemaDataAttributes - return ret - } - return *o.Attributes -} - -// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InputSchemaData) GetAttributesOk() (*InputSchemaDataAttributes, bool) { - if o == nil || o.Attributes == nil { - return nil, false - } - return o.Attributes, true -} - -// HasAttributes returns a boolean if a field has been set. -func (o *InputSchemaData) HasAttributes() bool { - return o != nil && o.Attributes != nil -} - -// SetAttributes gets a reference to the given InputSchemaDataAttributes and assigns it to the Attributes field. -func (o *InputSchemaData) SetAttributes(v InputSchemaDataAttributes) { - o.Attributes = &v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *InputSchemaData) GetId() string { - if o == nil || o.Id == nil { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InputSchemaData) GetIdOk() (*string, bool) { - if o == nil || o.Id == nil { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *InputSchemaData) HasId() bool { - return o != nil && o.Id != nil -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *InputSchemaData) SetId(v string) { - o.Id = &v -} - -// GetType returns the Type field value if set, zero value otherwise. -func (o *InputSchemaData) GetType() InputSchemaDataType { - if o == nil || o.Type == nil { - var ret InputSchemaDataType - return ret - } - return *o.Type -} - -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InputSchemaData) GetTypeOk() (*InputSchemaDataType, bool) { - if o == nil || o.Type == nil { - return nil, false - } - return o.Type, true -} - -// HasType returns a boolean if a field has been set. -func (o *InputSchemaData) HasType() bool { - return o != nil && o.Type != nil -} - -// SetType gets a reference to the given InputSchemaDataType and assigns it to the Type field. -func (o *InputSchemaData) SetType(v InputSchemaDataType) { - o.Type = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o InputSchemaData) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Attributes != nil { - toSerialize["attributes"] = o.Attributes - } - if o.Id != nil { - toSerialize["id"] = o.Id - } - if o.Type != nil { - toSerialize["type"] = o.Type - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *InputSchemaData) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Attributes *InputSchemaDataAttributes `json:"attributes,omitempty"` - Id *string `json:"id,omitempty"` - Type *InputSchemaDataType `json:"type,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) - } else { - return err - } - - hasInvalidField := false - if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Attributes = all.Attributes - o.Id = all.Id - if all.Type != nil && !all.Type.IsValid() { - hasInvalidField = true - } else { - o.Type = all.Type - } - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_input_schema_data_attributes.go b/api/datadogV2/model_input_schema_data_attributes.go deleted file mode 100644 index 9ef41a2872b..00000000000 --- a/api/datadogV2/model_input_schema_data_attributes.go +++ /dev/null @@ -1,102 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// InputSchemaDataAttributes The definition of `InputSchemaDataAttributes` object. -type InputSchemaDataAttributes struct { - // The `attributes` `parameters`. - Parameters []InputSchemaDataAttributesParametersItems `json:"parameters,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewInputSchemaDataAttributes instantiates a new InputSchemaDataAttributes object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewInputSchemaDataAttributes() *InputSchemaDataAttributes { - this := InputSchemaDataAttributes{} - return &this -} - -// NewInputSchemaDataAttributesWithDefaults instantiates a new InputSchemaDataAttributes object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewInputSchemaDataAttributesWithDefaults() *InputSchemaDataAttributes { - this := InputSchemaDataAttributes{} - return &this -} - -// GetParameters returns the Parameters field value if set, zero value otherwise. -func (o *InputSchemaDataAttributes) GetParameters() []InputSchemaDataAttributesParametersItems { - if o == nil || o.Parameters == nil { - var ret []InputSchemaDataAttributesParametersItems - return ret - } - return o.Parameters -} - -// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InputSchemaDataAttributes) GetParametersOk() (*[]InputSchemaDataAttributesParametersItems, bool) { - if o == nil || o.Parameters == nil { - return nil, false - } - return &o.Parameters, true -} - -// HasParameters returns a boolean if a field has been set. -func (o *InputSchemaDataAttributes) HasParameters() bool { - return o != nil && o.Parameters != nil -} - -// SetParameters gets a reference to the given []InputSchemaDataAttributesParametersItems and assigns it to the Parameters field. -func (o *InputSchemaDataAttributes) SetParameters(v []InputSchemaDataAttributesParametersItems) { - o.Parameters = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o InputSchemaDataAttributes) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Parameters != nil { - toSerialize["parameters"] = o.Parameters - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *InputSchemaDataAttributes) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Parameters []InputSchemaDataAttributesParametersItems `json:"parameters,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"parameters"}) - } else { - return err - } - o.Parameters = all.Parameters - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_input_schema_data_attributes_parameters_items.go b/api/datadogV2/model_input_schema_data_attributes_parameters_items.go deleted file mode 100644 index 7db82b0662e..00000000000 --- a/api/datadogV2/model_input_schema_data_attributes_parameters_items.go +++ /dev/null @@ -1,111 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// InputSchemaDataAttributesParametersItems The definition of `InputSchemaDataAttributesParametersItems` object. -type InputSchemaDataAttributesParametersItems struct { - // The definition of `InputSchemaDataAttributesParametersItemsData` object. - Data *InputSchemaDataAttributesParametersItemsData `json:"data,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewInputSchemaDataAttributesParametersItems instantiates a new InputSchemaDataAttributesParametersItems object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewInputSchemaDataAttributesParametersItems() *InputSchemaDataAttributesParametersItems { - this := InputSchemaDataAttributesParametersItems{} - return &this -} - -// NewInputSchemaDataAttributesParametersItemsWithDefaults instantiates a new InputSchemaDataAttributesParametersItems object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewInputSchemaDataAttributesParametersItemsWithDefaults() *InputSchemaDataAttributesParametersItems { - this := InputSchemaDataAttributesParametersItems{} - return &this -} - -// GetData returns the Data field value if set, zero value otherwise. -func (o *InputSchemaDataAttributesParametersItems) GetData() InputSchemaDataAttributesParametersItemsData { - if o == nil || o.Data == nil { - var ret InputSchemaDataAttributesParametersItemsData - return ret - } - return *o.Data -} - -// GetDataOk returns a tuple with the Data field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InputSchemaDataAttributesParametersItems) GetDataOk() (*InputSchemaDataAttributesParametersItemsData, bool) { - if o == nil || o.Data == nil { - return nil, false - } - return o.Data, true -} - -// HasData returns a boolean if a field has been set. -func (o *InputSchemaDataAttributesParametersItems) HasData() bool { - return o != nil && o.Data != nil -} - -// SetData gets a reference to the given InputSchemaDataAttributesParametersItemsData and assigns it to the Data field. -func (o *InputSchemaDataAttributesParametersItems) SetData(v InputSchemaDataAttributesParametersItemsData) { - o.Data = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o InputSchemaDataAttributesParametersItems) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Data != nil { - toSerialize["data"] = o.Data - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *InputSchemaDataAttributesParametersItems) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Data *InputSchemaDataAttributesParametersItemsData `json:"data,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"data"}) - } else { - return err - } - - hasInvalidField := false - if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Data = all.Data - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_input_schema_data_attributes_parameters_items_data.go b/api/datadogV2/model_input_schema_data_attributes_parameters_items_data.go deleted file mode 100644 index 7528f20dd7a..00000000000 --- a/api/datadogV2/model_input_schema_data_attributes_parameters_items_data.go +++ /dev/null @@ -1,111 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// InputSchemaDataAttributesParametersItemsData The definition of `InputSchemaDataAttributesParametersItemsData` object. -type InputSchemaDataAttributesParametersItemsData struct { - // The definition of `InputSchemaDataAttributesParametersItemsDataAttributes` object. - Attributes *InputSchemaDataAttributesParametersItemsDataAttributes `json:"attributes,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewInputSchemaDataAttributesParametersItemsData instantiates a new InputSchemaDataAttributesParametersItemsData object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewInputSchemaDataAttributesParametersItemsData() *InputSchemaDataAttributesParametersItemsData { - this := InputSchemaDataAttributesParametersItemsData{} - return &this -} - -// NewInputSchemaDataAttributesParametersItemsDataWithDefaults instantiates a new InputSchemaDataAttributesParametersItemsData object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewInputSchemaDataAttributesParametersItemsDataWithDefaults() *InputSchemaDataAttributesParametersItemsData { - this := InputSchemaDataAttributesParametersItemsData{} - return &this -} - -// GetAttributes returns the Attributes field value if set, zero value otherwise. -func (o *InputSchemaDataAttributesParametersItemsData) GetAttributes() InputSchemaDataAttributesParametersItemsDataAttributes { - if o == nil || o.Attributes == nil { - var ret InputSchemaDataAttributesParametersItemsDataAttributes - return ret - } - return *o.Attributes -} - -// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InputSchemaDataAttributesParametersItemsData) GetAttributesOk() (*InputSchemaDataAttributesParametersItemsDataAttributes, bool) { - if o == nil || o.Attributes == nil { - return nil, false - } - return o.Attributes, true -} - -// HasAttributes returns a boolean if a field has been set. -func (o *InputSchemaDataAttributesParametersItemsData) HasAttributes() bool { - return o != nil && o.Attributes != nil -} - -// SetAttributes gets a reference to the given InputSchemaDataAttributesParametersItemsDataAttributes and assigns it to the Attributes field. -func (o *InputSchemaDataAttributesParametersItemsData) SetAttributes(v InputSchemaDataAttributesParametersItemsDataAttributes) { - o.Attributes = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o InputSchemaDataAttributesParametersItemsData) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Attributes != nil { - toSerialize["attributes"] = o.Attributes - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *InputSchemaDataAttributesParametersItemsData) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Attributes *InputSchemaDataAttributesParametersItemsDataAttributes `json:"attributes,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"attributes"}) - } else { - return err - } - - hasInvalidField := false - if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Attributes = all.Attributes - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_input_schema_data_attributes_parameters_items_data_attributes.go b/api/datadogV2/model_input_schema_data_attributes_parameters_items_data_attributes.go deleted file mode 100644 index d65dbc3734c..00000000000 --- a/api/datadogV2/model_input_schema_data_attributes_parameters_items_data_attributes.go +++ /dev/null @@ -1,277 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// InputSchemaDataAttributesParametersItemsDataAttributes The definition of `InputSchemaDataAttributesParametersItemsDataAttributes` object. -type InputSchemaDataAttributesParametersItemsDataAttributes struct { - // The `attributes` `defaultValue`. - DefaultValue interface{} `json:"defaultValue,omitempty"` - // The `attributes` `description`. - Description *string `json:"description,omitempty"` - // The `attributes` `enum`. - Enum []string `json:"enum,omitempty"` - // The `attributes` `label`. - Label *string `json:"label,omitempty"` - // The `attributes` `name`. - Name *string `json:"name,omitempty"` - // The `attributes` `type`. - Type *string `json:"type,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewInputSchemaDataAttributesParametersItemsDataAttributes instantiates a new InputSchemaDataAttributesParametersItemsDataAttributes object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewInputSchemaDataAttributesParametersItemsDataAttributes() *InputSchemaDataAttributesParametersItemsDataAttributes { - this := InputSchemaDataAttributesParametersItemsDataAttributes{} - return &this -} - -// NewInputSchemaDataAttributesParametersItemsDataAttributesWithDefaults instantiates a new InputSchemaDataAttributesParametersItemsDataAttributes object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewInputSchemaDataAttributesParametersItemsDataAttributesWithDefaults() *InputSchemaDataAttributesParametersItemsDataAttributes { - this := InputSchemaDataAttributesParametersItemsDataAttributes{} - return &this -} - -// GetDefaultValue returns the DefaultValue field value if set, zero value otherwise. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetDefaultValue() interface{} { - if o == nil || o.DefaultValue == nil { - var ret interface{} - return ret - } - return o.DefaultValue -} - -// GetDefaultValueOk returns a tuple with the DefaultValue field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetDefaultValueOk() (*interface{}, bool) { - if o == nil || o.DefaultValue == nil { - return nil, false - } - return &o.DefaultValue, true -} - -// HasDefaultValue returns a boolean if a field has been set. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) HasDefaultValue() bool { - return o != nil && o.DefaultValue != nil -} - -// SetDefaultValue gets a reference to the given interface{} and assigns it to the DefaultValue field. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) SetDefaultValue(v interface{}) { - o.DefaultValue = v -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetDescription() string { - if o == nil || o.Description == nil { - var ret string - return ret - } - return *o.Description -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) HasDescription() bool { - return o != nil && o.Description != nil -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) SetDescription(v string) { - o.Description = &v -} - -// GetEnum returns the Enum field value if set, zero value otherwise. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetEnum() []string { - if o == nil || o.Enum == nil { - var ret []string - return ret - } - return o.Enum -} - -// GetEnumOk returns a tuple with the Enum field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetEnumOk() (*[]string, bool) { - if o == nil || o.Enum == nil { - return nil, false - } - return &o.Enum, true -} - -// HasEnum returns a boolean if a field has been set. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) HasEnum() bool { - return o != nil && o.Enum != nil -} - -// SetEnum gets a reference to the given []string and assigns it to the Enum field. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) SetEnum(v []string) { - o.Enum = v -} - -// GetLabel returns the Label field value if set, zero value otherwise. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetLabel() string { - if o == nil || o.Label == nil { - var ret string - return ret - } - return *o.Label -} - -// GetLabelOk returns a tuple with the Label field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetLabelOk() (*string, bool) { - if o == nil || o.Label == nil { - return nil, false - } - return o.Label, true -} - -// HasLabel returns a boolean if a field has been set. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) HasLabel() bool { - return o != nil && o.Label != nil -} - -// SetLabel gets a reference to the given string and assigns it to the Label field. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) SetLabel(v string) { - o.Label = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetName() string { - if o == nil || o.Name == nil { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) HasName() bool { - return o != nil && o.Name != nil -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) SetName(v string) { - o.Name = &v -} - -// GetType returns the Type field value if set, zero value otherwise. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetType() string { - if o == nil || o.Type == nil { - var ret string - return ret - } - return *o.Type -} - -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetTypeOk() (*string, bool) { - if o == nil || o.Type == nil { - return nil, false - } - return o.Type, true -} - -// HasType returns a boolean if a field has been set. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) HasType() bool { - return o != nil && o.Type != nil -} - -// SetType gets a reference to the given string and assigns it to the Type field. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) SetType(v string) { - o.Type = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o InputSchemaDataAttributesParametersItemsDataAttributes) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.DefaultValue != nil { - toSerialize["defaultValue"] = o.DefaultValue - } - if o.Description != nil { - toSerialize["description"] = o.Description - } - if o.Enum != nil { - toSerialize["enum"] = o.Enum - } - if o.Label != nil { - toSerialize["label"] = o.Label - } - if o.Name != nil { - toSerialize["name"] = o.Name - } - if o.Type != nil { - toSerialize["type"] = o.Type - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *InputSchemaDataAttributesParametersItemsDataAttributes) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - DefaultValue interface{} `json:"defaultValue,omitempty"` - Description *string `json:"description,omitempty"` - Enum []string `json:"enum,omitempty"` - Label *string `json:"label,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"defaultValue", "description", "enum", "label", "name", "type"}) - } else { - return err - } - o.DefaultValue = all.DefaultValue - o.Description = all.Description - o.Enum = all.Enum - o.Label = all.Label - o.Name = all.Name - o.Type = all.Type - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_input_schema_data_type.go b/api/datadogV2/model_input_schema_data_type.go deleted file mode 100644 index 273fecbcf45..00000000000 --- a/api/datadogV2/model_input_schema_data_type.go +++ /dev/null @@ -1,64 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// InputSchemaDataType The definition of `InputSchemaDataType` object. -type InputSchemaDataType string - -// List of InputSchemaDataType. -const ( - INPUTSCHEMADATATYPE_INPUTSCHEMA InputSchemaDataType = "inputSchema" -) - -var allowedInputSchemaDataTypeEnumValues = []InputSchemaDataType{ - INPUTSCHEMADATATYPE_INPUTSCHEMA, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *InputSchemaDataType) GetAllowedValues() []InputSchemaDataType { - return allowedInputSchemaDataTypeEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *InputSchemaDataType) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = InputSchemaDataType(value) - return nil -} - -// NewInputSchemaDataTypeFromValue returns a pointer to a valid InputSchemaDataType -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewInputSchemaDataTypeFromValue(v string) (*InputSchemaDataType, error) { - ev := InputSchemaDataType(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for InputSchemaDataType: valid values are %v", v, allowedInputSchemaDataTypeEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v InputSchemaDataType) IsValid() bool { - for _, existing := range allowedInputSchemaDataTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to InputSchemaDataType value. -func (v InputSchemaDataType) Ptr() *InputSchemaDataType { - return &v -} diff --git a/api/datadogV2/model_list_apps_response.go b/api/datadogV2/model_list_apps_response.go index 1f2cf51e53d..ce16fe5ce5b 100644 --- a/api/datadogV2/model_list_apps_response.go +++ b/api/datadogV2/model_list_apps_response.go @@ -8,13 +8,13 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// ListAppsResponse The definition of `ListAppsResponse` object. +// ListAppsResponse A paginated list of apps matching the specified filters and sorting. type ListAppsResponse struct { - // The `ListAppsResponse` `data`. + // An array of app definitions. Data []ListAppsResponseDataItems `json:"data,omitempty"` - // The `ListAppsResponse` `included`. - Included []DeploymentIncluded `json:"included,omitempty"` - // The definition of `ListAppsResponseMeta` object. + // Data on the version of the app that was published. + Included []Deployment `json:"included,omitempty"` + // Pagination metadata. Meta *ListAppsResponseMeta `json:"meta,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` @@ -67,9 +67,9 @@ func (o *ListAppsResponse) SetData(v []ListAppsResponseDataItems) { } // GetIncluded returns the Included field value if set, zero value otherwise. -func (o *ListAppsResponse) GetIncluded() []DeploymentIncluded { +func (o *ListAppsResponse) GetIncluded() []Deployment { if o == nil || o.Included == nil { - var ret []DeploymentIncluded + var ret []Deployment return ret } return o.Included @@ -77,7 +77,7 @@ func (o *ListAppsResponse) GetIncluded() []DeploymentIncluded { // GetIncludedOk returns a tuple with the Included field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListAppsResponse) GetIncludedOk() (*[]DeploymentIncluded, bool) { +func (o *ListAppsResponse) GetIncludedOk() (*[]Deployment, bool) { if o == nil || o.Included == nil { return nil, false } @@ -89,8 +89,8 @@ func (o *ListAppsResponse) HasIncluded() bool { return o != nil && o.Included != nil } -// SetIncluded gets a reference to the given []DeploymentIncluded and assigns it to the Included field. -func (o *ListAppsResponse) SetIncluded(v []DeploymentIncluded) { +// SetIncluded gets a reference to the given []Deployment and assigns it to the Included field. +func (o *ListAppsResponse) SetIncluded(v []Deployment) { o.Included = v } @@ -148,7 +148,7 @@ func (o ListAppsResponse) MarshalJSON() ([]byte, error) { func (o *ListAppsResponse) UnmarshalJSON(bytes []byte) (err error) { all := struct { Data []ListAppsResponseDataItems `json:"data,omitempty"` - Included []DeploymentIncluded `json:"included,omitempty"` + Included []Deployment `json:"included,omitempty"` Meta *ListAppsResponseMeta `json:"meta,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { diff --git a/api/datadogV2/model_list_apps_response_data_items.go b/api/datadogV2/model_list_apps_response_data_items.go index dd1078b6625..2d7dada374b 100644 --- a/api/datadogV2/model_list_apps_response_data_items.go +++ b/api/datadogV2/model_list_apps_response_data_items.go @@ -7,21 +7,23 @@ package datadogV2 import ( "fmt" + "github.com/google/uuid" + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// ListAppsResponseDataItems The definition of `ListAppsResponseDataItems` object. +// ListAppsResponseDataItems An app definition object. This contains only basic information about the app such as ID, name, and tags. type ListAppsResponseDataItems struct { - // The definition of `ListAppsResponseDataItemsAttributes` object. + // Basic information about the app such as name, description, and tags. Attributes ListAppsResponseDataItemsAttributes `json:"attributes"` - // The `items` `id`. - Id string `json:"id"` - // The definition of `AppMeta` object. + // The ID of the app. + Id uuid.UUID `json:"id"` + // Metadata of an app. Meta *AppMeta `json:"meta,omitempty"` - // The definition of `ListAppsResponseDataItemsRelationships` object. + // The app's publication information. Relationships *ListAppsResponseDataItemsRelationships `json:"relationships,omitempty"` - // The definition of `ListAppsResponseDataItemsType` object. - Type ListAppsResponseDataItemsType `json:"type"` + // The app definition type. + Type AppDefinitionType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -31,7 +33,7 @@ type ListAppsResponseDataItems struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewListAppsResponseDataItems(attributes ListAppsResponseDataItemsAttributes, id string, typeVar ListAppsResponseDataItemsType) *ListAppsResponseDataItems { +func NewListAppsResponseDataItems(attributes ListAppsResponseDataItemsAttributes, id uuid.UUID, typeVar AppDefinitionType) *ListAppsResponseDataItems { this := ListAppsResponseDataItems{} this.Attributes = attributes this.Id = id @@ -44,7 +46,7 @@ func NewListAppsResponseDataItems(attributes ListAppsResponseDataItemsAttributes // but it doesn't guarantee that properties required by API are set. func NewListAppsResponseDataItemsWithDefaults() *ListAppsResponseDataItems { this := ListAppsResponseDataItems{} - var typeVar ListAppsResponseDataItemsType = LISTAPPSRESPONSEDATAITEMSTYPE_APPDEFINITIONS + var typeVar AppDefinitionType = APPDEFINITIONTYPE_APPDEFINITIONS this.Type = typeVar return &this } @@ -73,9 +75,9 @@ func (o *ListAppsResponseDataItems) SetAttributes(v ListAppsResponseDataItemsAtt } // GetId returns the Id field value. -func (o *ListAppsResponseDataItems) GetId() string { +func (o *ListAppsResponseDataItems) GetId() uuid.UUID { if o == nil { - var ret string + var ret uuid.UUID return ret } return o.Id @@ -83,7 +85,7 @@ func (o *ListAppsResponseDataItems) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *ListAppsResponseDataItems) GetIdOk() (*string, bool) { +func (o *ListAppsResponseDataItems) GetIdOk() (*uuid.UUID, bool) { if o == nil { return nil, false } @@ -91,7 +93,7 @@ func (o *ListAppsResponseDataItems) GetIdOk() (*string, bool) { } // SetId sets field value. -func (o *ListAppsResponseDataItems) SetId(v string) { +func (o *ListAppsResponseDataItems) SetId(v uuid.UUID) { o.Id = v } @@ -152,9 +154,9 @@ func (o *ListAppsResponseDataItems) SetRelationships(v ListAppsResponseDataItems } // GetType returns the Type field value. -func (o *ListAppsResponseDataItems) GetType() ListAppsResponseDataItemsType { +func (o *ListAppsResponseDataItems) GetType() AppDefinitionType { if o == nil { - var ret ListAppsResponseDataItemsType + var ret AppDefinitionType return ret } return o.Type @@ -162,7 +164,7 @@ func (o *ListAppsResponseDataItems) GetType() ListAppsResponseDataItemsType { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *ListAppsResponseDataItems) GetTypeOk() (*ListAppsResponseDataItemsType, bool) { +func (o *ListAppsResponseDataItems) GetTypeOk() (*AppDefinitionType, bool) { if o == nil { return nil, false } @@ -170,7 +172,7 @@ func (o *ListAppsResponseDataItems) GetTypeOk() (*ListAppsResponseDataItemsType, } // SetType sets field value. -func (o *ListAppsResponseDataItems) SetType(v ListAppsResponseDataItemsType) { +func (o *ListAppsResponseDataItems) SetType(v AppDefinitionType) { o.Type = v } @@ -200,10 +202,10 @@ func (o ListAppsResponseDataItems) MarshalJSON() ([]byte, error) { func (o *ListAppsResponseDataItems) UnmarshalJSON(bytes []byte) (err error) { all := struct { Attributes *ListAppsResponseDataItemsAttributes `json:"attributes"` - Id *string `json:"id"` + Id *uuid.UUID `json:"id"` Meta *AppMeta `json:"meta,omitempty"` Relationships *ListAppsResponseDataItemsRelationships `json:"relationships,omitempty"` - Type *ListAppsResponseDataItemsType `json:"type"` + Type *AppDefinitionType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_list_apps_response_data_items_attributes.go b/api/datadogV2/model_list_apps_response_data_items_attributes.go index a7edcbe6ff0..83a9c9d3c5a 100644 --- a/api/datadogV2/model_list_apps_response_data_items_attributes.go +++ b/api/datadogV2/model_list_apps_response_data_items_attributes.go @@ -8,17 +8,17 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// ListAppsResponseDataItemsAttributes The definition of `ListAppsResponseDataItemsAttributes` object. +// ListAppsResponseDataItemsAttributes Basic information about the app such as name, description, and tags. type ListAppsResponseDataItemsAttributes struct { - // The `attributes` `description`. + // A human-readable description for the app. Description *string `json:"description,omitempty"` - // The `attributes` `favorite`. + // Whether the app is marked as a favorite by the current user. Favorite *bool `json:"favorite,omitempty"` - // The `attributes` `name`. + // The name of the app. Name *string `json:"name,omitempty"` - // The `attributes` `selfService`. + // Whether the app is enabled for use in the Datadog self-service hub. SelfService *bool `json:"selfService,omitempty"` - // The `attributes` `tags`. + // A list of tags for the app, which can be used to filter apps. Tags []string `json:"tags,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_list_apps_response_data_items_relationships.go b/api/datadogV2/model_list_apps_response_data_items_relationships.go index 8ceabf1cc8a..411ef9108bb 100644 --- a/api/datadogV2/model_list_apps_response_data_items_relationships.go +++ b/api/datadogV2/model_list_apps_response_data_items_relationships.go @@ -8,9 +8,9 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// ListAppsResponseDataItemsRelationships The definition of `ListAppsResponseDataItemsRelationships` object. +// ListAppsResponseDataItemsRelationships The app's publication information. type ListAppsResponseDataItemsRelationships struct { - // The definition of `DeploymentRelationship` object. + // Information pointing to the app's publication status. Deployment *DeploymentRelationship `json:"deployment,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_list_apps_response_data_items_type.go b/api/datadogV2/model_list_apps_response_data_items_type.go deleted file mode 100644 index 6f157cea851..00000000000 --- a/api/datadogV2/model_list_apps_response_data_items_type.go +++ /dev/null @@ -1,64 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// ListAppsResponseDataItemsType The definition of `ListAppsResponseDataItemsType` object. -type ListAppsResponseDataItemsType string - -// List of ListAppsResponseDataItemsType. -const ( - LISTAPPSRESPONSEDATAITEMSTYPE_APPDEFINITIONS ListAppsResponseDataItemsType = "appDefinitions" -) - -var allowedListAppsResponseDataItemsTypeEnumValues = []ListAppsResponseDataItemsType{ - LISTAPPSRESPONSEDATAITEMSTYPE_APPDEFINITIONS, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *ListAppsResponseDataItemsType) GetAllowedValues() []ListAppsResponseDataItemsType { - return allowedListAppsResponseDataItemsTypeEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *ListAppsResponseDataItemsType) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = ListAppsResponseDataItemsType(value) - return nil -} - -// NewListAppsResponseDataItemsTypeFromValue returns a pointer to a valid ListAppsResponseDataItemsType -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewListAppsResponseDataItemsTypeFromValue(v string) (*ListAppsResponseDataItemsType, error) { - ev := ListAppsResponseDataItemsType(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for ListAppsResponseDataItemsType: valid values are %v", v, allowedListAppsResponseDataItemsTypeEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v ListAppsResponseDataItemsType) IsValid() bool { - for _, existing := range allowedListAppsResponseDataItemsTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ListAppsResponseDataItemsType value. -func (v ListAppsResponseDataItemsType) Ptr() *ListAppsResponseDataItemsType { - return &v -} diff --git a/api/datadogV2/model_list_apps_response_meta.go b/api/datadogV2/model_list_apps_response_meta.go index ea9d49594a5..03724d6e6a2 100644 --- a/api/datadogV2/model_list_apps_response_meta.go +++ b/api/datadogV2/model_list_apps_response_meta.go @@ -8,9 +8,9 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// ListAppsResponseMeta The definition of `ListAppsResponseMeta` object. +// ListAppsResponseMeta Pagination metadata. type ListAppsResponseMeta struct { - // The definition of `ListAppsResponseMetaPage` object. + // Information on the total number of apps, to be used for pagination. Page *ListAppsResponseMetaPage `json:"page,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_list_apps_response_meta_page.go b/api/datadogV2/model_list_apps_response_meta_page.go index 138d720fdf8..31eaf5574a5 100644 --- a/api/datadogV2/model_list_apps_response_meta_page.go +++ b/api/datadogV2/model_list_apps_response_meta_page.go @@ -8,11 +8,11 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// ListAppsResponseMetaPage The definition of `ListAppsResponseMetaPage` object. +// ListAppsResponseMetaPage Information on the total number of apps, to be used for pagination. type ListAppsResponseMetaPage struct { - // The `page` `totalCount`. + // The total number of apps under the Datadog organization, disregarding any filters applied. TotalCount *int64 `json:"totalCount,omitempty"` - // The `page` `totalFilteredCount`. + // The total number of apps that match the specified filters. TotalFilteredCount *int64 `json:"totalFilteredCount,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_script.go b/api/datadogV2/model_publish_app_response.go similarity index 71% rename from api/datadogV2/model_script.go rename to api/datadogV2/model_publish_app_response.go index db9fd9f05f9..3881238fb76 100644 --- a/api/datadogV2/model_script.go +++ b/api/datadogV2/model_publish_app_response.go @@ -8,36 +8,36 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// Script The definition of `Script` object. -type Script struct { - // The definition of `ScriptData` object. - Data *ScriptData `json:"data,omitempty"` +// PublishAppResponse The response object after an app has been successfully published. +type PublishAppResponse struct { + // The version of the app that was published. + Data *Deployment `json:"data,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } -// NewScript instantiates a new Script object. +// NewPublishAppResponse instantiates a new PublishAppResponse object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewScript() *Script { - this := Script{} +func NewPublishAppResponse() *PublishAppResponse { + this := PublishAppResponse{} return &this } -// NewScriptWithDefaults instantiates a new Script object. +// NewPublishAppResponseWithDefaults instantiates a new PublishAppResponse object. // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set. -func NewScriptWithDefaults() *Script { - this := Script{} +func NewPublishAppResponseWithDefaults() *PublishAppResponse { + this := PublishAppResponse{} return &this } // GetData returns the Data field value if set, zero value otherwise. -func (o *Script) GetData() ScriptData { +func (o *PublishAppResponse) GetData() Deployment { if o == nil || o.Data == nil { - var ret ScriptData + var ret Deployment return ret } return *o.Data @@ -45,7 +45,7 @@ func (o *Script) GetData() ScriptData { // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Script) GetDataOk() (*ScriptData, bool) { +func (o *PublishAppResponse) GetDataOk() (*Deployment, bool) { if o == nil || o.Data == nil { return nil, false } @@ -53,17 +53,17 @@ func (o *Script) GetDataOk() (*ScriptData, bool) { } // HasData returns a boolean if a field has been set. -func (o *Script) HasData() bool { +func (o *PublishAppResponse) HasData() bool { return o != nil && o.Data != nil } -// SetData gets a reference to the given ScriptData and assigns it to the Data field. -func (o *Script) SetData(v ScriptData) { +// SetData gets a reference to the given Deployment and assigns it to the Data field. +func (o *PublishAppResponse) SetData(v Deployment) { o.Data = &v } // MarshalJSON serializes the struct using spec logic. -func (o Script) MarshalJSON() ([]byte, error) { +func (o PublishAppResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) @@ -79,9 +79,9 @@ func (o Script) MarshalJSON() ([]byte, error) { } // UnmarshalJSON deserializes the given payload. -func (o *Script) UnmarshalJSON(bytes []byte) (err error) { +func (o *PublishAppResponse) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Data *ScriptData `json:"data,omitempty"` + Data *Deployment `json:"data,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_query.go b/api/datadogV2/model_query.go index 1f2c4eb8f4a..646198d57e1 100644 --- a/api/datadogV2/model_query.go +++ b/api/datadogV2/model_query.go @@ -7,20 +7,22 @@ package datadogV2 import ( "fmt" + "github.com/google/uuid" + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// Query The definition of `Query` object. +// Query A query used by an app. This can take the form of an external action, a data transformation, or a state variable change. type Query struct { - // The `Query` `events`. + // Events to listen for downstream of the query. Events []AppBuilderEvent `json:"events,omitempty"` - // The `Query` `id`. - Id string `json:"id"` - // The `Query` `name`. + // The ID of the query. + Id uuid.UUID `json:"id"` + // The name of the query. The name must be unique within the app, and will be visible in the app editor. Name string `json:"name"` - // The `Query` `properties`. + // The properties of the query. The properties will vary depending on the query type. Properties interface{} `json:"properties,omitempty"` - // The definition of `QueryType` object. + // The query type. Type QueryType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` @@ -31,7 +33,7 @@ type Query struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewQuery(id string, name string, typeVar QueryType) *Query { +func NewQuery(id uuid.UUID, name string, typeVar QueryType) *Query { this := Query{} this.Id = id this.Name = name @@ -76,9 +78,9 @@ func (o *Query) SetEvents(v []AppBuilderEvent) { } // GetId returns the Id field value. -func (o *Query) GetId() string { +func (o *Query) GetId() uuid.UUID { if o == nil { - var ret string + var ret uuid.UUID return ret } return o.Id @@ -86,7 +88,7 @@ func (o *Query) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *Query) GetIdOk() (*string, bool) { +func (o *Query) GetIdOk() (*uuid.UUID, bool) { if o == nil { return nil, false } @@ -94,7 +96,7 @@ func (o *Query) GetIdOk() (*string, bool) { } // SetId sets field value. -func (o *Query) SetId(v string) { +func (o *Query) SetId(v uuid.UUID) { o.Id = v } @@ -198,7 +200,7 @@ func (o Query) MarshalJSON() ([]byte, error) { func (o *Query) UnmarshalJSON(bytes []byte) (err error) { all := struct { Events []AppBuilderEvent `json:"events,omitempty"` - Id *string `json:"id"` + Id *uuid.UUID `json:"id"` Name *string `json:"name"` Properties interface{} `json:"properties,omitempty"` Type *QueryType `json:"type"` diff --git a/api/datadogV2/model_query_type.go b/api/datadogV2/model_query_type.go index 53beb4bb63c..d6bf702a9eb 100644 --- a/api/datadogV2/model_query_type.go +++ b/api/datadogV2/model_query_type.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// QueryType The definition of `QueryType` object. +// QueryType The query type. type QueryType string // List of QueryType. diff --git a/api/datadogV2/model_script_data.go b/api/datadogV2/model_script_data.go deleted file mode 100644 index 1dea53d9e00..00000000000 --- a/api/datadogV2/model_script_data.go +++ /dev/null @@ -1,189 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// ScriptData The definition of `ScriptData` object. -type ScriptData struct { - // The definition of `ScriptDataAttributes` object. - Attributes *ScriptDataAttributes `json:"attributes,omitempty"` - // The `data` `id`. - Id *string `json:"id,omitempty"` - // The definition of `ScriptDataType` object. - Type *ScriptDataType `json:"type,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewScriptData instantiates a new ScriptData object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewScriptData() *ScriptData { - this := ScriptData{} - var typeVar ScriptDataType = SCRIPTDATATYPE_SCRIPTS - this.Type = &typeVar - return &this -} - -// NewScriptDataWithDefaults instantiates a new ScriptData object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewScriptDataWithDefaults() *ScriptData { - this := ScriptData{} - var typeVar ScriptDataType = SCRIPTDATATYPE_SCRIPTS - this.Type = &typeVar - return &this -} - -// GetAttributes returns the Attributes field value if set, zero value otherwise. -func (o *ScriptData) GetAttributes() ScriptDataAttributes { - if o == nil || o.Attributes == nil { - var ret ScriptDataAttributes - return ret - } - return *o.Attributes -} - -// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ScriptData) GetAttributesOk() (*ScriptDataAttributes, bool) { - if o == nil || o.Attributes == nil { - return nil, false - } - return o.Attributes, true -} - -// HasAttributes returns a boolean if a field has been set. -func (o *ScriptData) HasAttributes() bool { - return o != nil && o.Attributes != nil -} - -// SetAttributes gets a reference to the given ScriptDataAttributes and assigns it to the Attributes field. -func (o *ScriptData) SetAttributes(v ScriptDataAttributes) { - o.Attributes = &v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *ScriptData) GetId() string { - if o == nil || o.Id == nil { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ScriptData) GetIdOk() (*string, bool) { - if o == nil || o.Id == nil { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *ScriptData) HasId() bool { - return o != nil && o.Id != nil -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *ScriptData) SetId(v string) { - o.Id = &v -} - -// GetType returns the Type field value if set, zero value otherwise. -func (o *ScriptData) GetType() ScriptDataType { - if o == nil || o.Type == nil { - var ret ScriptDataType - return ret - } - return *o.Type -} - -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ScriptData) GetTypeOk() (*ScriptDataType, bool) { - if o == nil || o.Type == nil { - return nil, false - } - return o.Type, true -} - -// HasType returns a boolean if a field has been set. -func (o *ScriptData) HasType() bool { - return o != nil && o.Type != nil -} - -// SetType gets a reference to the given ScriptDataType and assigns it to the Type field. -func (o *ScriptData) SetType(v ScriptDataType) { - o.Type = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o ScriptData) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Attributes != nil { - toSerialize["attributes"] = o.Attributes - } - if o.Id != nil { - toSerialize["id"] = o.Id - } - if o.Type != nil { - toSerialize["type"] = o.Type - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *ScriptData) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Attributes *ScriptDataAttributes `json:"attributes,omitempty"` - Id *string `json:"id,omitempty"` - Type *ScriptDataType `json:"type,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) - } else { - return err - } - - hasInvalidField := false - if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Attributes = all.Attributes - o.Id = all.Id - if all.Type != nil && !all.Type.IsValid() { - hasInvalidField = true - } else { - o.Type = all.Type - } - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_script_data_attributes.go b/api/datadogV2/model_script_data_attributes.go deleted file mode 100644 index ac04b81da46..00000000000 --- a/api/datadogV2/model_script_data_attributes.go +++ /dev/null @@ -1,172 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// ScriptDataAttributes The definition of `ScriptDataAttributes` object. -type ScriptDataAttributes struct { - // The `attributes` `name`. - Name *string `json:"name,omitempty"` - // The `attributes` `src`. - Src *string `json:"src,omitempty"` - // The `attributes` `type`. - Type *string `json:"type,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewScriptDataAttributes instantiates a new ScriptDataAttributes object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewScriptDataAttributes() *ScriptDataAttributes { - this := ScriptDataAttributes{} - return &this -} - -// NewScriptDataAttributesWithDefaults instantiates a new ScriptDataAttributes object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewScriptDataAttributesWithDefaults() *ScriptDataAttributes { - this := ScriptDataAttributes{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *ScriptDataAttributes) GetName() string { - if o == nil || o.Name == nil { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ScriptDataAttributes) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *ScriptDataAttributes) HasName() bool { - return o != nil && o.Name != nil -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *ScriptDataAttributes) SetName(v string) { - o.Name = &v -} - -// GetSrc returns the Src field value if set, zero value otherwise. -func (o *ScriptDataAttributes) GetSrc() string { - if o == nil || o.Src == nil { - var ret string - return ret - } - return *o.Src -} - -// GetSrcOk returns a tuple with the Src field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ScriptDataAttributes) GetSrcOk() (*string, bool) { - if o == nil || o.Src == nil { - return nil, false - } - return o.Src, true -} - -// HasSrc returns a boolean if a field has been set. -func (o *ScriptDataAttributes) HasSrc() bool { - return o != nil && o.Src != nil -} - -// SetSrc gets a reference to the given string and assigns it to the Src field. -func (o *ScriptDataAttributes) SetSrc(v string) { - o.Src = &v -} - -// GetType returns the Type field value if set, zero value otherwise. -func (o *ScriptDataAttributes) GetType() string { - if o == nil || o.Type == nil { - var ret string - return ret - } - return *o.Type -} - -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ScriptDataAttributes) GetTypeOk() (*string, bool) { - if o == nil || o.Type == nil { - return nil, false - } - return o.Type, true -} - -// HasType returns a boolean if a field has been set. -func (o *ScriptDataAttributes) HasType() bool { - return o != nil && o.Type != nil -} - -// SetType gets a reference to the given string and assigns it to the Type field. -func (o *ScriptDataAttributes) SetType(v string) { - o.Type = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o ScriptDataAttributes) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Name != nil { - toSerialize["name"] = o.Name - } - if o.Src != nil { - toSerialize["src"] = o.Src - } - if o.Type != nil { - toSerialize["type"] = o.Type - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *ScriptDataAttributes) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Name *string `json:"name,omitempty"` - Src *string `json:"src,omitempty"` - Type *string `json:"type,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"name", "src", "type"}) - } else { - return err - } - o.Name = all.Name - o.Src = all.Src - o.Type = all.Type - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_script_data_type.go b/api/datadogV2/model_script_data_type.go deleted file mode 100644 index 9820d9fc26e..00000000000 --- a/api/datadogV2/model_script_data_type.go +++ /dev/null @@ -1,64 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// ScriptDataType The definition of `ScriptDataType` object. -type ScriptDataType string - -// List of ScriptDataType. -const ( - SCRIPTDATATYPE_SCRIPTS ScriptDataType = "scripts" -) - -var allowedScriptDataTypeEnumValues = []ScriptDataType{ - SCRIPTDATATYPE_SCRIPTS, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *ScriptDataType) GetAllowedValues() []ScriptDataType { - return allowedScriptDataTypeEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *ScriptDataType) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = ScriptDataType(value) - return nil -} - -// NewScriptDataTypeFromValue returns a pointer to a valid ScriptDataType -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewScriptDataTypeFromValue(v string) (*ScriptDataType, error) { - ev := ScriptDataType(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for ScriptDataType: valid values are %v", v, allowedScriptDataTypeEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v ScriptDataType) IsValid() bool { - for _, existing := range allowedScriptDataTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ScriptDataType value. -func (v ScriptDataType) Ptr() *ScriptDataType { - return &v -} diff --git a/api/datadogV2/model_input_schema.go b/api/datadogV2/model_unpublish_app_response.go similarity index 70% rename from api/datadogV2/model_input_schema.go rename to api/datadogV2/model_unpublish_app_response.go index 18b108661ed..f094858cda1 100644 --- a/api/datadogV2/model_input_schema.go +++ b/api/datadogV2/model_unpublish_app_response.go @@ -8,36 +8,36 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// InputSchema The definition of `InputSchema` object. -type InputSchema struct { - // The definition of `InputSchemaData` object. - Data *InputSchemaData `json:"data,omitempty"` +// UnpublishAppResponse The response object after an app has been successfully unpublished. +type UnpublishAppResponse struct { + // The version of the app that was published. + Data *Deployment `json:"data,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } -// NewInputSchema instantiates a new InputSchema object. +// NewUnpublishAppResponse instantiates a new UnpublishAppResponse object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewInputSchema() *InputSchema { - this := InputSchema{} +func NewUnpublishAppResponse() *UnpublishAppResponse { + this := UnpublishAppResponse{} return &this } -// NewInputSchemaWithDefaults instantiates a new InputSchema object. +// NewUnpublishAppResponseWithDefaults instantiates a new UnpublishAppResponse object. // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set. -func NewInputSchemaWithDefaults() *InputSchema { - this := InputSchema{} +func NewUnpublishAppResponseWithDefaults() *UnpublishAppResponse { + this := UnpublishAppResponse{} return &this } // GetData returns the Data field value if set, zero value otherwise. -func (o *InputSchema) GetData() InputSchemaData { +func (o *UnpublishAppResponse) GetData() Deployment { if o == nil || o.Data == nil { - var ret InputSchemaData + var ret Deployment return ret } return *o.Data @@ -45,7 +45,7 @@ func (o *InputSchema) GetData() InputSchemaData { // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *InputSchema) GetDataOk() (*InputSchemaData, bool) { +func (o *UnpublishAppResponse) GetDataOk() (*Deployment, bool) { if o == nil || o.Data == nil { return nil, false } @@ -53,17 +53,17 @@ func (o *InputSchema) GetDataOk() (*InputSchemaData, bool) { } // HasData returns a boolean if a field has been set. -func (o *InputSchema) HasData() bool { +func (o *UnpublishAppResponse) HasData() bool { return o != nil && o.Data != nil } -// SetData gets a reference to the given InputSchemaData and assigns it to the Data field. -func (o *InputSchema) SetData(v InputSchemaData) { +// SetData gets a reference to the given Deployment and assigns it to the Data field. +func (o *UnpublishAppResponse) SetData(v Deployment) { o.Data = &v } // MarshalJSON serializes the struct using spec logic. -func (o InputSchema) MarshalJSON() ([]byte, error) { +func (o UnpublishAppResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) @@ -79,9 +79,9 @@ func (o InputSchema) MarshalJSON() ([]byte, error) { } // UnmarshalJSON deserializes the given payload. -func (o *InputSchema) UnmarshalJSON(bytes []byte) (err error) { +func (o *UnpublishAppResponse) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Data *InputSchemaData `json:"data,omitempty"` + Data *Deployment `json:"data,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_update_app_request.go b/api/datadogV2/model_update_app_request.go index 0b215d43b9f..a50bb4ac5df 100644 --- a/api/datadogV2/model_update_app_request.go +++ b/api/datadogV2/model_update_app_request.go @@ -8,9 +8,9 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// UpdateAppRequest The definition of `UpdateAppRequest` object. +// UpdateAppRequest A request object for updating an existing app. type UpdateAppRequest struct { - // The definition of `UpdateAppRequestData` object. + // The data object containing the new app definition. Any fields not included in the request remain unchanged. Data *UpdateAppRequestData `json:"data,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_update_app_request_data.go b/api/datadogV2/model_update_app_request_data.go index 70216e58329..3a028c3cea6 100644 --- a/api/datadogV2/model_update_app_request_data.go +++ b/api/datadogV2/model_update_app_request_data.go @@ -7,17 +7,19 @@ package datadogV2 import ( "fmt" + "github.com/google/uuid" + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// UpdateAppRequestData The definition of `UpdateAppRequestData` object. +// UpdateAppRequestData The data object containing the new app definition. Any fields not included in the request remain unchanged. type UpdateAppRequestData struct { - // The definition of `UpdateAppRequestDataAttributes` object. + // App definition attributes to be updated, such as name, description, and components. Attributes *UpdateAppRequestDataAttributes `json:"attributes,omitempty"` - // The `data` `id`. - Id *string `json:"id,omitempty"` - // The definition of `UpdateAppRequestDataType` object. - Type UpdateAppRequestDataType `json:"type"` + // The ID of the app to update. The app ID must match the ID in the URL path. + Id *uuid.UUID `json:"id,omitempty"` + // The app definition type. + Type AppDefinitionType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -27,7 +29,7 @@ type UpdateAppRequestData struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewUpdateAppRequestData(typeVar UpdateAppRequestDataType) *UpdateAppRequestData { +func NewUpdateAppRequestData(typeVar AppDefinitionType) *UpdateAppRequestData { this := UpdateAppRequestData{} this.Type = typeVar return &this @@ -38,7 +40,7 @@ func NewUpdateAppRequestData(typeVar UpdateAppRequestDataType) *UpdateAppRequest // but it doesn't guarantee that properties required by API are set. func NewUpdateAppRequestDataWithDefaults() *UpdateAppRequestData { this := UpdateAppRequestData{} - var typeVar UpdateAppRequestDataType = UPDATEAPPREQUESTDATATYPE_APPDEFINITIONS + var typeVar AppDefinitionType = APPDEFINITIONTYPE_APPDEFINITIONS this.Type = typeVar return &this } @@ -72,9 +74,9 @@ func (o *UpdateAppRequestData) SetAttributes(v UpdateAppRequestDataAttributes) { } // GetId returns the Id field value if set, zero value otherwise. -func (o *UpdateAppRequestData) GetId() string { +func (o *UpdateAppRequestData) GetId() uuid.UUID { if o == nil || o.Id == nil { - var ret string + var ret uuid.UUID return ret } return *o.Id @@ -82,7 +84,7 @@ func (o *UpdateAppRequestData) GetId() string { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateAppRequestData) GetIdOk() (*string, bool) { +func (o *UpdateAppRequestData) GetIdOk() (*uuid.UUID, bool) { if o == nil || o.Id == nil { return nil, false } @@ -94,15 +96,15 @@ func (o *UpdateAppRequestData) HasId() bool { return o != nil && o.Id != nil } -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *UpdateAppRequestData) SetId(v string) { +// SetId gets a reference to the given uuid.UUID and assigns it to the Id field. +func (o *UpdateAppRequestData) SetId(v uuid.UUID) { o.Id = &v } // GetType returns the Type field value. -func (o *UpdateAppRequestData) GetType() UpdateAppRequestDataType { +func (o *UpdateAppRequestData) GetType() AppDefinitionType { if o == nil { - var ret UpdateAppRequestDataType + var ret AppDefinitionType return ret } return o.Type @@ -110,7 +112,7 @@ func (o *UpdateAppRequestData) GetType() UpdateAppRequestDataType { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *UpdateAppRequestData) GetTypeOk() (*UpdateAppRequestDataType, bool) { +func (o *UpdateAppRequestData) GetTypeOk() (*AppDefinitionType, bool) { if o == nil { return nil, false } @@ -118,7 +120,7 @@ func (o *UpdateAppRequestData) GetTypeOk() (*UpdateAppRequestDataType, bool) { } // SetType sets field value. -func (o *UpdateAppRequestData) SetType(v UpdateAppRequestDataType) { +func (o *UpdateAppRequestData) SetType(v AppDefinitionType) { o.Type = v } @@ -146,8 +148,8 @@ func (o UpdateAppRequestData) MarshalJSON() ([]byte, error) { func (o *UpdateAppRequestData) UnmarshalJSON(bytes []byte) (err error) { all := struct { Attributes *UpdateAppRequestDataAttributes `json:"attributes,omitempty"` - Id *string `json:"id,omitempty"` - Type *UpdateAppRequestDataType `json:"type"` + Id *uuid.UUID `json:"id,omitempty"` + Type *AppDefinitionType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_update_app_request_data_attributes.go b/api/datadogV2/model_update_app_request_data_attributes.go index 32787644d78..4f4f8dc5508 100644 --- a/api/datadogV2/model_update_app_request_data_attributes.go +++ b/api/datadogV2/model_update_app_request_data_attributes.go @@ -8,23 +8,19 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// UpdateAppRequestDataAttributes The definition of `UpdateAppRequestDataAttributes` object. +// UpdateAppRequestDataAttributes App definition attributes to be updated, such as name, description, and components. type UpdateAppRequestDataAttributes struct { - // The `attributes` `components`. + // The new UI components that make up the app. If this field is set, all existing components are replaced with the new components under this field. Components []ComponentGrid `json:"components,omitempty"` - // The `attributes` `description`. + // The new human-readable description for the app. Description *string `json:"description,omitempty"` - // The `attributes` `embeddedQueries`. + // The new array of queries, such as external actions and state variables, that the app uses. If this field is set, all existing queries are replaced with the new queries under this field. EmbeddedQueries []Query `json:"embeddedQueries,omitempty"` - // The definition of `InputSchema` object. - InputSchema *InputSchema `json:"inputSchema,omitempty"` - // The `attributes` `name`. + // The new name of the app. Name *string `json:"name,omitempty"` - // The `attributes` `rootInstanceName`. + // The new name of the root component of the app. This must be a `grid` component that contains all other components. RootInstanceName *string `json:"rootInstanceName,omitempty"` - // The `attributes` `scripts`. - Scripts []Script `json:"scripts,omitempty"` - // The `attributes` `tags`. + // The new list of tags for the app, which can be used to filter apps. If this field is set, any existing tags not included in the request will be removed. Tags []string `json:"tags,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` @@ -132,34 +128,6 @@ func (o *UpdateAppRequestDataAttributes) SetEmbeddedQueries(v []Query) { o.EmbeddedQueries = v } -// GetInputSchema returns the InputSchema field value if set, zero value otherwise. -func (o *UpdateAppRequestDataAttributes) GetInputSchema() InputSchema { - if o == nil || o.InputSchema == nil { - var ret InputSchema - return ret - } - return *o.InputSchema -} - -// GetInputSchemaOk returns a tuple with the InputSchema field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateAppRequestDataAttributes) GetInputSchemaOk() (*InputSchema, bool) { - if o == nil || o.InputSchema == nil { - return nil, false - } - return o.InputSchema, true -} - -// HasInputSchema returns a boolean if a field has been set. -func (o *UpdateAppRequestDataAttributes) HasInputSchema() bool { - return o != nil && o.InputSchema != nil -} - -// SetInputSchema gets a reference to the given InputSchema and assigns it to the InputSchema field. -func (o *UpdateAppRequestDataAttributes) SetInputSchema(v InputSchema) { - o.InputSchema = &v -} - // GetName returns the Name field value if set, zero value otherwise. func (o *UpdateAppRequestDataAttributes) GetName() string { if o == nil || o.Name == nil { @@ -216,34 +184,6 @@ func (o *UpdateAppRequestDataAttributes) SetRootInstanceName(v string) { o.RootInstanceName = &v } -// GetScripts returns the Scripts field value if set, zero value otherwise. -func (o *UpdateAppRequestDataAttributes) GetScripts() []Script { - if o == nil || o.Scripts == nil { - var ret []Script - return ret - } - return o.Scripts -} - -// GetScriptsOk returns a tuple with the Scripts field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateAppRequestDataAttributes) GetScriptsOk() (*[]Script, bool) { - if o == nil || o.Scripts == nil { - return nil, false - } - return &o.Scripts, true -} - -// HasScripts returns a boolean if a field has been set. -func (o *UpdateAppRequestDataAttributes) HasScripts() bool { - return o != nil && o.Scripts != nil -} - -// SetScripts gets a reference to the given []Script and assigns it to the Scripts field. -func (o *UpdateAppRequestDataAttributes) SetScripts(v []Script) { - o.Scripts = v -} - // GetTags returns the Tags field value if set, zero value otherwise. func (o *UpdateAppRequestDataAttributes) GetTags() []string { if o == nil || o.Tags == nil { @@ -287,18 +227,12 @@ func (o UpdateAppRequestDataAttributes) MarshalJSON() ([]byte, error) { if o.EmbeddedQueries != nil { toSerialize["embeddedQueries"] = o.EmbeddedQueries } - if o.InputSchema != nil { - toSerialize["inputSchema"] = o.InputSchema - } if o.Name != nil { toSerialize["name"] = o.Name } if o.RootInstanceName != nil { toSerialize["rootInstanceName"] = o.RootInstanceName } - if o.Scripts != nil { - toSerialize["scripts"] = o.Scripts - } if o.Tags != nil { toSerialize["tags"] = o.Tags } @@ -315,10 +249,8 @@ func (o *UpdateAppRequestDataAttributes) UnmarshalJSON(bytes []byte) (err error) Components []ComponentGrid `json:"components,omitempty"` Description *string `json:"description,omitempty"` EmbeddedQueries []Query `json:"embeddedQueries,omitempty"` - InputSchema *InputSchema `json:"inputSchema,omitempty"` Name *string `json:"name,omitempty"` RootInstanceName *string `json:"rootInstanceName,omitempty"` - Scripts []Script `json:"scripts,omitempty"` Tags []string `json:"tags,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { @@ -326,31 +258,20 @@ func (o *UpdateAppRequestDataAttributes) UnmarshalJSON(bytes []byte) (err error) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"components", "description", "embeddedQueries", "inputSchema", "name", "rootInstanceName", "scripts", "tags"}) + datadog.DeleteKeys(additionalProperties, &[]string{"components", "description", "embeddedQueries", "name", "rootInstanceName", "tags"}) } else { return err } - - hasInvalidField := false o.Components = all.Components o.Description = all.Description o.EmbeddedQueries = all.EmbeddedQueries - if all.InputSchema != nil && all.InputSchema.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.InputSchema = all.InputSchema o.Name = all.Name o.RootInstanceName = all.RootInstanceName - o.Scripts = all.Scripts o.Tags = all.Tags if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties } - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - return nil } diff --git a/api/datadogV2/model_update_app_request_data_type.go b/api/datadogV2/model_update_app_request_data_type.go deleted file mode 100644 index 76a45480754..00000000000 --- a/api/datadogV2/model_update_app_request_data_type.go +++ /dev/null @@ -1,64 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// UpdateAppRequestDataType The definition of `UpdateAppRequestDataType` object. -type UpdateAppRequestDataType string - -// List of UpdateAppRequestDataType. -const ( - UPDATEAPPREQUESTDATATYPE_APPDEFINITIONS UpdateAppRequestDataType = "appDefinitions" -) - -var allowedUpdateAppRequestDataTypeEnumValues = []UpdateAppRequestDataType{ - UPDATEAPPREQUESTDATATYPE_APPDEFINITIONS, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *UpdateAppRequestDataType) GetAllowedValues() []UpdateAppRequestDataType { - return allowedUpdateAppRequestDataTypeEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *UpdateAppRequestDataType) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = UpdateAppRequestDataType(value) - return nil -} - -// NewUpdateAppRequestDataTypeFromValue returns a pointer to a valid UpdateAppRequestDataType -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewUpdateAppRequestDataTypeFromValue(v string) (*UpdateAppRequestDataType, error) { - ev := UpdateAppRequestDataType(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for UpdateAppRequestDataType: valid values are %v", v, allowedUpdateAppRequestDataTypeEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v UpdateAppRequestDataType) IsValid() bool { - for _, existing := range allowedUpdateAppRequestDataTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to UpdateAppRequestDataType value. -func (v UpdateAppRequestDataType) Ptr() *UpdateAppRequestDataType { - return &v -} diff --git a/api/datadogV2/model_update_app_response.go b/api/datadogV2/model_update_app_response.go index b3cf8e54ba3..e7e99d711ba 100644 --- a/api/datadogV2/model_update_app_response.go +++ b/api/datadogV2/model_update_app_response.go @@ -8,16 +8,16 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// UpdateAppResponse The definition of `UpdateAppResponse` object. +// UpdateAppResponse The response object after an app has been successfully updated. type UpdateAppResponse struct { - // The definition of `UpdateAppResponseData` object. + // The data object containing the updated app definition. Data *UpdateAppResponseData `json:"data,omitempty"` - // The `UpdateAppResponse` `included`. - Included []DeploymentIncluded `json:"included,omitempty"` - // The definition of `AppMeta` object. + // Data on the version of the app that was published. + Included []Deployment `json:"included,omitempty"` + // Metadata of an app. Meta *AppMeta `json:"meta,omitempty"` - // The definition of `UpdateAppResponseRelationship` object. - Relationship *UpdateAppResponseRelationship `json:"relationship,omitempty"` + // The app's publication relationship and custom connections. + Relationship *AppRelationship `json:"relationship,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -69,9 +69,9 @@ func (o *UpdateAppResponse) SetData(v UpdateAppResponseData) { } // GetIncluded returns the Included field value if set, zero value otherwise. -func (o *UpdateAppResponse) GetIncluded() []DeploymentIncluded { +func (o *UpdateAppResponse) GetIncluded() []Deployment { if o == nil || o.Included == nil { - var ret []DeploymentIncluded + var ret []Deployment return ret } return o.Included @@ -79,7 +79,7 @@ func (o *UpdateAppResponse) GetIncluded() []DeploymentIncluded { // GetIncludedOk returns a tuple with the Included field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateAppResponse) GetIncludedOk() (*[]DeploymentIncluded, bool) { +func (o *UpdateAppResponse) GetIncludedOk() (*[]Deployment, bool) { if o == nil || o.Included == nil { return nil, false } @@ -91,8 +91,8 @@ func (o *UpdateAppResponse) HasIncluded() bool { return o != nil && o.Included != nil } -// SetIncluded gets a reference to the given []DeploymentIncluded and assigns it to the Included field. -func (o *UpdateAppResponse) SetIncluded(v []DeploymentIncluded) { +// SetIncluded gets a reference to the given []Deployment and assigns it to the Included field. +func (o *UpdateAppResponse) SetIncluded(v []Deployment) { o.Included = v } @@ -125,9 +125,9 @@ func (o *UpdateAppResponse) SetMeta(v AppMeta) { } // GetRelationship returns the Relationship field value if set, zero value otherwise. -func (o *UpdateAppResponse) GetRelationship() UpdateAppResponseRelationship { +func (o *UpdateAppResponse) GetRelationship() AppRelationship { if o == nil || o.Relationship == nil { - var ret UpdateAppResponseRelationship + var ret AppRelationship return ret } return *o.Relationship @@ -135,7 +135,7 @@ func (o *UpdateAppResponse) GetRelationship() UpdateAppResponseRelationship { // GetRelationshipOk returns a tuple with the Relationship field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateAppResponse) GetRelationshipOk() (*UpdateAppResponseRelationship, bool) { +func (o *UpdateAppResponse) GetRelationshipOk() (*AppRelationship, bool) { if o == nil || o.Relationship == nil { return nil, false } @@ -147,8 +147,8 @@ func (o *UpdateAppResponse) HasRelationship() bool { return o != nil && o.Relationship != nil } -// SetRelationship gets a reference to the given UpdateAppResponseRelationship and assigns it to the Relationship field. -func (o *UpdateAppResponse) SetRelationship(v UpdateAppResponseRelationship) { +// SetRelationship gets a reference to the given AppRelationship and assigns it to the Relationship field. +func (o *UpdateAppResponse) SetRelationship(v AppRelationship) { o.Relationship = &v } @@ -180,10 +180,10 @@ func (o UpdateAppResponse) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *UpdateAppResponse) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Data *UpdateAppResponseData `json:"data,omitempty"` - Included []DeploymentIncluded `json:"included,omitempty"` - Meta *AppMeta `json:"meta,omitempty"` - Relationship *UpdateAppResponseRelationship `json:"relationship,omitempty"` + Data *UpdateAppResponseData `json:"data,omitempty"` + Included []Deployment `json:"included,omitempty"` + Meta *AppMeta `json:"meta,omitempty"` + Relationship *AppRelationship `json:"relationship,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_update_app_response_data.go b/api/datadogV2/model_update_app_response_data.go index 95cdb33e808..7e339a63c3e 100644 --- a/api/datadogV2/model_update_app_response_data.go +++ b/api/datadogV2/model_update_app_response_data.go @@ -7,17 +7,19 @@ package datadogV2 import ( "fmt" + "github.com/google/uuid" + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// UpdateAppResponseData The definition of `UpdateAppResponseData` object. +// UpdateAppResponseData The data object containing the updated app definition. type UpdateAppResponseData struct { - // The definition of `UpdateAppResponseDataAttributes` object. + // The updated app definition attributes, such as name, description, and components. Attributes UpdateAppResponseDataAttributes `json:"attributes"` - // The `data` `id`. - Id string `json:"id"` - // The definition of `UpdateAppResponseDataType` object. - Type UpdateAppResponseDataType `json:"type"` + // The ID of the updated app. + Id uuid.UUID `json:"id"` + // The app definition type. + Type AppDefinitionType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -27,7 +29,7 @@ type UpdateAppResponseData struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewUpdateAppResponseData(attributes UpdateAppResponseDataAttributes, id string, typeVar UpdateAppResponseDataType) *UpdateAppResponseData { +func NewUpdateAppResponseData(attributes UpdateAppResponseDataAttributes, id uuid.UUID, typeVar AppDefinitionType) *UpdateAppResponseData { this := UpdateAppResponseData{} this.Attributes = attributes this.Id = id @@ -40,7 +42,7 @@ func NewUpdateAppResponseData(attributes UpdateAppResponseDataAttributes, id str // but it doesn't guarantee that properties required by API are set. func NewUpdateAppResponseDataWithDefaults() *UpdateAppResponseData { this := UpdateAppResponseData{} - var typeVar UpdateAppResponseDataType = UPDATEAPPRESPONSEDATATYPE_APPDEFINITIONS + var typeVar AppDefinitionType = APPDEFINITIONTYPE_APPDEFINITIONS this.Type = typeVar return &this } @@ -69,9 +71,9 @@ func (o *UpdateAppResponseData) SetAttributes(v UpdateAppResponseDataAttributes) } // GetId returns the Id field value. -func (o *UpdateAppResponseData) GetId() string { +func (o *UpdateAppResponseData) GetId() uuid.UUID { if o == nil { - var ret string + var ret uuid.UUID return ret } return o.Id @@ -79,7 +81,7 @@ func (o *UpdateAppResponseData) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *UpdateAppResponseData) GetIdOk() (*string, bool) { +func (o *UpdateAppResponseData) GetIdOk() (*uuid.UUID, bool) { if o == nil { return nil, false } @@ -87,14 +89,14 @@ func (o *UpdateAppResponseData) GetIdOk() (*string, bool) { } // SetId sets field value. -func (o *UpdateAppResponseData) SetId(v string) { +func (o *UpdateAppResponseData) SetId(v uuid.UUID) { o.Id = v } // GetType returns the Type field value. -func (o *UpdateAppResponseData) GetType() UpdateAppResponseDataType { +func (o *UpdateAppResponseData) GetType() AppDefinitionType { if o == nil { - var ret UpdateAppResponseDataType + var ret AppDefinitionType return ret } return o.Type @@ -102,7 +104,7 @@ func (o *UpdateAppResponseData) GetType() UpdateAppResponseDataType { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *UpdateAppResponseData) GetTypeOk() (*UpdateAppResponseDataType, bool) { +func (o *UpdateAppResponseData) GetTypeOk() (*AppDefinitionType, bool) { if o == nil { return nil, false } @@ -110,7 +112,7 @@ func (o *UpdateAppResponseData) GetTypeOk() (*UpdateAppResponseDataType, bool) { } // SetType sets field value. -func (o *UpdateAppResponseData) SetType(v UpdateAppResponseDataType) { +func (o *UpdateAppResponseData) SetType(v AppDefinitionType) { o.Type = v } @@ -134,8 +136,8 @@ func (o UpdateAppResponseData) MarshalJSON() ([]byte, error) { func (o *UpdateAppResponseData) UnmarshalJSON(bytes []byte) (err error) { all := struct { Attributes *UpdateAppResponseDataAttributes `json:"attributes"` - Id *string `json:"id"` - Type *UpdateAppResponseDataType `json:"type"` + Id *uuid.UUID `json:"id"` + Type *AppDefinitionType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV2/model_update_app_response_data_attributes.go b/api/datadogV2/model_update_app_response_data_attributes.go index ad7a5469dbe..77ecf02e9b3 100644 --- a/api/datadogV2/model_update_app_response_data_attributes.go +++ b/api/datadogV2/model_update_app_response_data_attributes.go @@ -8,25 +8,21 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// UpdateAppResponseDataAttributes The definition of `UpdateAppResponseDataAttributes` object. +// UpdateAppResponseDataAttributes The updated app definition attributes, such as name, description, and components. type UpdateAppResponseDataAttributes struct { - // The `attributes` `components`. + // The UI components that make up the app. Components []ComponentGrid `json:"components,omitempty"` - // The `attributes` `description`. + // The human-readable description for the app. Description *string `json:"description,omitempty"` - // The `attributes` `embeddedQueries`. + // An array of queries, such as external actions and state variables, that the app uses. EmbeddedQueries []Query `json:"embeddedQueries,omitempty"` - // The `attributes` `favorite`. + // Whether the app is marked as a favorite by the current user. Favorite *bool `json:"favorite,omitempty"` - // The definition of `InputSchema` object. - InputSchema *InputSchema `json:"inputSchema,omitempty"` - // The `attributes` `name`. + // The name of the app. Name *string `json:"name,omitempty"` - // The `attributes` `rootInstanceName`. + // The name of the root component of the app. This must be a `grid` component that contains all other components. RootInstanceName *string `json:"rootInstanceName,omitempty"` - // The `attributes` `scripts`. - Scripts []Script `json:"scripts,omitempty"` - // The `attributes` `tags`. + // A list of tags for the app, which can be used to filter apps. Tags []string `json:"tags,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` @@ -162,34 +158,6 @@ func (o *UpdateAppResponseDataAttributes) SetFavorite(v bool) { o.Favorite = &v } -// GetInputSchema returns the InputSchema field value if set, zero value otherwise. -func (o *UpdateAppResponseDataAttributes) GetInputSchema() InputSchema { - if o == nil || o.InputSchema == nil { - var ret InputSchema - return ret - } - return *o.InputSchema -} - -// GetInputSchemaOk returns a tuple with the InputSchema field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateAppResponseDataAttributes) GetInputSchemaOk() (*InputSchema, bool) { - if o == nil || o.InputSchema == nil { - return nil, false - } - return o.InputSchema, true -} - -// HasInputSchema returns a boolean if a field has been set. -func (o *UpdateAppResponseDataAttributes) HasInputSchema() bool { - return o != nil && o.InputSchema != nil -} - -// SetInputSchema gets a reference to the given InputSchema and assigns it to the InputSchema field. -func (o *UpdateAppResponseDataAttributes) SetInputSchema(v InputSchema) { - o.InputSchema = &v -} - // GetName returns the Name field value if set, zero value otherwise. func (o *UpdateAppResponseDataAttributes) GetName() string { if o == nil || o.Name == nil { @@ -246,34 +214,6 @@ func (o *UpdateAppResponseDataAttributes) SetRootInstanceName(v string) { o.RootInstanceName = &v } -// GetScripts returns the Scripts field value if set, zero value otherwise. -func (o *UpdateAppResponseDataAttributes) GetScripts() []Script { - if o == nil || o.Scripts == nil { - var ret []Script - return ret - } - return o.Scripts -} - -// GetScriptsOk returns a tuple with the Scripts field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateAppResponseDataAttributes) GetScriptsOk() (*[]Script, bool) { - if o == nil || o.Scripts == nil { - return nil, false - } - return &o.Scripts, true -} - -// HasScripts returns a boolean if a field has been set. -func (o *UpdateAppResponseDataAttributes) HasScripts() bool { - return o != nil && o.Scripts != nil -} - -// SetScripts gets a reference to the given []Script and assigns it to the Scripts field. -func (o *UpdateAppResponseDataAttributes) SetScripts(v []Script) { - o.Scripts = v -} - // GetTags returns the Tags field value if set, zero value otherwise. func (o *UpdateAppResponseDataAttributes) GetTags() []string { if o == nil || o.Tags == nil { @@ -320,18 +260,12 @@ func (o UpdateAppResponseDataAttributes) MarshalJSON() ([]byte, error) { if o.Favorite != nil { toSerialize["favorite"] = o.Favorite } - if o.InputSchema != nil { - toSerialize["inputSchema"] = o.InputSchema - } if o.Name != nil { toSerialize["name"] = o.Name } if o.RootInstanceName != nil { toSerialize["rootInstanceName"] = o.RootInstanceName } - if o.Scripts != nil { - toSerialize["scripts"] = o.Scripts - } if o.Tags != nil { toSerialize["tags"] = o.Tags } @@ -349,10 +283,8 @@ func (o *UpdateAppResponseDataAttributes) UnmarshalJSON(bytes []byte) (err error Description *string `json:"description,omitempty"` EmbeddedQueries []Query `json:"embeddedQueries,omitempty"` Favorite *bool `json:"favorite,omitempty"` - InputSchema *InputSchema `json:"inputSchema,omitempty"` Name *string `json:"name,omitempty"` RootInstanceName *string `json:"rootInstanceName,omitempty"` - Scripts []Script `json:"scripts,omitempty"` Tags []string `json:"tags,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { @@ -360,32 +292,21 @@ func (o *UpdateAppResponseDataAttributes) UnmarshalJSON(bytes []byte) (err error } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"components", "description", "embeddedQueries", "favorite", "inputSchema", "name", "rootInstanceName", "scripts", "tags"}) + datadog.DeleteKeys(additionalProperties, &[]string{"components", "description", "embeddedQueries", "favorite", "name", "rootInstanceName", "tags"}) } else { return err } - - hasInvalidField := false o.Components = all.Components o.Description = all.Description o.EmbeddedQueries = all.EmbeddedQueries o.Favorite = all.Favorite - if all.InputSchema != nil && all.InputSchema.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.InputSchema = all.InputSchema o.Name = all.Name o.RootInstanceName = all.RootInstanceName - o.Scripts = all.Scripts o.Tags = all.Tags if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties } - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - return nil } diff --git a/api/datadogV2/model_update_app_response_data_type.go b/api/datadogV2/model_update_app_response_data_type.go deleted file mode 100644 index 5bd61678885..00000000000 --- a/api/datadogV2/model_update_app_response_data_type.go +++ /dev/null @@ -1,64 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// UpdateAppResponseDataType The definition of `UpdateAppResponseDataType` object. -type UpdateAppResponseDataType string - -// List of UpdateAppResponseDataType. -const ( - UPDATEAPPRESPONSEDATATYPE_APPDEFINITIONS UpdateAppResponseDataType = "appDefinitions" -) - -var allowedUpdateAppResponseDataTypeEnumValues = []UpdateAppResponseDataType{ - UPDATEAPPRESPONSEDATATYPE_APPDEFINITIONS, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *UpdateAppResponseDataType) GetAllowedValues() []UpdateAppResponseDataType { - return allowedUpdateAppResponseDataTypeEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *UpdateAppResponseDataType) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = UpdateAppResponseDataType(value) - return nil -} - -// NewUpdateAppResponseDataTypeFromValue returns a pointer to a valid UpdateAppResponseDataType -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewUpdateAppResponseDataTypeFromValue(v string) (*UpdateAppResponseDataType, error) { - ev := UpdateAppResponseDataType(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for UpdateAppResponseDataType: valid values are %v", v, allowedUpdateAppResponseDataTypeEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v UpdateAppResponseDataType) IsValid() bool { - for _, existing := range allowedUpdateAppResponseDataTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to UpdateAppResponseDataType value. -func (v UpdateAppResponseDataType) Ptr() *UpdateAppResponseDataType { - return &v -} diff --git a/api/datadogV2/model_update_app_response_relationship.go b/api/datadogV2/model_update_app_response_relationship.go deleted file mode 100644 index 1408ad16e9f..00000000000 --- a/api/datadogV2/model_update_app_response_relationship.go +++ /dev/null @@ -1,146 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// UpdateAppResponseRelationship The definition of `UpdateAppResponseRelationship` object. -type UpdateAppResponseRelationship struct { - // The `relationship` `connections`. - Connections []CustomConnection `json:"connections,omitempty"` - // The definition of `DeploymentRelationship` object. - Deployment *DeploymentRelationship `json:"deployment,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewUpdateAppResponseRelationship instantiates a new UpdateAppResponseRelationship object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewUpdateAppResponseRelationship() *UpdateAppResponseRelationship { - this := UpdateAppResponseRelationship{} - return &this -} - -// NewUpdateAppResponseRelationshipWithDefaults instantiates a new UpdateAppResponseRelationship object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewUpdateAppResponseRelationshipWithDefaults() *UpdateAppResponseRelationship { - this := UpdateAppResponseRelationship{} - return &this -} - -// GetConnections returns the Connections field value if set, zero value otherwise. -func (o *UpdateAppResponseRelationship) GetConnections() []CustomConnection { - if o == nil || o.Connections == nil { - var ret []CustomConnection - return ret - } - return o.Connections -} - -// GetConnectionsOk returns a tuple with the Connections field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateAppResponseRelationship) GetConnectionsOk() (*[]CustomConnection, bool) { - if o == nil || o.Connections == nil { - return nil, false - } - return &o.Connections, true -} - -// HasConnections returns a boolean if a field has been set. -func (o *UpdateAppResponseRelationship) HasConnections() bool { - return o != nil && o.Connections != nil -} - -// SetConnections gets a reference to the given []CustomConnection and assigns it to the Connections field. -func (o *UpdateAppResponseRelationship) SetConnections(v []CustomConnection) { - o.Connections = v -} - -// GetDeployment returns the Deployment field value if set, zero value otherwise. -func (o *UpdateAppResponseRelationship) GetDeployment() DeploymentRelationship { - if o == nil || o.Deployment == nil { - var ret DeploymentRelationship - return ret - } - return *o.Deployment -} - -// GetDeploymentOk returns a tuple with the Deployment field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateAppResponseRelationship) GetDeploymentOk() (*DeploymentRelationship, bool) { - if o == nil || o.Deployment == nil { - return nil, false - } - return o.Deployment, true -} - -// HasDeployment returns a boolean if a field has been set. -func (o *UpdateAppResponseRelationship) HasDeployment() bool { - return o != nil && o.Deployment != nil -} - -// SetDeployment gets a reference to the given DeploymentRelationship and assigns it to the Deployment field. -func (o *UpdateAppResponseRelationship) SetDeployment(v DeploymentRelationship) { - o.Deployment = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o UpdateAppResponseRelationship) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Connections != nil { - toSerialize["connections"] = o.Connections - } - if o.Deployment != nil { - toSerialize["deployment"] = o.Deployment - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *UpdateAppResponseRelationship) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Connections []CustomConnection `json:"connections,omitempty"` - Deployment *DeploymentRelationship `json:"deployment,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"connections", "deployment"}) - } else { - return err - } - - hasInvalidField := false - o.Connections = all.Connections - if all.Deployment != nil && all.Deployment.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Deployment = all.Deployment - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/examples/v2/apps/CreateApp.go b/examples/v2/app-builder/CreateApp.go similarity index 86% rename from examples/v2/apps/CreateApp.go rename to examples/v2/app-builder/CreateApp.go index 0a19867687a..94c585559d3 100644 --- a/examples/v2/apps/CreateApp.go +++ b/examples/v2/app-builder/CreateApp.go @@ -1,4 +1,4 @@ -// Create App returns "App Created" response +// Create App returns "Created" response package main @@ -52,21 +52,21 @@ func main() { Name: datadog.PtrString("Example App"), RootInstanceName: datadog.PtrString("grid0"), }, - Type: datadogV2.CREATEAPPREQUESTDATATYPE_APPDEFINITIONS, + Type: datadogV2.APPDEFINITIONTYPE_APPDEFINITIONS, }, } ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() configuration.SetUnstableOperationEnabled("v2.CreateApp", true) apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewAppsApi(apiClient) + api := datadogV2.NewAppBuilderApi(apiClient) resp, r, err := api.CreateApp(ctx, body) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AppsApi.CreateApp`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `AppBuilderApi.CreateApp`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `AppsApi.CreateApp`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `AppBuilderApi.CreateApp`:\n%s\n", responseContent) } diff --git a/examples/v2/apps/DeleteApp.go b/examples/v2/app-builder/DeleteApp.go similarity index 69% rename from examples/v2/apps/DeleteApp.go rename to examples/v2/app-builder/DeleteApp.go index 9f67d3c673d..bb73f630513 100644 --- a/examples/v2/apps/DeleteApp.go +++ b/examples/v2/app-builder/DeleteApp.go @@ -10,24 +10,25 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" + "github.com/google/uuid" ) func main() { // there is a valid "app" in the system - AppDataID := os.Getenv("APP_DATA_ID") + AppDataID := uuid.MustParse(os.Getenv("APP_DATA_ID")) ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() configuration.SetUnstableOperationEnabled("v2.DeleteApp", true) apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewAppsApi(apiClient) + api := datadogV2.NewAppBuilderApi(apiClient) resp, r, err := api.DeleteApp(ctx, AppDataID) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AppsApi.DeleteApp`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `AppBuilderApi.DeleteApp`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `AppsApi.DeleteApp`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `AppBuilderApi.DeleteApp`:\n%s\n", responseContent) } diff --git a/examples/v2/apps/DeleteApps.go b/examples/v2/app-builder/DeleteApps.go similarity index 69% rename from examples/v2/apps/DeleteApps.go rename to examples/v2/app-builder/DeleteApps.go index 0514eafb7b8..b2b7d0a257a 100644 --- a/examples/v2/apps/DeleteApps.go +++ b/examples/v2/app-builder/DeleteApps.go @@ -10,17 +10,18 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" + "github.com/google/uuid" ) func main() { // there is a valid "app" in the system - AppDataID := os.Getenv("APP_DATA_ID") + AppDataID := uuid.MustParse(os.Getenv("APP_DATA_ID")) body := datadogV2.DeleteAppsRequest{ Data: []datadogV2.DeleteAppsRequestDataItems{ { Id: AppDataID, - Type: datadogV2.DELETEAPPSREQUESTDATAITEMSTYPE_APPDEFINITIONS, + Type: datadogV2.APPDEFINITIONTYPE_APPDEFINITIONS, }, }, } @@ -28,14 +29,14 @@ func main() { configuration := datadog.NewConfiguration() configuration.SetUnstableOperationEnabled("v2.DeleteApps", true) apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewAppsApi(apiClient) + api := datadogV2.NewAppBuilderApi(apiClient) resp, r, err := api.DeleteApps(ctx, body) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AppsApi.DeleteApps`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `AppBuilderApi.DeleteApps`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `AppsApi.DeleteApps`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `AppBuilderApi.DeleteApps`:\n%s\n", responseContent) } diff --git a/examples/v2/apps/GetApp.go b/examples/v2/app-builder/GetApp.go similarity index 70% rename from examples/v2/apps/GetApp.go rename to examples/v2/app-builder/GetApp.go index cbe1ebba812..b952f86350a 100644 --- a/examples/v2/apps/GetApp.go +++ b/examples/v2/app-builder/GetApp.go @@ -10,24 +10,25 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" + "github.com/google/uuid" ) func main() { // there is a valid "app" in the system - AppDataID := os.Getenv("APP_DATA_ID") + AppDataID := uuid.MustParse(os.Getenv("APP_DATA_ID")) ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() configuration.SetUnstableOperationEnabled("v2.GetApp", true) apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewAppsApi(apiClient) + api := datadogV2.NewAppBuilderApi(apiClient) resp, r, err := api.GetApp(ctx, AppDataID, *datadogV2.NewGetAppOptionalParameters()) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AppsApi.GetApp`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `AppBuilderApi.GetApp`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `AppsApi.GetApp`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `AppBuilderApi.GetApp`:\n%s\n", responseContent) } diff --git a/examples/v2/apps/ListApps.go b/examples/v2/app-builder/ListApps.go similarity index 75% rename from examples/v2/apps/ListApps.go rename to examples/v2/app-builder/ListApps.go index a28f666f516..e4ff2b7cfa3 100644 --- a/examples/v2/apps/ListApps.go +++ b/examples/v2/app-builder/ListApps.go @@ -17,14 +17,14 @@ func main() { configuration := datadog.NewConfiguration() configuration.SetUnstableOperationEnabled("v2.ListApps", true) apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewAppsApi(apiClient) + api := datadogV2.NewAppBuilderApi(apiClient) resp, r, err := api.ListApps(ctx, *datadogV2.NewListAppsOptionalParameters()) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AppsApi.ListApps`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `AppBuilderApi.ListApps`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `AppsApi.ListApps`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `AppBuilderApi.ListApps`:\n%s\n", responseContent) } diff --git a/examples/v2/apps/DisableApp.go b/examples/v2/app-builder/PublishApp.go similarity index 53% rename from examples/v2/apps/DisableApp.go rename to examples/v2/app-builder/PublishApp.go index 8d5c5da9cec..d47e66f3388 100644 --- a/examples/v2/apps/DisableApp.go +++ b/examples/v2/app-builder/PublishApp.go @@ -1,4 +1,4 @@ -// Disable App returns "OK" response +// Publish App returns "Created" response package main @@ -10,24 +10,25 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" + "github.com/google/uuid" ) func main() { // there is a valid "app" in the system - AppDataID := os.Getenv("APP_DATA_ID") + AppDataID := uuid.MustParse(os.Getenv("APP_DATA_ID")) ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() - configuration.SetUnstableOperationEnabled("v2.DisableApp", true) + configuration.SetUnstableOperationEnabled("v2.PublishApp", true) apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewAppsApi(apiClient) - resp, r, err := api.DisableApp(ctx, AppDataID) + api := datadogV2.NewAppBuilderApi(apiClient) + resp, r, err := api.PublishApp(ctx, AppDataID) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AppsApi.DisableApp`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `AppBuilderApi.PublishApp`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `AppsApi.DisableApp`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `AppBuilderApi.PublishApp`:\n%s\n", responseContent) } diff --git a/examples/v2/apps/DeployApp.go b/examples/v2/app-builder/UnpublishApp.go similarity index 53% rename from examples/v2/apps/DeployApp.go rename to examples/v2/app-builder/UnpublishApp.go index f7c4d84bd0d..490e7f3d04e 100644 --- a/examples/v2/apps/DeployApp.go +++ b/examples/v2/app-builder/UnpublishApp.go @@ -1,4 +1,4 @@ -// Deploy App returns "Created" response +// Unpublish App returns "OK" response package main @@ -10,24 +10,25 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" + "github.com/google/uuid" ) func main() { // there is a valid "app" in the system - AppDataID := os.Getenv("APP_DATA_ID") + AppDataID := uuid.MustParse(os.Getenv("APP_DATA_ID")) ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() - configuration.SetUnstableOperationEnabled("v2.DeployApp", true) + configuration.SetUnstableOperationEnabled("v2.UnpublishApp", true) apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewAppsApi(apiClient) - resp, r, err := api.DeployApp(ctx, AppDataID) + api := datadogV2.NewAppBuilderApi(apiClient) + resp, r, err := api.UnpublishApp(ctx, AppDataID) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AppsApi.DeployApp`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `AppBuilderApi.UnpublishApp`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `AppsApi.DeployApp`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `AppBuilderApi.UnpublishApp`:\n%s\n", responseContent) } diff --git a/examples/v2/apps/UpdateApp.go b/examples/v2/app-builder/UpdateApp.go similarity index 71% rename from examples/v2/apps/UpdateApp.go rename to examples/v2/app-builder/UpdateApp.go index 198e43b41da..12a952b346a 100644 --- a/examples/v2/apps/UpdateApp.go +++ b/examples/v2/app-builder/UpdateApp.go @@ -10,11 +10,12 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" + "github.com/google/uuid" ) func main() { // there is a valid "app" in the system - AppDataID := os.Getenv("APP_DATA_ID") + AppDataID := uuid.MustParse(os.Getenv("APP_DATA_ID")) body := datadogV2.UpdateAppRequest{ Data: &datadogV2.UpdateAppRequestData{ @@ -22,22 +23,22 @@ func main() { Name: datadog.PtrString("Updated Name"), RootInstanceName: datadog.PtrString("grid0"), }, - Id: datadog.PtrString(AppDataID), - Type: datadogV2.UPDATEAPPREQUESTDATATYPE_APPDEFINITIONS, + Id: &AppDataID, + Type: datadogV2.APPDEFINITIONTYPE_APPDEFINITIONS, }, } ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() configuration.SetUnstableOperationEnabled("v2.UpdateApp", true) apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewAppsApi(apiClient) + api := datadogV2.NewAppBuilderApi(apiClient) resp, r, err := api.UpdateApp(ctx, AppDataID, body) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AppsApi.UpdateApp`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `AppBuilderApi.UpdateApp`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `AppsApi.UpdateApp`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `AppBuilderApi.UpdateApp`:\n%s\n", responseContent) } diff --git a/tests/scenarios/api_mappings.go b/tests/scenarios/api_mappings.go index 13ae7d2f637..a38bab78f8f 100644 --- a/tests/scenarios/api_mappings.go +++ b/tests/scenarios/api_mappings.go @@ -50,7 +50,7 @@ var apiMappings = map[string]map[string]reflect.Value{ "APIManagementApi": reflect.ValueOf(datadogV2.NewAPIManagementApi), "SpansMetricsApi": reflect.ValueOf(datadogV2.NewSpansMetricsApi), "APMRetentionFiltersApi": reflect.ValueOf(datadogV2.NewAPMRetentionFiltersApi), - "AppsApi": reflect.ValueOf(datadogV2.NewAppsApi), + "AppBuilderApi": reflect.ValueOf(datadogV2.NewAppBuilderApi), "AuditApi": reflect.ValueOf(datadogV2.NewAuditApi), "AuthNMappingsApi": reflect.ValueOf(datadogV2.NewAuthNMappingsApi), "CaseManagementApi": reflect.ValueOf(datadogV2.NewCaseManagementApi), diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..2887e18b734 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-01-09T20:40:37.253Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Bad_Request_response.yaml similarity index 78% rename from tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_Bad_Request_response.yaml rename to tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Bad_Request_response.yaml index 65a082a9e3f..7e05b8f6e20 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_Bad_Request_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Bad_Request_response.yaml @@ -12,7 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"errors":[{"detail":"missing required field","source":{"pointer":"/data/attributes/name"}}]}' + body: '{"errors":[{"title":"missing required field","detail":"missing required + field","source":{"pointer":"/data/attributes/name"}}]}' code: 400 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Created_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Created_response.freeze new file mode 100644 index 00000000000..d601c8eb950 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Created_response.freeze @@ -0,0 +1 @@ +2025-01-09T20:40:37.369Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_App_Created_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Created_response.yaml similarity index 57% rename from tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_App_Created_response.yaml rename to tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Created_response.yaml index 4fd41b5c89a..226f39adfeb 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_App_Created_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Created_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a simple example app","embeddedQueries":[],"name":"Example App","rootInstanceName":"grid0"},"type":"appDefinitions"}} + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isLoading":false,"isUnpublishd":false,"isVisible":true,"label":"CPU Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a simple example app","embeddedQueries":[],"name":"Example App","rootInstanceName":"grid0"},"type":"appDefinitions"}} form: {} headers: Accept: @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"data":{"id":"02c52f8c-78d9-4c14-ac27-b0bcac36ce74","type":"appDefinitions"}}' + body: '{"data":{"id":"4cbecc90-b8a4-49c4-9608-1a880d9d3de5","type":"appDefinitions"}}' code: 201 duration: 0ms headers: @@ -27,9 +27,9 @@ interactions: - application/json id: 1 method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/02c52f8c-78d9-4c14-ac27-b0bcac36ce74 + url: https://api.datadoghq.com/api/v2/app-builder/apps/4cbecc90-b8a4-49c4-9608-1a880d9d3de5 response: - body: '{"data":{"id":"02c52f8c-78d9-4c14-ac27-b0bcac36ce74","type":"appDefinitions"}}' + body: '{"data":{"id":"4cbecc90-b8a4-49c4-9608-1a880d9d3de5","type":"appDefinitions"}}' code: 200 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..e92ddd7d4b4 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-01-09T20:40:37.755Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_Not_Found_response.yaml similarity index 83% rename from tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Not_Found_response.yaml rename to tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_Not_Found_response.yaml index 08f466a08b8..3e121a772cb 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Not_Found_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_Not_Found_response.yaml @@ -9,7 +9,7 @@ interactions: method: DELETE url: https://api.datadoghq.com/api/v2/app-builder/apps/7addb29b-f935-472c-ae79-d1963979a23e response: - body: '{"errors":[{"detail":"app not found"}]}' + body: '{"errors":[{"title":"app not found","detail":"app not found"}]}' code: 404 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_OK_response.freeze new file mode 100644 index 00000000000..b39282600f4 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-01-09T20:40:37.852Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_OK_response.yaml similarity index 79% rename from tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_OK_response.yaml rename to tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_OK_response.yaml index 0b4fdba912a..84b1855a0eb 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_OK_response.yaml @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"data":{"id":"500bf715-77a5-4c1d-b4ef-0d181b071daf","type":"appDefinitions"}}' + body: '{"data":{"id":"1d01a77d-1251-42fb-ab67-c99edfb26970","type":"appDefinitions"}}' code: 201 duration: 0ms headers: @@ -27,9 +27,9 @@ interactions: - application/json id: 1 method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/500bf715-77a5-4c1d-b4ef-0d181b071daf + url: https://api.datadoghq.com/api/v2/app-builder/apps/1d01a77d-1251-42fb-ab67-c99edfb26970 response: - body: '{"data":{"id":"500bf715-77a5-4c1d-b4ef-0d181b071daf","type":"appDefinitions"}}' + body: '{"data":{"id":"1d01a77d-1251-42fb-ab67-c99edfb26970","type":"appDefinitions"}}' code: 200 duration: 0ms headers: @@ -44,9 +44,9 @@ interactions: - application/json id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/500bf715-77a5-4c1d-b4ef-0d181b071daf + url: https://api.datadoghq.com/api/v2/app-builder/apps/1d01a77d-1251-42fb-ab67-c99edfb26970 response: - body: '{"errors":[{"detail":"app not found"}]}' + body: '{"errors":[{"title":"app not found","detail":"app not found"}]}' code: 404 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..a502e206a86 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-01-09T20:40:38.331Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.yaml similarity index 53% rename from tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.yaml rename to tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.yaml index 330dc0ee886..bd71a8a68b1 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":[{"id":"29494ddd-ac13-46a7-8558-b05b050ee755","type":"appDefinitions"},{"id":"71c0d358-eac5-41e3-892d-a7467571b9b0","type":"appDefinitions"},{"id":"98e7e44d-1562-474a-90f7-3a94e739c006","type":"appDefinitions"}]} + {"data":[{"id":"aea2ed17-b45f-40d0-ba59-c86b7972c901","type":"appDefinitions"},{"id":"f69bb8be-6168-4fe7-a30d-370256b6504a","type":"appDefinitions"},{"id":"ab1ed73e-13ad-4426-b0df-a0ff8876a088","type":"appDefinitions"}]} form: {} headers: Accept: @@ -12,7 +12,8 @@ interactions: method: DELETE url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"errors":[{"detail":"one or more apps not found"}]}' + body: '{"errors":[{"title":"one or more apps not found","detail":"one or more + apps not found"}]}' code: 404 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_OK_response.freeze new file mode 100644 index 00000000000..0d90abf2676 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-01-09T20:40:38.424Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_OK_response.yaml similarity index 82% rename from tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_OK_response.yaml rename to tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_OK_response.yaml index 018bec6d6f7..411efa8e1f6 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_OK_response.yaml @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"data":{"id":"884b37bc-71b8-40bc-8967-12684ec7f3c4","type":"appDefinitions"}}' + body: '{"data":{"id":"7b5a5fec-3026-47a9-acca-e01dc557af0a","type":"appDefinitions"}}' code: 201 duration: 0ms headers: @@ -21,7 +21,7 @@ interactions: status: 201 Created - request: body: | - {"data":[{"id":"884b37bc-71b8-40bc-8967-12684ec7f3c4","type":"appDefinitions"}]} + {"data":[{"id":"7b5a5fec-3026-47a9-acca-e01dc557af0a","type":"appDefinitions"}]} form: {} headers: Accept: @@ -32,7 +32,7 @@ interactions: method: DELETE url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"data":[{"id":"884b37bc-71b8-40bc-8967-12684ec7f3c4","type":"appDefinitions"}]}' + body: '{"data":[{"id":"7b5a5fec-3026-47a9-acca-e01dc557af0a","type":"appDefinitions"}]}' code: 200 duration: 0ms headers: @@ -47,9 +47,9 @@ interactions: - application/json id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/884b37bc-71b8-40bc-8967-12684ec7f3c4 + url: https://api.datadoghq.com/api/v2/app-builder/apps/7b5a5fec-3026-47a9-acca-e01dc557af0a response: - body: '{"errors":[{"detail":"app not found"}]}' + body: '{"errors":[{"title":"app not found","detail":"app not found"}]}' code: 404 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..7cdb4f55583 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-01-09T20:40:38.801Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_Not_Found_response.yaml similarity index 83% rename from tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Not_Found_response.yaml rename to tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_Not_Found_response.yaml index 2ace6c9c5f4..7da1cd939c2 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Not_Found_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_Not_Found_response.yaml @@ -9,7 +9,7 @@ interactions: method: GET url: https://api.datadoghq.com/api/v2/app-builder/apps/7addb29b-f935-472c-ae79-d1963979a23e response: - body: '{"errors":[{"detail":"app not found"}]}' + body: '{"errors":[{"title":"app not found","detail":"app not found"}]}' code: 404 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_OK_response.freeze new file mode 100644 index 00000000000..52d6e6be29a --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-01-09T20:40:38.890Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_OK_response.yaml similarity index 82% rename from tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_OK_response.yaml rename to tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_OK_response.yaml index 64f8f530ce8..f7f9bfa9d2c 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_OK_response.yaml @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"data":{"id":"e91c5ea9-5827-4008-b1e6-026d71f5c005","type":"appDefinitions"}}' + body: '{"data":{"id":"862d8836-4fa8-494c-8760-5555eab08dda","type":"appDefinitions"}}' code: 201 duration: 0ms headers: @@ -27,12 +27,12 @@ interactions: - application/json id: 1 method: GET - url: https://api.datadoghq.com/api/v2/app-builder/apps/e91c5ea9-5827-4008-b1e6-026d71f5c005 + url: https://api.datadoghq.com/api/v2/app-builder/apps/862d8836-4fa8-494c-8760-5555eab08dda response: - body: '{"data":{"id":"e91c5ea9-5827-4008-b1e6-026d71f5c005","type":"appDefinitions","attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU + body: '{"data":{"id":"862d8836-4fa8-494c-8760-5555eab08dda","type":"appDefinitions","attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a simple example app","embeddedQueries":[],"favorite":false,"name":"Example - App","rootInstanceName":"grid0","selfService":false,"tags":[]},"meta":{"org_id":1107852,"user_id":15479137,"user_uuid":"b3f98453-b289-11ef-a4e9-d6d283f92d91","user_name":"oliver.li@datadoghq.com","version":1,"updated_since_deployment":false,"created_at":"2024-12-20T20:39:21.945448Z","updated_at":"2024-12-20T20:39:21.945448Z","deleted_at":"0001-01-01T00:00:00Z"}}}' + App","rootInstanceName":"grid0","selfService":false,"tags":[]},"meta":{"org_id":1107852,"user_id":15479137,"user_uuid":"b3f98453-b289-11ef-a4e9-d6d283f92d91","user_name":"oliver.li@datadoghq.com","version":1,"updated_since_deployment":false,"created_at":"2025-01-09T20:40:38.983288Z","updated_at":"2025-01-09T20:40:38.983288Z","deleted_at":"0001-01-01T00:00:00Z"}}}' code: 200 duration: 0ms headers: @@ -47,9 +47,9 @@ interactions: - application/json id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/e91c5ea9-5827-4008-b1e6-026d71f5c005 + url: https://api.datadoghq.com/api/v2/app-builder/apps/862d8836-4fa8-494c-8760-5555eab08dda response: - body: '{"data":{"id":"e91c5ea9-5827-4008-b1e6-026d71f5c005","type":"appDefinitions"}}' + body: '{"data":{"id":"862d8836-4fa8-494c-8760-5555eab08dda","type":"appDefinitions"}}' code: 200 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Apps_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Apps_returns_OK_response.freeze new file mode 100644 index 00000000000..169b4473122 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Apps_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-01-09T20:40:39.352Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_List_Apps_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Apps_returns_OK_response.yaml similarity index 68% rename from tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_List_Apps_returns_OK_response.yaml rename to tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Apps_returns_OK_response.yaml index 73ce8869d8b..62d7ea8ab77 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_List_Apps_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Apps_returns_OK_response.yaml @@ -9,9 +9,10 @@ interactions: method: GET url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"data":[{"id":"0cc51f70-6f90-406e-880b-e2fac88e823a","type":"appDefinitions","attributes":{"description":"","favorite":false,"name":"[synthetics] + body: '{"data":[{"id":"637107ff-d8af-4bc7-bf99-8b57e5ec6f5a","type":"appDefinitions","attributes":{"description":"","favorite":false,"name":"[synthetics] + app name 0123456789","selfService":false,"tags":[]},"meta":{"org_id":1107852,"user_id":7571471,"user_uuid":"01347f51-3fcd-11ef-95dd-a65df5ee2843","user_name":"01347f51-3fcd-11ef-95dd-a65df5ee2843","version":0,"updated_since_deployment":false,"created_at":"2024-12-29T15:23:59.7047Z","updated_at":"2024-12-29T15:23:59.957962Z","deleted_at":"0001-01-01T00:00:00Z"}},{"id":"0cc51f70-6f90-406e-880b-e2fac88e823a","type":"appDefinitions","attributes":{"description":"","favorite":false,"name":"[synthetics] app name 0123456789","selfService":false,"tags":[]},"meta":{"org_id":1107852,"user_id":7571471,"user_uuid":"01347f51-3fcd-11ef-95dd-a65df5ee2843","user_name":"01347f51-3fcd-11ef-95dd-a65df5ee2843","version":0,"updated_since_deployment":false,"created_at":"2024-12-18T11:48:55.89363Z","updated_at":"2024-12-18T11:48:55.89363Z","deleted_at":"0001-01-01T00:00:00Z"}},{"id":"d595693a-473d-4671-9da3-fce89e3a5c5d","type":"appDefinitions","attributes":{"description":"","favorite":false,"name":"Max''s - App Fri, Jul 12, 11:10:35 am","selfService":false,"tags":[]},"meta":{"org_id":1107852,"user_id":7571362,"user_uuid":"3114f3a0-3fc9-11ef-acbe-a6def6551924","user_name":"max.gale@datadoghq.com","version":0,"updated_since_deployment":false,"created_at":"2024-07-12T15:10:48.690305Z","updated_at":"2024-07-12T15:10:48.690305Z","deleted_at":"0001-01-01T00:00:00Z"}}],"meta":{"page":{"totalCount":2,"totalFilteredCount":2}}}' + App Fri, Jul 12, 11:10:35 am","selfService":false,"tags":[]},"meta":{"org_id":1107852,"user_id":7571362,"user_uuid":"3114f3a0-3fc9-11ef-acbe-a6def6551924","user_name":"max.gale@datadoghq.com","version":0,"updated_since_deployment":false,"created_at":"2024-07-12T15:10:48.690305Z","updated_at":"2024-07-12T15:10:48.690305Z","deleted_at":"0001-01-01T00:00:00Z"}}],"meta":{"page":{"totalCount":3,"totalFilteredCount":3}}}' code: 200 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Created_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Created_response.freeze new file mode 100644 index 00000000000..ee1be769428 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Created_response.freeze @@ -0,0 +1 @@ +2025-01-09T20:40:39.474Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Created_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Created_response.yaml similarity index 73% rename from tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Created_response.yaml rename to tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Created_response.yaml index e58d8fe131b..d0f3bf3d51b 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Created_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Created_response.yaml @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"data":{"id":"290ad26d-6f5c-43b6-aef6-57b403d755e8","type":"appDefinitions"}}' + body: '{"data":{"id":"f33cfd55-b517-4c29-862b-45c99742ed0e","type":"appDefinitions"}}' code: 201 duration: 0ms headers: @@ -27,9 +27,9 @@ interactions: - application/json id: 1 method: POST - url: https://api.datadoghq.com/api/v2/app-builder/apps/290ad26d-6f5c-43b6-aef6-57b403d755e8/deployment + url: https://api.datadoghq.com/api/v2/app-builder/apps/f33cfd55-b517-4c29-862b-45c99742ed0e/deployment response: - body: '{"data":{"id":"74a4bbff-b587-4272-a207-b61678cc0bf1","type":"deployment","attributes":{"app_version_id":"ab334928-2df5-4e6e-8e40-9eeee2b2cd44"},"meta":{"created_at":"2024-12-20T20:39:20.594723Z","user_id":15479137,"user_uuid":"b3f98453-b289-11ef-a4e9-d6d283f92d91","user_name":"oliver.li@datadoghq.com"}}}' + body: '{"data":{"id":"01087e5d-de82-4a28-bf05-d2e66ec4ed44","type":"deployment","attributes":{"app_version_id":"f638f430-5534-447f-85c8-860693539ff6"},"meta":{"created_at":"2025-01-09T20:40:39.764785Z","user_id":15479137,"user_uuid":"b3f98453-b289-11ef-a4e9-d6d283f92d91","user_name":"oliver.li@datadoghq.com"}}}' code: 201 duration: 0ms headers: @@ -44,9 +44,9 @@ interactions: - application/json id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/290ad26d-6f5c-43b6-aef6-57b403d755e8 + url: https://api.datadoghq.com/api/v2/app-builder/apps/f33cfd55-b517-4c29-862b-45c99742ed0e response: - body: '{"data":{"id":"290ad26d-6f5c-43b6-aef6-57b403d755e8","type":"appDefinitions"}}' + body: '{"data":{"id":"f33cfd55-b517-4c29-862b-45c99742ed0e","type":"appDefinitions"}}' code: 200 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..3a40add39a6 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-01-09T20:40:39.992Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Not_Found_response.yaml similarity index 83% rename from tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Not_Found_response.yaml rename to tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Not_Found_response.yaml index c1276132f44..5b0f7e4ac3d 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Not_Found_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Not_Found_response.yaml @@ -9,7 +9,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/app-builder/apps/7addb29b-f935-472c-ae79-d1963979a23e/deployment response: - body: '{"errors":[{"detail":"app not found"}]}' + body: '{"errors":[{"title":"app not found","detail":"app not found"}]}' code: 404 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..89158226aa3 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-01-09T20:40:40.084Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_Not_Found_response.yaml similarity index 83% rename from tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_Not_Found_response.yaml rename to tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_Not_Found_response.yaml index 36ce5941506..c7d51c6bdd9 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_Not_Found_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_Not_Found_response.yaml @@ -9,7 +9,7 @@ interactions: method: DELETE url: https://api.datadoghq.com/api/v2/app-builder/apps/7addb29b-f935-472c-ae79-d1963979a23e/deployment response: - body: '{"errors":[{"detail":"app not found"}]}' + body: '{"errors":[{"title":"app not found","detail":"app not found"}]}' code: 404 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_OK_response.freeze new file mode 100644 index 00000000000..7caa9400c89 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-01-09T20:40:40.161Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_OK_response.yaml similarity index 76% rename from tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_OK_response.yaml rename to tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_OK_response.yaml index 41d12356ee4..1af165fc768 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_OK_response.yaml @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"data":{"id":"cfe9f7bc-e6e6-44e2-9d30-19b03ab871b5","type":"appDefinitions"}}' + body: '{"data":{"id":"5a291e81-8d65-4404-a700-2c3d46b1da47","type":"appDefinitions"}}' code: 201 duration: 0ms headers: @@ -27,9 +27,9 @@ interactions: - application/json id: 1 method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/cfe9f7bc-e6e6-44e2-9d30-19b03ab871b5/deployment + url: https://api.datadoghq.com/api/v2/app-builder/apps/5a291e81-8d65-4404-a700-2c3d46b1da47/deployment response: - body: '{"data":{"id":"1c14f2b9-0161-4dac-ad44-b8dd84abcbe6","type":"deployment","attributes":{"app_version_id":"00000000-0000-0000-0000-000000000000"},"meta":{"created_at":"2024-12-20T20:39:21.490485Z","user_id":15479137,"user_uuid":"b3f98453-b289-11ef-a4e9-d6d283f92d91","user_name":"oliver.li@datadoghq.com"}}}' + body: '{"data":{"id":"8c318f17-b117-4ea5-b01d-b02db78134bb","type":"deployment","attributes":{"app_version_id":"00000000-0000-0000-0000-000000000000"},"meta":{"created_at":"2025-01-09T20:40:40.464096Z","user_id":15479137,"user_uuid":"b3f98453-b289-11ef-a4e9-d6d283f92d91","user_name":"oliver.li@datadoghq.com"}}}' code: 200 duration: 0ms headers: @@ -44,9 +44,9 @@ interactions: - application/json id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/cfe9f7bc-e6e6-44e2-9d30-19b03ab871b5 + url: https://api.datadoghq.com/api/v2/app-builder/apps/5a291e81-8d65-4404-a700-2c3d46b1da47 response: - body: '{"data":{"id":"cfe9f7bc-e6e6-44e2-9d30-19b03ab871b5","type":"appDefinitions"}}' + body: '{"data":{"id":"5a291e81-8d65-4404-a700-2c3d46b1da47","type":"appDefinitions"}}' code: 200 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..67b5e984d6c --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-01-09T20:40:40.664Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_Bad_Request_response.yaml similarity index 72% rename from tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_Bad_Request_response.yaml rename to tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_Bad_Request_response.yaml index 967307e7c5b..c9bac2948a8 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_Bad_Request_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_Bad_Request_response.yaml @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"data":{"id":"2eb79081-77f2-4082-93d5-fbb4d2291dc7","type":"appDefinitions"}}' + body: '{"data":{"id":"b3f997e6-a9db-4984-a560-23005049c5f3","type":"appDefinitions"}}' code: 201 duration: 0ms headers: @@ -21,7 +21,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"rootInstanceName":""},"id":"2eb79081-77f2-4082-93d5-fbb4d2291dc7","type":"appDefinitions"}} + {"data":{"attributes":{"rootInstanceName":""},"id":"b3f997e6-a9db-4984-a560-23005049c5f3","type":"appDefinitions"}} form: {} headers: Accept: @@ -30,9 +30,10 @@ interactions: - application/json id: 1 method: PATCH - url: https://api.datadoghq.com/api/v2/app-builder/apps/2eb79081-77f2-4082-93d5-fbb4d2291dc7 + url: https://api.datadoghq.com/api/v2/app-builder/apps/b3f997e6-a9db-4984-a560-23005049c5f3 response: - body: '{"errors":[{"detail":"missing required field","source":{"pointer":"/data/attributes/rootInstanceName"}}]}' + body: '{"errors":[{"title":"missing required field","detail":"missing required + field","source":{"pointer":"/data/attributes/rootInstanceName"}}]}' code: 400 duration: 0ms headers: @@ -47,9 +48,9 @@ interactions: - application/json id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/2eb79081-77f2-4082-93d5-fbb4d2291dc7 + url: https://api.datadoghq.com/api/v2/app-builder/apps/b3f997e6-a9db-4984-a560-23005049c5f3 response: - body: '{"data":{"id":"2eb79081-77f2-4082-93d5-fbb4d2291dc7","type":"appDefinitions"}}' + body: '{"data":{"id":"b3f997e6-a9db-4984-a560-23005049c5f3","type":"appDefinitions"}}' code: 200 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_OK_response.freeze new file mode 100644 index 00000000000..920baa8fa2d --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-01-09T20:40:41.221Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_OK_response.yaml similarity index 81% rename from tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_OK_response.yaml rename to tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_OK_response.yaml index 20f1cae9b59..6ba3fbfe552 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_OK_response.yaml @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"data":{"id":"22653158-3691-4a09-bbd9-f4197f14dd0c","type":"appDefinitions"}}' + body: '{"data":{"id":"b5820444-b12a-48d2-9cf2-231d6a3e8858","type":"appDefinitions"}}' code: 201 duration: 0ms headers: @@ -21,7 +21,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"name":"Updated Name","rootInstanceName":"grid0"},"id":"22653158-3691-4a09-bbd9-f4197f14dd0c","type":"appDefinitions"}} + {"data":{"attributes":{"name":"Updated Name","rootInstanceName":"grid0"},"id":"b5820444-b12a-48d2-9cf2-231d6a3e8858","type":"appDefinitions"}} form: {} headers: Accept: @@ -30,12 +30,12 @@ interactions: - application/json id: 1 method: PATCH - url: https://api.datadoghq.com/api/v2/app-builder/apps/22653158-3691-4a09-bbd9-f4197f14dd0c + url: https://api.datadoghq.com/api/v2/app-builder/apps/b5820444-b12a-48d2-9cf2-231d6a3e8858 response: - body: '{"data":{"id":"22653158-3691-4a09-bbd9-f4197f14dd0c","type":"appDefinitions","attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU + body: '{"data":{"id":"b5820444-b12a-48d2-9cf2-231d6a3e8858","type":"appDefinitions","attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a simple example app","embeddedQueries":[],"favorite":false,"name":"Updated - Name","rootInstanceName":"grid0","selfService":false,"tags":[]},"meta":{"org_id":1107852,"user_id":15479137,"user_uuid":"b3f98453-b289-11ef-a4e9-d6d283f92d91","user_name":"oliver.li@datadoghq.com","version":2,"updated_since_deployment":false,"created_at":"2024-12-20T20:39:23.117622Z","updated_at":"2024-12-20T20:39:23.317526Z","deleted_at":"0001-01-01T00:00:00Z"}}}' + Name","rootInstanceName":"grid0","selfService":false,"tags":[]},"meta":{"org_id":1107852,"user_id":15479137,"user_uuid":"b3f98453-b289-11ef-a4e9-d6d283f92d91","user_name":"oliver.li@datadoghq.com","version":2,"updated_since_deployment":false,"created_at":"2025-01-09T20:40:41.309534Z","updated_at":"2025-01-09T20:40:41.499741Z","deleted_at":"0001-01-01T00:00:00Z"}}}' code: 200 duration: 0ms headers: @@ -50,9 +50,9 @@ interactions: - application/json id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/22653158-3691-4a09-bbd9-f4197f14dd0c + url: https://api.datadoghq.com/api/v2/app-builder/apps/b5820444-b12a-48d2-9cf2-231d6a3e8858 response: - body: '{"data":{"id":"22653158-3691-4a09-bbd9-f4197f14dd0c","type":"appDefinitions"}}' + body: '{"data":{"id":"b5820444-b12a-48d2-9cf2-231d6a3e8858","type":"appDefinitions"}}' code: 200 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_App_Created_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_App_Created_response.freeze deleted file mode 100644 index a188f565172..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_App_Created_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-20T20:39:18.375Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_Bad_Request_response.freeze deleted file mode 100644 index 6bab6b51774..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_Bad_Request_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-20T20:39:18.779Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Bad_Request_response.freeze deleted file mode 100644 index f2fcc286e7e..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Bad_Request_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-20T20:39:18.880Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Bad_Request_response.yaml deleted file mode 100644 index 1982aecc054..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Bad_Request_response.yaml +++ /dev/null @@ -1,19 +0,0 @@ -interactions: -- request: - body: '' - form: {} - headers: - Accept: - - application/json - id: 0 - method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/bad-app-id - response: - body: '{"errors":[{"detail":"invalid path parameter","source":{"parameter":"appId"}}]}' - code: 400 - duration: 0ms - headers: - Content-Type: - - application/vnd.api+json - status: 400 Bad Request -version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Not_Found_response.freeze deleted file mode 100644 index fb9dd880bf6..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Not_Found_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-20T20:39:18.985Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_OK_response.freeze deleted file mode 100644 index 744eafd5016..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-20T20:39:19.083Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Bad_Request_response.freeze deleted file mode 100644 index c2c122a9a5c..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Bad_Request_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-20T20:39:19.594Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Bad_Request_response.yaml deleted file mode 100644 index 7d15e5b626b..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Bad_Request_response.yaml +++ /dev/null @@ -1,23 +0,0 @@ -interactions: -- request: - body: | - {"data":[{"id":"71c0d358-eac5-41e3-892d-a7467571b9b","type":"appDefinitions"},{"id":"71c0d358-eac5-41e3-892d-a7467571b9b0","type":"appDefinitions"},{"id":"98e7e44d-1562-474a-90f7-3a94e739c006","type":"appDefinitions"}]} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - id: 0 - method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps - response: - body: '{"errors":[{"status":"400","title":"Bad Request","detail":"invalid UUID - length: 35"}]}' - code: 400 - duration: 0ms - headers: - Content-Type: - - application/vnd.api+json - status: 400 Bad Request -version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.freeze deleted file mode 100644 index 7d397ad29fe..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-20T20:39:19.688Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_OK_response.freeze deleted file mode 100644 index d2346be1daa..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-20T20:39:19.785Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Bad_Request_response.freeze deleted file mode 100644 index 3f65923d0af..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Bad_Request_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-20T20:39:20.190Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Bad_Request_response.yaml deleted file mode 100644 index c2280ccb0ee..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Bad_Request_response.yaml +++ /dev/null @@ -1,19 +0,0 @@ -interactions: -- request: - body: '' - form: {} - headers: - Accept: - - application/json - id: 0 - method: POST - url: https://api.datadoghq.com/api/v2/app-builder/apps/invalid-uuid/deployment - response: - body: '{"errors":[{"detail":"invalid path parameter","source":{"parameter":"appId"}}]}' - code: 400 - duration: 0ms - headers: - Content-Type: - - application/vnd.api+json - status: 400 Bad Request -version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Created_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Created_response.freeze deleted file mode 100644 index 2c4a1170293..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Created_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-20T20:39:20.292Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Not_Found_response.freeze deleted file mode 100644 index f8f8e8f2692..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Not_Found_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-20T20:39:20.929Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_Bad_Request_response.freeze deleted file mode 100644 index afd2bf6b9f8..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_Bad_Request_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-20T20:39:21.034Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_Bad_Request_response.yaml deleted file mode 100644 index cad0f8a2468..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_Bad_Request_response.yaml +++ /dev/null @@ -1,19 +0,0 @@ -interactions: -- request: - body: '' - form: {} - headers: - Accept: - - application/json - id: 0 - method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/invalid-uuid/deployment - response: - body: '{"errors":[{"detail":"invalid path parameter","source":{"parameter":"appId"}}]}' - code: 400 - duration: 0ms - headers: - Content-Type: - - application/vnd.api+json - status: 400 Bad Request -version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_Not_Found_response.freeze deleted file mode 100644 index 7332f600132..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_Not_Found_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-20T20:39:21.129Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_OK_response.freeze deleted file mode 100644 index 672904fce26..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-20T20:39:21.230Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Bad_Request_response.freeze deleted file mode 100644 index 8251b6eaf66..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Bad_Request_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-20T20:39:21.680Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Bad_Request_response.yaml deleted file mode 100644 index 0d4806c69d4..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Bad_Request_response.yaml +++ /dev/null @@ -1,19 +0,0 @@ -interactions: -- request: - body: '' - form: {} - headers: - Accept: - - application/json - id: 0 - method: GET - url: https://api.datadoghq.com/api/v2/app-builder/apps/invalid-uuid - response: - body: '{"errors":[{"detail":"invalid path parameter","source":{"parameter":"appId"}}]}' - code: 400 - duration: 0ms - headers: - Content-Type: - - application/vnd.api+json - status: 400 Bad Request -version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Not_Found_response.freeze deleted file mode 100644 index 8bd6f7561c5..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Not_Found_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-20T20:39:21.762Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_OK_response.freeze deleted file mode 100644 index e407ffe5d62..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-20T20:39:21.868Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_List_Apps_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_List_Apps_returns_OK_response.freeze deleted file mode 100644 index b459860c38e..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_List_Apps_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-20T20:39:22.419Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_Bad_Request_response.freeze deleted file mode 100644 index fd24ecdb585..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_Bad_Request_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-20T20:39:22.549Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_OK_response.freeze deleted file mode 100644 index b873204c5af..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-20T20:39:23.050Z \ No newline at end of file diff --git a/tests/scenarios/features/v2/app_builder.feature b/tests/scenarios/features/v2/app_builder.feature new file mode 100644 index 00000000000..e0385bdb832 --- /dev/null +++ b/tests/scenarios/features/v2/app_builder.feature @@ -0,0 +1,208 @@ +@endpoint(app-builder) @endpoint(app-builder-v2) +Feature: App Builder + Datadog App Builder provides a low-code solution to rapidly develop and + integrate secure, customized applications into your monitoring stack that + are built to accelerate remediation at scale. These API endpoints allow + you to create, read, update, delete, and publish apps. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "AppBuilder" API + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Create App returns "Bad Request" response + Given operation "CreateApp" enabled + And new "CreateApp" request + And body with value {"data": {"attributes": {"description": "This is a bad example app", "embeddedQueries": [], "rootInstanceName": "grid0"}, "type": "appDefinitions"}} + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].detail" is equal to "missing required field" + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Create App returns "Created" response + Given operation "CreateApp" enabled + And new "CreateApp" request + And body with value {"data": {"attributes": {"components": [{"events": [], "name": "grid0", "properties": {"children": [{"events": [], "name": "gridCell0", "properties": {"children": [{"events": [], "name": "calloutValue0", "properties": {"isVisible": true, "isUnpublishd": false, "isLoading": false, "label": "CPU Usage", "size": "sm", "style": "vivid_yellow", "unit": "kB", "value": "42"}, "type": "calloutValue"}], "isVisible": "true", "layout": {"default": {"height": 8, "width": 2, "x": 0, "y": 0}}}, "type": "gridCell"}]}, "type": "grid"}], "description": "This is a simple example app", "embeddedQueries": [], "name": "Example App", "rootInstanceName": "grid0"}, "type": "appDefinitions"}} + When the request is sent + Then the response status is 201 Created + And the response "data.type" is equal to "appDefinitions" + + @skip @team:DataDog/app-builder-backend + Scenario: Delete App returns "Bad Request" response + Given operation "DeleteApp" enabled + And new "DeleteApp" request + And request contains "app_id" parameter with value "bad-app-id" + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/app-builder-backend + Scenario: Delete App returns "Gone" response + Given operation "DeleteApp" enabled + And new "DeleteApp" request + And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" + When the request is sent + Then the response status is 410 Gone + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Delete App returns "Not Found" response + Given operation "DeleteApp" enabled + And new "DeleteApp" request + And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" + When the request is sent + Then the response status is 404 Not Found + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Delete App returns "OK" response + Given operation "DeleteApp" enabled + And there is a valid "app" in the system + And new "DeleteApp" request + And request contains "app_id" parameter from "app.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.id" has the same value as "app.data.id" + And the response "data.type" is equal to "appDefinitions" + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Delete Multiple Apps returns "Bad Request" response + Given operation "DeleteApps" enabled + And new "DeleteApps" request + And body with value {"data": [{"id": "aea2ed17-b45f-40d0-ba59-c86b7972c901", "type": "appDefinitions"}, {"id": "f69bb8be-6168-4fe7-a30d-370256b6504a", "type": "appDefinitions"}, {"id": "ab1ed73e-13ad-4426-b0df-a0ff8876a088", "type": "appDefinitions"}]} + When the request is sent + Then the response status is 400 Bad Request + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Delete Multiple Apps returns "Not Found" response + Given operation "DeleteApps" enabled + And new "DeleteApps" request + And body with value {"data": [{"id": "aea2ed17-b45f-40d0-ba59-c86b7972c901", "type": "appDefinitions"}, {"id": "f69bb8be-6168-4fe7-a30d-370256b6504a", "type": "appDefinitions"}, {"id": "ab1ed73e-13ad-4426-b0df-a0ff8876a088", "type": "appDefinitions"}]} + When the request is sent + Then the response status is 404 Not Found + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Delete Multiple Apps returns "OK" response + Given operation "DeleteApps" enabled + And new "DeleteApps" request + And there is a valid "app" in the system + And body with value {"data": [{"id": "{{ app.data.id }}", "type": "appDefinitions"}]} + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + And the response "data[0].id" has the same value as "app.data.id" + + @skip @team:DataDog/app-builder-backend + Scenario: Get App returns "Bad Request" response + Given operation "GetApp" enabled + And new "GetApp" request + And request contains "app_id" parameter with value "invalid-uuid" + When the request is sent + Then the response status is 400 Bad Request + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Get App returns "Not Found" response + Given operation "GetApp" enabled + And new "GetApp" request + And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" + When the request is sent + Then the response status is 404 Not Found + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Get App returns "OK" response + Given operation "GetApp" enabled + And new "GetApp" request + And there is a valid "app" in the system + And request contains "app_id" parameter from "app.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.id" has the same value as "app.data.id" + And the response "data.type" is equal to "appDefinitions" + + @generated @skip @team:DataDog/app-builder-backend + Scenario: List Apps returns "Bad Request" response + Given operation "ListApps" enabled + And new "ListApps" request + When the request is sent + Then the response status is 400 Bad Request + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: List Apps returns "OK" response + Given operation "ListApps" enabled + And new "ListApps" request + When the request is sent + Then the response status is 200 OK + + @skip @team:DataDog/app-builder-backend + Scenario: Publish App returns "Bad Request" response + Given operation "PublishApp" enabled + And new "PublishApp" request + And request contains "app_id" parameter with value "invalid-uuid" + When the request is sent + Then the response status is 400 Bad Request + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Publish App returns "Created" response + Given operation "PublishApp" enabled + And new "PublishApp" request + And there is a valid "app" in the system + And request contains "app_id" parameter from "app.data.id" + When the request is sent + Then the response status is 201 Created + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Publish App returns "Not Found" response + Given operation "PublishApp" enabled + And new "PublishApp" request + And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" + When the request is sent + Then the response status is 404 Not Found + + @skip @team:DataDog/app-builder-backend + Scenario: Unpublish App returns "Bad Request" response + Given operation "UnpublishApp" enabled + And new "UnpublishApp" request + And request contains "app_id" parameter with value "invalid-uuid" + When the request is sent + Then the response status is 400 Bad Request + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Unpublish App returns "Not Found" response + Given operation "UnpublishApp" enabled + And new "UnpublishApp" request + And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" + When the request is sent + Then the response status is 404 Not Found + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Unpublish App returns "OK" response + Given operation "UnpublishApp" enabled + And new "UnpublishApp" request + And there is a valid "app" in the system + And request contains "app_id" parameter from "app.data.id" + When the request is sent + Then the response status is 200 OK + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Update App returns "Bad Request" response + Given operation "UpdateApp" enabled + And new "UpdateApp" request + And there is a valid "app" in the system + And request contains "app_id" parameter from "app.data.id" + And body with value {"data": {"attributes": {"rootInstanceName": ""}, "id": "{{ app.data.id }}", "type": "appDefinitions"}} + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].detail" is equal to "missing required field" + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Update App returns "OK" response + Given operation "UpdateApp" enabled + And new "UpdateApp" request + And there is a valid "app" in the system + And request contains "app_id" parameter from "app.data.id" + And body with value {"data": {"attributes": {"name": "Updated Name", "rootInstanceName": "grid0"}, "id": "{{ app.data.id }}", "type": "appDefinitions"}} + When the request is sent + Then the response status is 200 OK + And the response "data.id" has the same value as "app.data.id" + And the response "data.type" is equal to "appDefinitions" + And the response "data.attributes.name" is equal to "Updated Name" diff --git a/tests/scenarios/features/v2/given.json b/tests/scenarios/features/v2/given.json index e5c2cbcc488..e56e4a49e87 100644 --- a/tests/scenarios/features/v2/given.json +++ b/tests/scenarios/features/v2/given.json @@ -68,7 +68,7 @@ ], "step": "there is a valid \"app\" in the system", "key": "app", - "tag": "Apps", + "tag": "App Builder", "operationId": "CreateApp" }, { diff --git a/tests/scenarios/features/v2/undo.json b/tests/scenarios/features/v2/undo.json index d1258a8d92c..015dfcc42d7 100644 --- a/tests/scenarios/features/v2/undo.json +++ b/tests/scenarios/features/v2/undo.json @@ -191,19 +191,19 @@ } }, "DeleteApps": { - "tag": "Apps", + "tag": "App Builder", "undo": { "type": "idempotent" } }, "ListApps": { - "tag": "Apps", + "tag": "App Builder", "undo": { "type": "safe" } }, "CreateApp": { - "tag": "Apps", + "tag": "App Builder", "undo": { "operationId": "DeleteApp", "parameters": [ @@ -216,31 +216,31 @@ } }, "DeleteApp": { - "tag": "Apps", + "tag": "App Builder", "undo": { "type": "idempotent" } }, "GetApp": { - "tag": "Apps", + "tag": "App Builder", "undo": { "type": "safe" } }, "UpdateApp": { - "tag": "Apps", + "tag": "App Builder", "undo": { "type": "idempotent" } }, - "DisableApp": { - "tag": "Apps", + "UnpublishApp": { + "tag": "App Builder", "undo": { "type": "idempotent" } }, - "DeployApp": { - "tag": "Apps", + "PublishApp": { + "tag": "App Builder", "undo": { "type": "idempotent" }