From 0805eee62aef78f0c1fe4a189a88da770cd88fb4 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 24 Dec 2024 22:19:13 +0000 Subject: [PATCH] Regenerate client from commit e7f6813c of spec repo --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 135 +++++----- api/datadog/configuration.go | 4 +- api/datadogV2/api_app_deployment.go | 203 -------------- api/datadogV2/api_apps.go | 250 ++++++++++++++++-- api/datadogV2/doc.go | 4 +- api/datadogV2/model_app_builder_error.go | 102 ------- .../model_app_builder_error_errors_items.go | 146 ---------- ...l_app_builder_error_errors_items_source.go | 137 ---------- .../model_get_app_version_parameter.go | 105 ++++++++ ...del_get_app_version_parameter_constants.go | 66 +++++ .../v2/{app-deployment => apps}/DeployApp.go | 6 +- .../v2/{app-deployment => apps}/DisableApp.go | 6 +- examples/v2/apps/GetApp.go | 2 +- tests/scenarios/api_mappings.go | 1 - ...oy_App_returns_Bad_Request_response.freeze | 1 - ...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_Not_Found_response.freeze | 1 - ...rio_Disable_App_returns_OK_response.freeze | 1 - ...te_App_returns_App_Created_response.freeze | 2 +- ...eate_App_returns_App_Created_response.yaml | 6 +- ...te_App_returns_Bad_Request_response.freeze | 2 +- ...te_App_returns_Bad_Request_response.freeze | 2 +- ...lete_App_returns_Not_Found_response.freeze | 2 +- ...ario_Delete_App_returns_OK_response.freeze | 2 +- ...enario_Delete_App_returns_OK_response.yaml | 8 +- ...e_Apps_returns_Bad_Request_response.freeze | 2 +- ...ple_Apps_returns_Not_Found_response.freeze | 2 +- ...e_Multiple_Apps_returns_OK_response.freeze | 2 +- ...ete_Multiple_Apps_returns_OK_response.yaml | 8 +- ...oy_App_returns_Bad_Request_response.freeze | 1 + ...ploy_App_returns_Bad_Request_response.yaml | 0 ...Deploy_App_returns_Created_response.freeze | 1 + ...o_Deploy_App_returns_Created_response.yaml | 10 +- ...ploy_App_returns_Not_Found_response.freeze | 1 + ...Deploy_App_returns_Not_Found_response.yaml | 0 ...le_App_returns_Bad_Request_response.freeze | 1 + ...able_App_returns_Bad_Request_response.yaml | 0 ...able_App_returns_Not_Found_response.freeze | 1 + ...isable_App_returns_Not_Found_response.yaml | 0 ...rio_Disable_App_returns_OK_response.freeze | 1 + ...nario_Disable_App_returns_OK_response.yaml | 10 +- ...et_App_returns_Bad_Request_response.freeze | 2 +- ..._Get_App_returns_Not_Found_response.freeze | 2 +- ...cenario_Get_App_returns_OK_response.freeze | 2 +- .../Scenario_Get_App_returns_OK_response.yaml | 12 +- ...nario_List_Apps_returns_OK_response.freeze | 2 +- ...cenario_List_Apps_returns_OK_response.yaml | 5 +- ...te_App_returns_Bad_Request_response.freeze | 2 +- ...date_App_returns_Bad_Request_response.yaml | 10 +- ...ario_Update_App_returns_OK_response.freeze | 2 +- ...enario_Update_App_returns_OK_response.yaml | 14 +- tests/scenarios/features/v2/apps.feature | 59 ++++- tests/scenarios/features/v2/given.json | 2 +- tests/scenarios/features/v2/undo.json | 4 +- 57 files changed, 607 insertions(+), 756 deletions(-) delete mode 100644 api/datadogV2/api_app_deployment.go delete mode 100644 api/datadogV2/model_app_builder_error.go delete mode 100644 api/datadogV2/model_app_builder_error_errors_items.go delete mode 100644 api/datadogV2/model_app_builder_error_errors_items_source.go create mode 100644 api/datadogV2/model_get_app_version_parameter.go create mode 100644 api/datadogV2/model_get_app_version_parameter_constants.go rename examples/v2/{app-deployment => apps}/DeployApp.go (75%) rename examples/v2/{app-deployment => apps}/DisableApp.go (75%) delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Bad_Request_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Created_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Not_Found_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Bad_Request_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Not_Found_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_OK_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Bad_Request_response.freeze rename tests/scenarios/cassettes/TestScenarios/v2/{Feature_App_Deployment => Feature_Apps}/Scenario_Deploy_App_returns_Bad_Request_response.yaml (100%) create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Created_response.freeze rename tests/scenarios/cassettes/TestScenarios/v2/{Feature_App_Deployment => Feature_Apps}/Scenario_Deploy_App_returns_Created_response.yaml (70%) create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Not_Found_response.freeze rename tests/scenarios/cassettes/TestScenarios/v2/{Feature_App_Deployment => Feature_Apps}/Scenario_Deploy_App_returns_Not_Found_response.yaml (100%) create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_Bad_Request_response.freeze rename tests/scenarios/cassettes/TestScenarios/v2/{Feature_App_Deployment => Feature_Apps}/Scenario_Disable_App_returns_Bad_Request_response.yaml (100%) create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_Not_Found_response.freeze rename tests/scenarios/cassettes/TestScenarios/v2/{Feature_App_Deployment => Feature_Apps}/Scenario_Disable_App_returns_Not_Found_response.yaml (100%) create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_OK_response.freeze rename tests/scenarios/cassettes/TestScenarios/v2/{Feature_App_Deployment => Feature_Apps}/Scenario_Disable_App_returns_OK_response.yaml (72%) diff --git a/.apigentools-info b/.apigentools-info index 0ac30ddc4c4..ff9f6f68bb8 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-19 07:26:27.191303", - "spec_repo_commit": "5dd2cbe4" + "regenerated": "2024-12-24 22:17:56.403712", + "spec_repo_commit": "e7f6813c" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-19 07:26:27.207255", - "spec_repo_commit": "5dd2cbe4" + "regenerated": "2024-12-24 22:17:56.418785", + "spec_repo_commit": "e7f6813c" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3480f9db3a7..741462ccaca 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1615,34 +1615,6 @@ components: type: string x-enum-varnames: - apm_retention_filter - AppBuilderError: - description: The definition of `AppBuilderError` object. - properties: - errors: - description: The `AppBuilderError` `errors`. - items: - $ref: '#/components/schemas/AppBuilderErrorErrorsItems' - type: array - type: object - AppBuilderErrorErrorsItems: - description: The definition of `AppBuilderErrorErrorsItems` object. - properties: - detail: - description: The `items` `detail`. - type: string - source: - $ref: '#/components/schemas/AppBuilderErrorErrorsItemsSource' - type: object - AppBuilderErrorErrorsItemsSource: - description: The definition of `AppBuilderErrorErrorsItemsSource` object. - properties: - parameter: - description: The `source` `parameter`. - type: string - pointer: - description: The `source` `pointer`. - type: string - type: object AppBuilderEvent: additionalProperties: {} description: The definition of `AppBuilderEvent` object. @@ -11928,6 +11900,22 @@ components: deployment: $ref: '#/components/schemas/DeploymentRelationship' type: object + GetAppVersionParameter: + description: The version selector definition used in the Get App endpoint + oneOf: + - $ref: '#/components/schemas/GetAppVersionParameterConstants' + - format: int64 + minimum: 0 + type: integer + GetAppVersionParameterConstants: + description: Constants that always selects a particular version of an app + enum: + - latest + - deployed + type: string + x-enum-varnames: + - LATEST + - DEPLOYED GetDataDeletionsResponseBody: description: The response from the get data deletion requests endpoint. properties: @@ -30153,19 +30141,19 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/AppBuilderError' + $ref: '#/components/schemas/JSONAPIErrorResponse' description: Bad Request '403': content: application/json: schema: - $ref: '#/components/schemas/AppBuilderError' - description: Forbidden, e.g. missing permissions to delete one or more apps + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden '404': content: application/json: schema: - $ref: '#/components/schemas/AppBuilderError' + $ref: '#/components/schemas/JSONAPIErrorResponse' description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' @@ -30196,19 +30184,19 @@ paths: schema: format: int64 type: integer - - description: The `AppsFilter` `user_name`. + - description: Filter apps by the app creator. Usually the user's email in: query name: filter[user_name] required: false schema: type: string - - description: The `AppsFilter` `user_uuid`. + - description: Filter apps by the app creator's UUID in: query name: filter[user_uuid] required: false schema: type: string - - description: The `AppsFilter` `name`. + - description: Filter by app name in: query name: filter[name] required: false @@ -30220,25 +30208,32 @@ paths: required: false schema: type: string - - description: The `AppsFilter` `deployed`. + - description: Filter apps by whether they are published in: query name: filter[deployed] required: false schema: type: boolean - - description: The `AppsFilter` `tags`. + - description: Filter apps by tags in: query name: filter[tags] required: false schema: type: string - - description: The `AppsFilter` `favorite`. + - description: Filter apps by whether you have added them to your favorites in: query name: filter[favorite] required: false schema: type: boolean - - explode: false + - description: Filter apps by whether they are enabled for self-service + in: query + name: filter[self_service] + required: false + schema: + type: boolean + - description: The fields and direction to sort apps by + explode: false in: query name: sort required: false @@ -30258,13 +30253,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/AppBuilderError' - description: Bad Request, e.g. invalid sort parameter + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request '403': content: application/json: schema: - $ref: '#/components/schemas/AppBuilderError' + $ref: '#/components/schemas/JSONAPIErrorResponse' description: Forbidden '429': $ref: '#/components/responses/TooManyRequestsResponse' @@ -30297,15 +30292,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/AppBuilderError' + $ref: '#/components/schemas/JSONAPIErrorResponse' description: Bad Request '403': content: application/json: schema: - $ref: '#/components/schemas/AppBuilderError' - description: Forbidden, e.g. missing required permissions to a connection - or workflow used in the app + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden '429': $ref: '#/components/responses/TooManyRequestsResponse' summary: Create App @@ -30340,25 +30334,25 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/AppBuilderError' + $ref: '#/components/schemas/JSONAPIErrorResponse' description: Bad Request '403': content: application/json: schema: - $ref: '#/components/schemas/AppBuilderError' + $ref: '#/components/schemas/JSONAPIErrorResponse' description: Forbidden '404': content: application/json: schema: - $ref: '#/components/schemas/AppBuilderError' + $ref: '#/components/schemas/JSONAPIErrorResponse' description: Not Found '410': content: application/json: schema: - $ref: '#/components/schemas/AppBuilderError' + $ref: '#/components/schemas/JSONAPIErrorResponse' description: Gone '429': $ref: '#/components/responses/TooManyRequestsResponse' @@ -30380,6 +30374,11 @@ paths: required: true schema: type: string + - in: query + name: version + required: false + schema: + $ref: '#/components/schemas/GetAppVersionParameter' responses: '200': content: @@ -30391,19 +30390,19 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/AppBuilderError' + $ref: '#/components/schemas/JSONAPIErrorResponse' description: Bad Request '403': content: application/json: schema: - $ref: '#/components/schemas/AppBuilderError' + $ref: '#/components/schemas/JSONAPIErrorResponse' description: Forbidden '404': content: application/json: schema: - $ref: '#/components/schemas/AppBuilderError' + $ref: '#/components/schemas/JSONAPIErrorResponse' description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' @@ -30443,15 +30442,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/AppBuilderError' + $ref: '#/components/schemas/JSONAPIErrorResponse' description: Bad Request '403': content: application/json: schema: - $ref: '#/components/schemas/AppBuilderError' - description: Forbidden, e.g. missing required permissions to a connection - or workflow used in the app + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden '429': $ref: '#/components/responses/TooManyRequestsResponse' summary: Update App @@ -30486,25 +30484,25 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/AppBuilderError' + $ref: '#/components/schemas/JSONAPIErrorResponse' description: Bad Request '403': content: application/json: schema: - $ref: '#/components/schemas/AppBuilderError' + $ref: '#/components/schemas/JSONAPIErrorResponse' description: Forbidden '404': content: application/json: schema: - $ref: '#/components/schemas/AppBuilderError' + $ref: '#/components/schemas/JSONAPIErrorResponse' description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' summary: Disable App tags: - - App Deployment + - Apps x-permission: operator: OR permissions: @@ -30531,25 +30529,25 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/AppBuilderError' + $ref: '#/components/schemas/JSONAPIErrorResponse' description: Bad Request '403': content: application/json: schema: - $ref: '#/components/schemas/AppBuilderError' + $ref: '#/components/schemas/JSONAPIErrorResponse' description: Forbidden '404': content: application/json: schema: - $ref: '#/components/schemas/AppBuilderError' + $ref: '#/components/schemas/JSONAPIErrorResponse' description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' summary: Deploy App tags: - - App Deployment + - Apps x-permission: operator: OR permissions: @@ -46584,9 +46582,10 @@ tags: externalDocs: url: https://docs.datadoghq.com/integrations/amazon_web_services/#log-collection name: AWS Logs Integration -- description: Deploy and disable apps in App Builder. - name: App Deployment -- description: Create, read, update, and delete apps in App Builder. +- description: 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. name: Apps - description: Search your Audit Logs events over HTTP. name: Audit diff --git a/api/datadog/configuration.go b/api/datadog/configuration.go index c844575acae..e7003bc5442 100644 --- a/api/datadog/configuration.go +++ b/api/datadog/configuration.go @@ -331,11 +331,11 @@ 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.UpdateApp": false, - "v2.DeployApp": false, - "v2.DisableApp": false, "v2.GetActiveBillingDimensions": false, "v2.GetBillingDimensionMapping": false, "v2.GetMonthlyCostAttribution": false, diff --git a/api/datadogV2/api_app_deployment.go b/api/datadogV2/api_app_deployment.go deleted file mode 100644 index 6e5e20ab6e4..00000000000 --- a/api/datadogV2/api_app_deployment.go +++ /dev/null @@ -1,203 +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 ( - _context "context" - _fmt "fmt" - _log "log" - _nethttp "net/http" - _neturl "net/url" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// AppDeploymentApi service type -type AppDeploymentApi datadog.Service - -// DeployApp Deploy App. -// Deploy (publish) an app by ID -func (a *AppDeploymentApi) 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.AppDeploymentApi.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 AppBuilderError - 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 *AppDeploymentApi) 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.AppDeploymentApi.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 AppBuilderError - 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 -} - -// NewAppDeploymentApi Returns NewAppDeploymentApi. -func NewAppDeploymentApi(client *datadog.APIClient) *AppDeploymentApi { - return &AppDeploymentApi{ - Client: client, - } -} diff --git a/api/datadogV2/api_apps.go b/api/datadogV2/api_apps.go index 4c8652a6f84..567b7f48952 100644 --- a/api/datadogV2/api_apps.go +++ b/api/datadogV2/api_apps.go @@ -77,7 +77,7 @@ func (a *AppsApi) CreateApp(ctx _context.Context, body CreateAppRequest) (Create ErrorMessage: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 { - var v AppBuilderError + var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { return localVarReturnValue, localVarHTTPResponse, newErr @@ -166,7 +166,7 @@ func (a *AppsApi) DeleteApp(ctx _context.Context, appId string) (DeleteAppRespon ErrorMessage: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 410 { - var v AppBuilderError + var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { return localVarReturnValue, localVarHTTPResponse, newErr @@ -257,7 +257,7 @@ func (a *AppsApi) DeleteApps(ctx _context.Context, body DeleteAppsRequest) (Dele ErrorMessage: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { - var v AppBuilderError + var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { return localVarReturnValue, localVarHTTPResponse, newErr @@ -288,15 +288,218 @@ 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 *GetAppVersionParameter +} + +// NewGetAppOptionalParameters creates an empty struct for parameters. +func NewGetAppOptionalParameters() *GetAppOptionalParameters { + this := GetAppOptionalParameters{} + return &this +} + +// WithVersion sets the corresponding parameter name and returns the struct. +func (r *GetAppOptionalParameters) WithVersion(version GetAppVersionParameter) *GetAppOptionalParameters { + r.Version = &version + return r +} + // GetApp Get App. // Get the full definition of an app by ID -func (a *AppsApi) GetApp(ctx _context.Context, appId string) (GetAppResponse, *_nethttp.Response, error) { +func (a *AppsApi) GetApp(ctx _context.Context, appId string, o ...GetAppOptionalParameters) (GetAppResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarReturnValue GetAppResponse + optionalParams GetAppOptionalParameters ) + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetAppOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + operationId := "v2.GetApp" isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) if !isOperationEnabled { @@ -317,6 +520,9 @@ func (a *AppsApi) GetApp(ctx _context.Context, appId string) (GetAppResponse, *_ localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if optionalParams.Version != nil { + localVarQueryParams.Add("version", datadog.ParameterToString(*optionalParams.Version, "")) + } localVarHeaderParams["Accept"] = "application/json" datadog.SetAuthKeys( @@ -346,7 +552,7 @@ func (a *AppsApi) GetApp(ctx _context.Context, appId string) (GetAppResponse, *_ ErrorMessage: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { - var v AppBuilderError + var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { return localVarReturnValue, localVarHTTPResponse, newErr @@ -379,16 +585,17 @@ func (a *AppsApi) GetApp(ctx _context.Context, appId string) (GetAppResponse, *_ // ListAppsOptionalParameters holds optional parameters for ListApps. type ListAppsOptionalParameters struct { - Limit *int64 - Page *int64 - FilterUserName *string - FilterUserUuid *string - FilterName *string - FilterQuery *string - FilterDeployed *bool - FilterTags *string - FilterFavorite *bool - Sort *[]AppsSortField + Limit *int64 + Page *int64 + FilterUserName *string + FilterUserUuid *string + FilterName *string + FilterQuery *string + FilterDeployed *bool + FilterTags *string + FilterFavorite *bool + FilterSelfService *bool + Sort *[]AppsSortField } // NewListAppsOptionalParameters creates an empty struct for parameters. @@ -451,6 +658,12 @@ func (r *ListAppsOptionalParameters) WithFilterFavorite(filterFavorite bool) *Li return r } +// WithFilterSelfService sets the corresponding parameter name and returns the struct. +func (r *ListAppsOptionalParameters) WithFilterSelfService(filterSelfService bool) *ListAppsOptionalParameters { + r.FilterSelfService = &filterSelfService + return r +} + // WithSort sets the corresponding parameter name and returns the struct. func (r *ListAppsOptionalParameters) WithSort(sort []AppsSortField) *ListAppsOptionalParameters { r.Sort = &sort @@ -520,6 +733,9 @@ func (a *AppsApi) ListApps(ctx _context.Context, o ...ListAppsOptionalParameters if optionalParams.FilterFavorite != nil { localVarQueryParams.Add("filter[favorite]", datadog.ParameterToString(*optionalParams.FilterFavorite, "")) } + if optionalParams.FilterSelfService != nil { + localVarQueryParams.Add("filter[self_service]", datadog.ParameterToString(*optionalParams.FilterSelfService, "")) + } if optionalParams.Sort != nil { localVarQueryParams.Add("sort", datadog.ParameterToString(*optionalParams.Sort, "csv")) } @@ -552,7 +768,7 @@ func (a *AppsApi) ListApps(ctx _context.Context, o ...ListAppsOptionalParameters ErrorMessage: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 { - var v AppBuilderError + var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { return localVarReturnValue, localVarHTTPResponse, newErr @@ -644,7 +860,7 @@ func (a *AppsApi) UpdateApp(ctx _context.Context, appId string, body UpdateAppRe ErrorMessage: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 { - var v AppBuilderError + var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { return localVarReturnValue, localVarHTTPResponse, newErr diff --git a/api/datadogV2/doc.go b/api/datadogV2/doc.go index 72016bb2933..3d587842aaf 100644 --- a/api/datadogV2/doc.go +++ b/api/datadogV2/doc.go @@ -22,11 +22,11 @@ // - [AWSIntegrationApi.ListAWSNamespaces] // - [AWSIntegrationApi.UpdateAWSAccount] // - [AWSLogsIntegrationApi.ListAWSLogsServices] -// - [AppDeploymentApi.DeployApp] -// - [AppDeploymentApi.DisableApp] // - [AppsApi.CreateApp] // - [AppsApi.DeleteApp] // - [AppsApi.DeleteApps] +// - [AppsApi.DeployApp] +// - [AppsApi.DisableApp] // - [AppsApi.GetApp] // - [AppsApi.ListApps] // - [AppsApi.UpdateApp] diff --git a/api/datadogV2/model_app_builder_error.go b/api/datadogV2/model_app_builder_error.go deleted file mode 100644 index 5103942e3a1..00000000000 --- a/api/datadogV2/model_app_builder_error.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" -) - -// AppBuilderError The definition of `AppBuilderError` object. -type AppBuilderError struct { - // The `AppBuilderError` `errors`. - Errors []AppBuilderErrorErrorsItems `json:"errors,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:"-"` -} - -// NewAppBuilderError instantiates a new AppBuilderError 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 NewAppBuilderError() *AppBuilderError { - this := AppBuilderError{} - return &this -} - -// NewAppBuilderErrorWithDefaults instantiates a new AppBuilderError 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 NewAppBuilderErrorWithDefaults() *AppBuilderError { - this := AppBuilderError{} - return &this -} - -// GetErrors returns the Errors field value if set, zero value otherwise. -func (o *AppBuilderError) GetErrors() []AppBuilderErrorErrorsItems { - if o == nil || o.Errors == nil { - var ret []AppBuilderErrorErrorsItems - return ret - } - return o.Errors -} - -// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AppBuilderError) GetErrorsOk() (*[]AppBuilderErrorErrorsItems, bool) { - if o == nil || o.Errors == nil { - return nil, false - } - return &o.Errors, true -} - -// HasErrors returns a boolean if a field has been set. -func (o *AppBuilderError) HasErrors() bool { - return o != nil && o.Errors != nil -} - -// SetErrors gets a reference to the given []AppBuilderErrorErrorsItems and assigns it to the Errors field. -func (o *AppBuilderError) SetErrors(v []AppBuilderErrorErrorsItems) { - o.Errors = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o AppBuilderError) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Errors != nil { - toSerialize["errors"] = o.Errors - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *AppBuilderError) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Errors []AppBuilderErrorErrorsItems `json:"errors,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{"errors"}) - } else { - return err - } - o.Errors = all.Errors - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_app_builder_error_errors_items.go b/api/datadogV2/model_app_builder_error_errors_items.go deleted file mode 100644 index 5fb11314e74..00000000000 --- a/api/datadogV2/model_app_builder_error_errors_items.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" -) - -// AppBuilderErrorErrorsItems The definition of `AppBuilderErrorErrorsItems` object. -type AppBuilderErrorErrorsItems struct { - // The `items` `detail`. - Detail *string `json:"detail,omitempty"` - // The definition of `AppBuilderErrorErrorsItemsSource` object. - Source *AppBuilderErrorErrorsItemsSource `json:"source,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:"-"` -} - -// NewAppBuilderErrorErrorsItems instantiates a new AppBuilderErrorErrorsItems 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 NewAppBuilderErrorErrorsItems() *AppBuilderErrorErrorsItems { - this := AppBuilderErrorErrorsItems{} - return &this -} - -// NewAppBuilderErrorErrorsItemsWithDefaults instantiates a new AppBuilderErrorErrorsItems 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 NewAppBuilderErrorErrorsItemsWithDefaults() *AppBuilderErrorErrorsItems { - this := AppBuilderErrorErrorsItems{} - return &this -} - -// GetDetail returns the Detail field value if set, zero value otherwise. -func (o *AppBuilderErrorErrorsItems) GetDetail() string { - if o == nil || o.Detail == nil { - var ret string - return ret - } - return *o.Detail -} - -// GetDetailOk returns a tuple with the Detail field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AppBuilderErrorErrorsItems) GetDetailOk() (*string, bool) { - if o == nil || o.Detail == nil { - return nil, false - } - return o.Detail, true -} - -// HasDetail returns a boolean if a field has been set. -func (o *AppBuilderErrorErrorsItems) HasDetail() bool { - return o != nil && o.Detail != nil -} - -// SetDetail gets a reference to the given string and assigns it to the Detail field. -func (o *AppBuilderErrorErrorsItems) SetDetail(v string) { - o.Detail = &v -} - -// GetSource returns the Source field value if set, zero value otherwise. -func (o *AppBuilderErrorErrorsItems) GetSource() AppBuilderErrorErrorsItemsSource { - if o == nil || o.Source == nil { - var ret AppBuilderErrorErrorsItemsSource - return ret - } - return *o.Source -} - -// GetSourceOk returns a tuple with the Source field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AppBuilderErrorErrorsItems) GetSourceOk() (*AppBuilderErrorErrorsItemsSource, bool) { - if o == nil || o.Source == nil { - return nil, false - } - return o.Source, true -} - -// HasSource returns a boolean if a field has been set. -func (o *AppBuilderErrorErrorsItems) HasSource() bool { - return o != nil && o.Source != nil -} - -// SetSource gets a reference to the given AppBuilderErrorErrorsItemsSource and assigns it to the Source field. -func (o *AppBuilderErrorErrorsItems) SetSource(v AppBuilderErrorErrorsItemsSource) { - o.Source = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o AppBuilderErrorErrorsItems) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Detail != nil { - toSerialize["detail"] = o.Detail - } - if o.Source != nil { - toSerialize["source"] = o.Source - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *AppBuilderErrorErrorsItems) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Detail *string `json:"detail,omitempty"` - Source *AppBuilderErrorErrorsItemsSource `json:"source,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{"detail", "source"}) - } else { - return err - } - - hasInvalidField := false - o.Detail = all.Detail - if all.Source != nil && all.Source.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Source = all.Source - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_app_builder_error_errors_items_source.go b/api/datadogV2/model_app_builder_error_errors_items_source.go deleted file mode 100644 index 9551347ecdc..00000000000 --- a/api/datadogV2/model_app_builder_error_errors_items_source.go +++ /dev/null @@ -1,137 +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" -) - -// AppBuilderErrorErrorsItemsSource The definition of `AppBuilderErrorErrorsItemsSource` object. -type AppBuilderErrorErrorsItemsSource struct { - // The `source` `parameter`. - Parameter *string `json:"parameter,omitempty"` - // The `source` `pointer`. - Pointer *string `json:"pointer,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:"-"` -} - -// NewAppBuilderErrorErrorsItemsSource instantiates a new AppBuilderErrorErrorsItemsSource 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 NewAppBuilderErrorErrorsItemsSource() *AppBuilderErrorErrorsItemsSource { - this := AppBuilderErrorErrorsItemsSource{} - return &this -} - -// NewAppBuilderErrorErrorsItemsSourceWithDefaults instantiates a new AppBuilderErrorErrorsItemsSource 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 NewAppBuilderErrorErrorsItemsSourceWithDefaults() *AppBuilderErrorErrorsItemsSource { - this := AppBuilderErrorErrorsItemsSource{} - return &this -} - -// GetParameter returns the Parameter field value if set, zero value otherwise. -func (o *AppBuilderErrorErrorsItemsSource) GetParameter() string { - if o == nil || o.Parameter == nil { - var ret string - return ret - } - return *o.Parameter -} - -// GetParameterOk returns a tuple with the Parameter field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AppBuilderErrorErrorsItemsSource) GetParameterOk() (*string, bool) { - if o == nil || o.Parameter == nil { - return nil, false - } - return o.Parameter, true -} - -// HasParameter returns a boolean if a field has been set. -func (o *AppBuilderErrorErrorsItemsSource) HasParameter() bool { - return o != nil && o.Parameter != nil -} - -// SetParameter gets a reference to the given string and assigns it to the Parameter field. -func (o *AppBuilderErrorErrorsItemsSource) SetParameter(v string) { - o.Parameter = &v -} - -// GetPointer returns the Pointer field value if set, zero value otherwise. -func (o *AppBuilderErrorErrorsItemsSource) GetPointer() string { - if o == nil || o.Pointer == nil { - var ret string - return ret - } - return *o.Pointer -} - -// GetPointerOk returns a tuple with the Pointer field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AppBuilderErrorErrorsItemsSource) GetPointerOk() (*string, bool) { - if o == nil || o.Pointer == nil { - return nil, false - } - return o.Pointer, true -} - -// HasPointer returns a boolean if a field has been set. -func (o *AppBuilderErrorErrorsItemsSource) HasPointer() bool { - return o != nil && o.Pointer != nil -} - -// SetPointer gets a reference to the given string and assigns it to the Pointer field. -func (o *AppBuilderErrorErrorsItemsSource) SetPointer(v string) { - o.Pointer = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o AppBuilderErrorErrorsItemsSource) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Parameter != nil { - toSerialize["parameter"] = o.Parameter - } - if o.Pointer != nil { - toSerialize["pointer"] = o.Pointer - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *AppBuilderErrorErrorsItemsSource) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Parameter *string `json:"parameter,omitempty"` - Pointer *string `json:"pointer,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{"parameter", "pointer"}) - } else { - return err - } - o.Parameter = all.Parameter - o.Pointer = all.Pointer - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_get_app_version_parameter.go b/api/datadogV2/model_get_app_version_parameter.go new file mode 100644 index 00000000000..915cb5180e3 --- /dev/null +++ b/api/datadogV2/model_get_app_version_parameter.go @@ -0,0 +1,105 @@ +// 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" +) + +// GetAppVersionParameter - The version selector definition used in the Get App endpoint +type GetAppVersionParameter struct { + GetAppVersionParameterConstants *GetAppVersionParameterConstants + Int64 *int64 + + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} +} + +// GetAppVersionParameterConstantsAsGetAppVersionParameter is a convenience function that returns GetAppVersionParameterConstants wrapped in GetAppVersionParameter. +func GetAppVersionParameterConstantsAsGetAppVersionParameter(v *GetAppVersionParameterConstants) GetAppVersionParameter { + return GetAppVersionParameter{GetAppVersionParameterConstants: v} +} + +// Int64AsGetAppVersionParameter is a convenience function that returns int64 wrapped in GetAppVersionParameter. +func Int64AsGetAppVersionParameter(v *int64) GetAppVersionParameter { + return GetAppVersionParameter{Int64: v} +} + +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *GetAppVersionParameter) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into GetAppVersionParameterConstants + err = datadog.Unmarshal(data, &obj.GetAppVersionParameterConstants) + if err == nil { + if obj.GetAppVersionParameterConstants != nil { + jsonGetAppVersionParameterConstants, _ := datadog.Marshal(obj.GetAppVersionParameterConstants) + if string(jsonGetAppVersionParameterConstants) == "{}" && string(data) != "{}" { // empty struct + obj.GetAppVersionParameterConstants = nil + } else { + match++ + } + } else { + obj.GetAppVersionParameterConstants = nil + } + } else { + obj.GetAppVersionParameterConstants = nil + } + + // try to unmarshal data into Int64 + err = datadog.Unmarshal(data, &obj.Int64) + if err == nil { + if obj.Int64 != nil { + jsonInt64, _ := datadog.Marshal(obj.Int64) + if string(jsonInt64) == "{}" { // empty struct + obj.Int64 = nil + } else { + match++ + } + } else { + obj.Int64 = nil + } + } else { + obj.Int64 = nil + } + + if match != 1 { // more than 1 match + // reset to nil + obj.GetAppVersionParameterConstants = nil + obj.Int64 = nil + return datadog.Unmarshal(data, &obj.UnparsedObject) + } + return nil // exactly one match +} + +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj GetAppVersionParameter) MarshalJSON() ([]byte, error) { + if obj.GetAppVersionParameterConstants != nil { + return datadog.Marshal(&obj.GetAppVersionParameterConstants) + } + + if obj.Int64 != nil { + return datadog.Marshal(&obj.Int64) + } + + if obj.UnparsedObject != nil { + return datadog.Marshal(obj.UnparsedObject) + } + return nil, nil // no data in oneOf schemas +} + +// GetActualInstance returns the actual instance. +func (obj *GetAppVersionParameter) GetActualInstance() interface{} { + if obj.GetAppVersionParameterConstants != nil { + return obj.GetAppVersionParameterConstants + } + + if obj.Int64 != nil { + return obj.Int64 + } + + // all schemas are nil + return nil +} diff --git a/api/datadogV2/model_get_app_version_parameter_constants.go b/api/datadogV2/model_get_app_version_parameter_constants.go new file mode 100644 index 00000000000..20ce4795c49 --- /dev/null +++ b/api/datadogV2/model_get_app_version_parameter_constants.go @@ -0,0 +1,66 @@ +// 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" +) + +// GetAppVersionParameterConstants Constants that always selects a particular version of an app +type GetAppVersionParameterConstants string + +// List of GetAppVersionParameterConstants. +const ( + GETAPPVERSIONPARAMETERCONSTANTS_LATEST GetAppVersionParameterConstants = "latest" + GETAPPVERSIONPARAMETERCONSTANTS_DEPLOYED GetAppVersionParameterConstants = "deployed" +) + +var allowedGetAppVersionParameterConstantsEnumValues = []GetAppVersionParameterConstants{ + GETAPPVERSIONPARAMETERCONSTANTS_LATEST, + GETAPPVERSIONPARAMETERCONSTANTS_DEPLOYED, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *GetAppVersionParameterConstants) GetAllowedValues() []GetAppVersionParameterConstants { + return allowedGetAppVersionParameterConstantsEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *GetAppVersionParameterConstants) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = GetAppVersionParameterConstants(value) + return nil +} + +// NewGetAppVersionParameterConstantsFromValue returns a pointer to a valid GetAppVersionParameterConstants +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewGetAppVersionParameterConstantsFromValue(v string) (*GetAppVersionParameterConstants, error) { + ev := GetAppVersionParameterConstants(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for GetAppVersionParameterConstants: valid values are %v", v, allowedGetAppVersionParameterConstantsEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v GetAppVersionParameterConstants) IsValid() bool { + for _, existing := range allowedGetAppVersionParameterConstantsEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetAppVersionParameterConstants value. +func (v GetAppVersionParameterConstants) Ptr() *GetAppVersionParameterConstants { + return &v +} diff --git a/examples/v2/app-deployment/DeployApp.go b/examples/v2/apps/DeployApp.go similarity index 75% rename from examples/v2/app-deployment/DeployApp.go rename to examples/v2/apps/DeployApp.go index 476aa6a7b00..f7c4d84bd0d 100644 --- a/examples/v2/app-deployment/DeployApp.go +++ b/examples/v2/apps/DeployApp.go @@ -20,14 +20,14 @@ func main() { configuration := datadog.NewConfiguration() configuration.SetUnstableOperationEnabled("v2.DeployApp", true) apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewAppDeploymentApi(apiClient) + api := datadogV2.NewAppsApi(apiClient) resp, r, err := api.DeployApp(ctx, AppDataID) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AppDeploymentApi.DeployApp`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `AppsApi.DeployApp`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `AppDeploymentApi.DeployApp`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `AppsApi.DeployApp`:\n%s\n", responseContent) } diff --git a/examples/v2/app-deployment/DisableApp.go b/examples/v2/apps/DisableApp.go similarity index 75% rename from examples/v2/app-deployment/DisableApp.go rename to examples/v2/apps/DisableApp.go index b5757e9c6e2..8d5c5da9cec 100644 --- a/examples/v2/app-deployment/DisableApp.go +++ b/examples/v2/apps/DisableApp.go @@ -20,14 +20,14 @@ func main() { configuration := datadog.NewConfiguration() configuration.SetUnstableOperationEnabled("v2.DisableApp", true) apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewAppDeploymentApi(apiClient) + api := datadogV2.NewAppsApi(apiClient) resp, r, err := api.DisableApp(ctx, AppDataID) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AppDeploymentApi.DisableApp`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `AppsApi.DisableApp`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `AppDeploymentApi.DisableApp`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `AppsApi.DisableApp`:\n%s\n", responseContent) } diff --git a/examples/v2/apps/GetApp.go b/examples/v2/apps/GetApp.go index 188ee704cb3..cbe1ebba812 100644 --- a/examples/v2/apps/GetApp.go +++ b/examples/v2/apps/GetApp.go @@ -21,7 +21,7 @@ func main() { configuration.SetUnstableOperationEnabled("v2.GetApp", true) apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewAppsApi(apiClient) - resp, r, err := api.GetApp(ctx, AppDataID) + resp, r, err := api.GetApp(ctx, AppDataID, *datadogV2.NewGetAppOptionalParameters()) if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `AppsApi.GetApp`: %v\n", err) diff --git a/tests/scenarios/api_mappings.go b/tests/scenarios/api_mappings.go index ed9068dad14..a47bf7ff0cf 100644 --- a/tests/scenarios/api_mappings.go +++ b/tests/scenarios/api_mappings.go @@ -49,7 +49,6 @@ var apiMappings = map[string]map[string]reflect.Value{ "SpansMetricsApi": reflect.ValueOf(datadogV2.NewSpansMetricsApi), "APMRetentionFiltersApi": reflect.ValueOf(datadogV2.NewAPMRetentionFiltersApi), "AppsApi": reflect.ValueOf(datadogV2.NewAppsApi), - "AppDeploymentApi": reflect.ValueOf(datadogV2.NewAppDeploymentApi), "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_Deployment/Scenario_Deploy_App_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Bad_Request_response.freeze deleted file mode 100644 index 70eab29e2a7..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Bad_Request_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-10T19:57:35.320Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Created_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Created_response.freeze deleted file mode 100644 index 12cd09b1d29..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Created_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-12T20:29:22.668Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Not_Found_response.freeze deleted file mode 100644 index c11fe09d7f4..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Not_Found_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-10T19:57:35.984Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Bad_Request_response.freeze deleted file mode 100644 index bf3af7629d0..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Bad_Request_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-10T19:57:36.091Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Not_Found_response.freeze deleted file mode 100644 index 8dc6b57d756..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Not_Found_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-10T19:57:36.179Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_OK_response.freeze deleted file mode 100644 index 883ce61def2..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2024-12-12T20:29:23.546Z \ No newline at end of file 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 index 6dfadcf607a..a188f565172 100644 --- 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 @@ -1 +1 @@ -2024-12-12T20:29:24.182Z \ No newline at end of file +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_App_Created_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_App_Created_response.yaml index dc4df561a90..4fd41b5c89a 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_App_Created_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_App_Created_response.yaml @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"data":{"id":"2d9dd18e-c574-454c-8d43-3045b731d6a2","type":"appDefinitions"}}' + body: '{"data":{"id":"02c52f8c-78d9-4c14-ac27-b0bcac36ce74","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/2d9dd18e-c574-454c-8d43-3045b731d6a2 + url: https://api.datadoghq.com/api/v2/app-builder/apps/02c52f8c-78d9-4c14-ac27-b0bcac36ce74 response: - body: '{"data":{"id":"2d9dd18e-c574-454c-8d43-3045b731d6a2","type":"appDefinitions"}}' + body: '{"data":{"id":"02c52f8c-78d9-4c14-ac27-b0bcac36ce74","type":"appDefinitions"}}' code: 200 duration: 0ms headers: 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 index 5912dc34412..6bab6b51774 100644 --- 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 @@ -1 +1 @@ -2024-12-10T19:57:10.031Z \ No newline at end of file +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 index 3925b1b25d4..f2fcc286e7e 100644 --- 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 @@ -1 +1 @@ -2024-12-10T19:57:10.128Z \ No newline at end of file +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_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Not_Found_response.freeze index cfa34bd9baf..fb9dd880bf6 100644 --- 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 @@ -1 +1 @@ -2024-12-10T19:57:10.225Z \ No newline at end of file +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 index 81a74305aec..744eafd5016 100644 --- 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 @@ -1 +1 @@ -2024-12-12T20:29:24.659Z \ No newline at end of file +2024-12-20T20:39:19.083Z \ 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_Apps/Scenario_Delete_App_returns_OK_response.yaml index a6db0635c80..0b4fdba912a 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/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":"5cb67134-d7bd-4320-9cda-d79ec98cff4c","type":"appDefinitions"}}' + body: '{"data":{"id":"500bf715-77a5-4c1d-b4ef-0d181b071daf","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/5cb67134-d7bd-4320-9cda-d79ec98cff4c + url: https://api.datadoghq.com/api/v2/app-builder/apps/500bf715-77a5-4c1d-b4ef-0d181b071daf response: - body: '{"data":{"id":"5cb67134-d7bd-4320-9cda-d79ec98cff4c","type":"appDefinitions"}}' + body: '{"data":{"id":"500bf715-77a5-4c1d-b4ef-0d181b071daf","type":"appDefinitions"}}' code: 200 duration: 0ms headers: @@ -44,7 +44,7 @@ interactions: - application/json id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/5cb67134-d7bd-4320-9cda-d79ec98cff4c + url: https://api.datadoghq.com/api/v2/app-builder/apps/500bf715-77a5-4c1d-b4ef-0d181b071daf response: body: '{"errors":[{"detail":"app not found"}]}' code: 404 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 index 47c84b21b2b..c2c122a9a5c 100644 --- 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 @@ -1 +1 @@ -2024-12-10T19:57:10.845Z \ No newline at end of file +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_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.freeze index 0fbfbe769d0..7d397ad29fe 100644 --- 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 @@ -1 +1 @@ -2024-12-10T19:57:10.942Z \ No newline at end of file +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 index 5848314b797..d2346be1daa 100644 --- 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 @@ -1 +1 @@ -2024-12-12T20:29:25.239Z \ No newline at end of file +2024-12-20T20:39:19.785Z \ 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_Apps/Scenario_Delete_Multiple_Apps_returns_OK_response.yaml index 6a4e46ae1ab..018bec6d6f7 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/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":"61d36766-5d27-47ea-a3e7-aa7bd77b1da3","type":"appDefinitions"}}' + body: '{"data":{"id":"884b37bc-71b8-40bc-8967-12684ec7f3c4","type":"appDefinitions"}}' code: 201 duration: 0ms headers: @@ -21,7 +21,7 @@ interactions: status: 201 Created - request: body: | - {"data":[{"id":"61d36766-5d27-47ea-a3e7-aa7bd77b1da3","type":"appDefinitions"}]} + {"data":[{"id":"884b37bc-71b8-40bc-8967-12684ec7f3c4","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":"61d36766-5d27-47ea-a3e7-aa7bd77b1da3","type":"appDefinitions"}]}' + body: '{"data":[{"id":"884b37bc-71b8-40bc-8967-12684ec7f3c4","type":"appDefinitions"}]}' code: 200 duration: 0ms headers: @@ -47,7 +47,7 @@ interactions: - application/json id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/61d36766-5d27-47ea-a3e7-aa7bd77b1da3 + url: https://api.datadoghq.com/api/v2/app-builder/apps/884b37bc-71b8-40bc-8967-12684ec7f3c4 response: body: '{"errors":[{"detail":"app not found"}]}' code: 404 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 new file mode 100644 index 00000000000..3f65923d0af --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-12-20T20:39:20.190Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Bad_Request_response.yaml similarity index 100% rename from tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Bad_Request_response.yaml rename to tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Bad_Request_response.yaml 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 new file mode 100644 index 00000000000..2c4a1170293 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Created_response.freeze @@ -0,0 +1 @@ +2024-12-20T20:39:20.292Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Created_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Created_response.yaml similarity index 70% rename from tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Created_response.yaml rename to tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Created_response.yaml index 3a63b8bf16a..e58d8fe131b 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Created_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_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":"d9f547cd-bc8d-46be-b321-336856723728","type":"appDefinitions"}}' + body: '{"data":{"id":"290ad26d-6f5c-43b6-aef6-57b403d755e8","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/d9f547cd-bc8d-46be-b321-336856723728/deployment + url: https://api.datadoghq.com/api/v2/app-builder/apps/290ad26d-6f5c-43b6-aef6-57b403d755e8/deployment response: - body: '{"data":{"id":"7e1d147c-815e-46fa-8be0-278783311881","type":"deployment","attributes":{"app_version_id":"f8567809-049e-49c2-b5c0-e5cb0e8e0f5e"},"meta":{"created_at":"2024-12-12T20:29:23.253704Z","user_id":2320499,"user_uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","user_name":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}' + 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"}}}' 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/d9f547cd-bc8d-46be-b321-336856723728 + url: https://api.datadoghq.com/api/v2/app-builder/apps/290ad26d-6f5c-43b6-aef6-57b403d755e8 response: - body: '{"data":{"id":"d9f547cd-bc8d-46be-b321-336856723728","type":"appDefinitions"}}' + body: '{"data":{"id":"290ad26d-6f5c-43b6-aef6-57b403d755e8","type":"appDefinitions"}}' code: 200 duration: 0ms headers: 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 new file mode 100644 index 00000000000..f8f8e8f2692 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2024-12-20T20:39:20.929Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Not_Found_response.yaml similarity index 100% rename from tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Not_Found_response.yaml rename to tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Deploy_App_returns_Not_Found_response.yaml 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 new file mode 100644 index 00000000000..afd2bf6b9f8 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-12-20T20:39:21.034Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_Bad_Request_response.yaml similarity index 100% rename from tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Bad_Request_response.yaml rename to tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_Bad_Request_response.yaml 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 new file mode 100644 index 00000000000..7332f600132 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2024-12-20T20:39:21.129Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_Not_Found_response.yaml similarity index 100% rename from tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Not_Found_response.yaml rename to tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_Not_Found_response.yaml 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 new file mode 100644 index 00000000000..672904fce26 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_OK_response.freeze @@ -0,0 +1 @@ +2024-12-20T20:39:21.230Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_OK_response.yaml similarity index 72% rename from tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_OK_response.yaml rename to tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_App_returns_OK_response.yaml index 785dc99099d..41d12356ee4 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Disable_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":"6fdd1eb3-bd2c-4fe3-a3cf-38d0af4913ad","type":"appDefinitions"}}' + body: '{"data":{"id":"cfe9f7bc-e6e6-44e2-9d30-19b03ab871b5","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/6fdd1eb3-bd2c-4fe3-a3cf-38d0af4913ad/deployment + url: https://api.datadoghq.com/api/v2/app-builder/apps/cfe9f7bc-e6e6-44e2-9d30-19b03ab871b5/deployment response: - body: '{"data":{"id":"be510de8-34d8-45fc-830f-85c208a42920","type":"deployment","attributes":{"app_version_id":"00000000-0000-0000-0000-000000000000"},"meta":{"created_at":"2024-12-12T20:29:23.883145Z","user_id":2320499,"user_uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","user_name":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}' + 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"}}}' 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/6fdd1eb3-bd2c-4fe3-a3cf-38d0af4913ad + url: https://api.datadoghq.com/api/v2/app-builder/apps/cfe9f7bc-e6e6-44e2-9d30-19b03ab871b5 response: - body: '{"data":{"id":"6fdd1eb3-bd2c-4fe3-a3cf-38d0af4913ad","type":"appDefinitions"}}' + body: '{"data":{"id":"cfe9f7bc-e6e6-44e2-9d30-19b03ab871b5","type":"appDefinitions"}}' code: 200 duration: 0ms headers: 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 index 9a1b4493f05..8251b6eaf66 100644 --- 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 @@ -1 +1 @@ -2024-12-10T19:57:11.519Z \ No newline at end of file +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_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Not_Found_response.freeze index 0d42c760761..8bd6f7561c5 100644 --- 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 @@ -1 +1 @@ -2024-12-10T19:57:11.612Z \ No newline at end of file +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 index 7b34332de4d..e407ffe5d62 100644 --- 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 @@ -1 +1 @@ -2024-12-12T20:29:25.770Z \ No newline at end of file +2024-12-20T20:39:21.868Z \ 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_Apps/Scenario_Get_App_returns_OK_response.yaml index a3e85111b71..64f8f530ce8 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/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":"4937a273-31f5-4375-a9cf-b71eeb92f89c","type":"appDefinitions"}}' + body: '{"data":{"id":"e91c5ea9-5827-4008-b1e6-026d71f5c005","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/4937a273-31f5-4375-a9cf-b71eeb92f89c + url: https://api.datadoghq.com/api/v2/app-builder/apps/e91c5ea9-5827-4008-b1e6-026d71f5c005 response: - body: '{"data":{"id":"4937a273-31f5-4375-a9cf-b71eeb92f89c","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":"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 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":321813,"user_id":2320499,"user_uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","user_name":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","version":1,"updated_since_deployment":false,"created_at":"2024-12-12T20:29:25.869968Z","updated_at":"2024-12-12T20:29:25.869968Z","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":"2024-12-20T20:39:21.945448Z","updated_at":"2024-12-20T20:39:21.945448Z","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/4937a273-31f5-4375-a9cf-b71eeb92f89c + url: https://api.datadoghq.com/api/v2/app-builder/apps/e91c5ea9-5827-4008-b1e6-026d71f5c005 response: - body: '{"data":{"id":"4937a273-31f5-4375-a9cf-b71eeb92f89c","type":"appDefinitions"}}' + body: '{"data":{"id":"e91c5ea9-5827-4008-b1e6-026d71f5c005","type":"appDefinitions"}}' code: 200 duration: 0ms headers: 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 index 1cb2468dc44..b459860c38e 100644 --- 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 @@ -1 +1 @@ -2024-12-10T19:57:12.227Z \ No newline at end of file +2024-12-20T20:39:22.419Z \ 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_Apps/Scenario_List_Apps_returns_OK_response.yaml index 2839eeede75..73ce8869d8b 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_List_Apps_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_List_Apps_returns_OK_response.yaml @@ -9,8 +9,9 @@ interactions: method: GET url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"data":[{"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":1,"totalFilteredCount":1}}}' + body: '{"data":[{"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}}}' code: 200 duration: 0ms headers: 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 index 56162830354..fd24ecdb585 100644 --- 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 @@ -1 +1 @@ -2024-12-12T20:29:26.349Z \ No newline at end of file +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_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_Bad_Request_response.yaml index b2c8eadb0a3..967307e7c5b 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_Bad_Request_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/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":"9d2ee93b-6ac5-4b0e-abd8-829916f2365d","type":"appDefinitions"}}' + body: '{"data":{"id":"2eb79081-77f2-4082-93d5-fbb4d2291dc7","type":"appDefinitions"}}' code: 201 duration: 0ms headers: @@ -21,7 +21,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"rootInstanceName":""},"id":"9d2ee93b-6ac5-4b0e-abd8-829916f2365d","type":"appDefinitions"}} + {"data":{"attributes":{"rootInstanceName":""},"id":"2eb79081-77f2-4082-93d5-fbb4d2291dc7","type":"appDefinitions"}} form: {} headers: Accept: @@ -30,7 +30,7 @@ interactions: - application/json id: 1 method: PATCH - url: https://api.datadoghq.com/api/v2/app-builder/apps/9d2ee93b-6ac5-4b0e-abd8-829916f2365d + url: https://api.datadoghq.com/api/v2/app-builder/apps/2eb79081-77f2-4082-93d5-fbb4d2291dc7 response: body: '{"errors":[{"detail":"missing required field","source":{"pointer":"/data/attributes/rootInstanceName"}}]}' code: 400 @@ -47,9 +47,9 @@ interactions: - application/json id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/9d2ee93b-6ac5-4b0e-abd8-829916f2365d + url: https://api.datadoghq.com/api/v2/app-builder/apps/2eb79081-77f2-4082-93d5-fbb4d2291dc7 response: - body: '{"data":{"id":"9d2ee93b-6ac5-4b0e-abd8-829916f2365d","type":"appDefinitions"}}' + body: '{"data":{"id":"2eb79081-77f2-4082-93d5-fbb4d2291dc7","type":"appDefinitions"}}' code: 200 duration: 0ms headers: 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 index 9a62b802399..b873204c5af 100644 --- 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 @@ -1 +1 @@ -2024-12-12T20:29:26.986Z \ No newline at end of file +2024-12-20T20:39:23.050Z \ 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_Apps/Scenario_Update_App_returns_OK_response.yaml index 6db2ad9ef0b..20f1cae9b59 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/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":"5a5e6785-d3f8-41bf-9d5d-95a179362e02","type":"appDefinitions"}}' + body: '{"data":{"id":"22653158-3691-4a09-bbd9-f4197f14dd0c","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":"5a5e6785-d3f8-41bf-9d5d-95a179362e02","type":"appDefinitions"}} + {"data":{"attributes":{"name":"Updated Name","rootInstanceName":"grid0"},"id":"22653158-3691-4a09-bbd9-f4197f14dd0c","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/5a5e6785-d3f8-41bf-9d5d-95a179362e02 + url: https://api.datadoghq.com/api/v2/app-builder/apps/22653158-3691-4a09-bbd9-f4197f14dd0c response: - body: '{"data":{"id":"5a5e6785-d3f8-41bf-9d5d-95a179362e02","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":"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 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":321813,"user_id":2320499,"user_uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","user_name":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","version":2,"updated_since_deployment":false,"created_at":"2024-12-12T20:29:27.115629Z","updated_at":"2024-12-12T20:29:27.362767Z","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":"2024-12-20T20:39:23.117622Z","updated_at":"2024-12-20T20:39:23.317526Z","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/5a5e6785-d3f8-41bf-9d5d-95a179362e02 + url: https://api.datadoghq.com/api/v2/app-builder/apps/22653158-3691-4a09-bbd9-f4197f14dd0c response: - body: '{"data":{"id":"5a5e6785-d3f8-41bf-9d5d-95a179362e02","type":"appDefinitions"}}' + body: '{"data":{"id":"22653158-3691-4a09-bbd9-f4197f14dd0c","type":"appDefinitions"}}' code: 200 duration: 0ms headers: diff --git a/tests/scenarios/features/v2/apps.feature b/tests/scenarios/features/v2/apps.feature index 531cc382643..1bed411c311 100644 --- a/tests/scenarios/features/v2/apps.feature +++ b/tests/scenarios/features/v2/apps.feature @@ -1,6 +1,9 @@ @endpoint(apps) @endpoint(apps-v2) Feature: Apps - Create, read, update, and delete apps in 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 @@ -88,6 +91,56 @@ Feature: Apps 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 @@ -116,11 +169,11 @@ Feature: Apps And the response "data.type" is equal to "appDefinitions" @generated @skip @team:DataDog/app-builder-backend - Scenario: List Apps returns "Bad Request, e.g. invalid sort parameter" response + 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, e.g. invalid sort parameter + Then the response status is 400 Bad Request @skip-typescript @team:DataDog/app-builder-backend Scenario: List Apps returns "OK" response diff --git a/tests/scenarios/features/v2/given.json b/tests/scenarios/features/v2/given.json index 29503a6ae7c..3c9e4279380 100644 --- a/tests/scenarios/features/v2/given.json +++ b/tests/scenarios/features/v2/given.json @@ -51,7 +51,7 @@ "parameters": [ { "name": "body", - "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\"}}" + "value": "{\"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\"}}" } ], "step": "there is a valid \"app\" in the system", diff --git a/tests/scenarios/features/v2/undo.json b/tests/scenarios/features/v2/undo.json index b1ed2db693d..08d57ce2bbe 100644 --- a/tests/scenarios/features/v2/undo.json +++ b/tests/scenarios/features/v2/undo.json @@ -197,13 +197,13 @@ } }, "DisableApp": { - "tag": "App Deployment", + "tag": "Apps", "undo": { "type": "idempotent" } }, "DeployApp": { - "tag": "App Deployment", + "tag": "Apps", "undo": { "type": "idempotent" }