diff --git a/.apigentools-info b/.apigentools-info index 8a6764c0849..ba5a3f858d6 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-02-14 10:50:03.602357", - "spec_repo_commit": "9348385b" + "regenerated": "2024-02-14 17:34:20.148512", + "spec_repo_commit": "e440fe7b" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-02-14 10:50:03.618501", - "spec_repo_commit": "9348385b" + "regenerated": "2024-02-14 17:34:20.163431", + "spec_repo_commit": "e440fe7b" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3a7820429e6..a1594c9781d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -22753,7 +22753,7 @@ paths: - cases_read summary: Search cases tags: - - Cases + - Case Management x-pagination: limitParam: page[size] pageOffsetParam: page[offset] @@ -22792,7 +22792,7 @@ paths: - cases_write summary: Create a case tags: - - Cases + - Case Management /api/v2/cases/projects: get: description: Get all projects. @@ -22821,7 +22821,7 @@ paths: - cases_read summary: Get all projects tags: - - Cases Projects + - Case Management post: description: Create a project. operationId: CreateProject @@ -22856,7 +22856,7 @@ paths: - cases_write summary: Create a project tags: - - Cases Projects + - Case Management /api/v2/cases/projects/{project_id}: delete: description: Remove a project using the project's `id`. @@ -22883,7 +22883,7 @@ paths: - cases_write summary: Remove a project tags: - - Cases Projects + - Case Management get: description: Get the details of a project by `project_id`. operationId: GetProject @@ -22913,7 +22913,7 @@ paths: - cases_read summary: Get the details of a project tags: - - Cases Projects + - Case Management /api/v2/cases/{case_id}: get: description: Get the details of case by `case_id` @@ -22944,7 +22944,7 @@ paths: - cases_read summary: Get the details of a case tags: - - Cases + - Case Management /api/v2/cases/{case_id}/archive: post: description: Archive case @@ -22982,7 +22982,7 @@ paths: - cases_write summary: Archive case tags: - - Cases + - Case Management /api/v2/cases/{case_id}/assign: post: description: Assign case to a user @@ -23020,7 +23020,7 @@ paths: - cases_write summary: Assign case tags: - - Cases + - Case Management /api/v2/cases/{case_id}/priority: post: description: Update case priority @@ -23058,7 +23058,7 @@ paths: - cases_write summary: Update case priority tags: - - Cases + - Case Management /api/v2/cases/{case_id}/status: post: description: Update case status @@ -23096,7 +23096,7 @@ paths: - cases_write summary: Update case status tags: - - Cases + - Case Management /api/v2/cases/{case_id}/unarchive: post: description: Unarchive case @@ -23134,7 +23134,7 @@ paths: - cases_write summary: Unarchive case tags: - - Cases + - Case Management /api/v2/cases/{case_id}/unassign: post: description: Unassign case @@ -23172,7 +23172,7 @@ paths: - cases_write summary: Unassign case tags: - - Cases + - Case Management /api/v2/ci/pipeline: post: description: 'Send your pipeline event to your Datadog platform over HTTP. For @@ -34519,10 +34519,8 @@ tags: [Test Visibility in Datadog page](https://docs.datadoghq.com/tests/) for more information. name: CI Visibility Tests -- description: View and manage cases within Datadog - name: Cases -- description: View and manage project within Case Management - name: Cases Projects +- description: View and manage cases and project within Case Management + name: Case Management - description: The Cloud Cost Management API allows you to set up, edit, and delete Cloud Cost Management accounts for AWS and Azure. See the [Cloud Cost Management page](https://docs.datadoghq.com/cloud_cost_management/) for more information. diff --git a/api/datadogV2/api_cases.go b/api/datadogV2/api_case_management.go similarity index 69% rename from api/datadogV2/api_cases.go rename to api/datadogV2/api_case_management.go index ee6e8c81e6a..56c23d21a2a 100644 --- a/api/datadogV2/api_cases.go +++ b/api/datadogV2/api_case_management.go @@ -13,19 +13,19 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CasesApi service type -type CasesApi datadog.Service +// CaseManagementApi service type +type CaseManagementApi datadog.Service // ArchiveCase Archive case. // Archive case -func (a *CasesApi) ArchiveCase(ctx _context.Context, caseId string, body CaseEmptyRequest) (CaseResponse, *_nethttp.Response, error) { +func (a *CaseManagementApi) ArchiveCase(ctx _context.Context, caseId string, body CaseEmptyRequest) (CaseResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarReturnValue CaseResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CasesApi.ArchiveCase") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.ArchiveCase") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } @@ -92,14 +92,14 @@ func (a *CasesApi) ArchiveCase(ctx _context.Context, caseId string, body CaseEmp // AssignCase Assign case. // Assign case to a user -func (a *CasesApi) AssignCase(ctx _context.Context, caseId string, body CaseAssignRequest) (CaseResponse, *_nethttp.Response, error) { +func (a *CaseManagementApi) AssignCase(ctx _context.Context, caseId string, body CaseAssignRequest) (CaseResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarReturnValue CaseResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CasesApi.AssignCase") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.AssignCase") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } @@ -166,14 +166,14 @@ func (a *CasesApi) AssignCase(ctx _context.Context, caseId string, body CaseAssi // CreateCase Create a case. // Create a Case -func (a *CasesApi) CreateCase(ctx _context.Context, body CaseCreateRequest) (CaseResponse, *_nethttp.Response, error) { +func (a *CaseManagementApi) CreateCase(ctx _context.Context, body CaseCreateRequest) (CaseResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarReturnValue CaseResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CasesApi.CreateCase") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.CreateCase") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } @@ -237,16 +237,150 @@ func (a *CasesApi) CreateCase(ctx _context.Context, body CaseCreateRequest) (Cas return localVarReturnValue, localVarHTTPResponse, nil } +// CreateProject Create a project. +// Create a project. +func (a *CaseManagementApi) CreateProject(ctx _context.Context, body ProjectCreateRequest) (ProjectResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue ProjectResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.CreateProject") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/projects" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + 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 == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || 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 +} + +// DeleteProject Remove a project. +// Remove a project using the project's `id`. +func (a *CaseManagementApi) DeleteProject(ctx _context.Context, projectId string) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.DeleteProject") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", _neturl.PathEscape(datadog.ParameterToString(projectId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "*/*" + + 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 nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + // GetCase Get the details of a case. // Get the details of case by `case_id` -func (a *CasesApi) GetCase(ctx _context.Context, caseId string) (CaseResponse, *_nethttp.Response, error) { +func (a *CaseManagementApi) GetCase(ctx _context.Context, caseId string) (CaseResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarReturnValue CaseResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CasesApi.GetCase") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.GetCase") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } @@ -308,6 +442,147 @@ func (a *CasesApi) GetCase(ctx _context.Context, caseId string) (CaseResponse, * return localVarReturnValue, localVarHTTPResponse, nil } +// GetProject Get the details of a project. +// Get the details of a project by `project_id`. +func (a *CaseManagementApi) GetProject(ctx _context.Context, projectId string) (ProjectResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ProjectResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.GetProject") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", _neturl.PathEscape(datadog.ParameterToString(projectId, "")), -1) + + 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 == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || 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 +} + +// GetProjects Get all projects. +// Get all projects. +func (a *CaseManagementApi) GetProjects(ctx _context.Context) (ProjectsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ProjectsResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.GetProjects") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/cases/projects" + + 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 == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || 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 +} + // SearchCasesOptionalParameters holds optional parameters for SearchCases. type SearchCasesOptionalParameters struct { PageSize *int64 @@ -355,7 +630,7 @@ func (r *SearchCasesOptionalParameters) WithSortAsc(sortAsc bool) *SearchCasesOp // SearchCases Search cases. // Search cases. -func (a *CasesApi) SearchCases(ctx _context.Context, o ...SearchCasesOptionalParameters) (CasesResponse, *_nethttp.Response, error) { +func (a *CaseManagementApi) SearchCases(ctx _context.Context, o ...SearchCasesOptionalParameters) (CasesResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -370,7 +645,7 @@ func (a *CasesApi) SearchCases(ctx _context.Context, o ...SearchCasesOptionalPar optionalParams = o[0] } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CasesApi.SearchCases") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.SearchCases") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } @@ -447,7 +722,7 @@ func (a *CasesApi) SearchCases(ctx _context.Context, o ...SearchCasesOptionalPar } // SearchCasesWithPagination provides a paginated version of SearchCases returning a channel with all items. -func (a *CasesApi) SearchCasesWithPagination(ctx _context.Context, o ...SearchCasesOptionalParameters) (<-chan datadog.PaginationResult[Case], func()) { +func (a *CaseManagementApi) SearchCasesWithPagination(ctx _context.Context, o ...SearchCasesOptionalParameters) (<-chan datadog.PaginationResult[Case], func()) { ctx, cancel := _context.WithCancel(ctx) pageSize_ := int64(10) if len(o) == 0 { @@ -498,14 +773,14 @@ func (a *CasesApi) SearchCasesWithPagination(ctx _context.Context, o ...SearchCa // UnarchiveCase Unarchive case. // Unarchive case -func (a *CasesApi) UnarchiveCase(ctx _context.Context, caseId string, body CaseEmptyRequest) (CaseResponse, *_nethttp.Response, error) { +func (a *CaseManagementApi) UnarchiveCase(ctx _context.Context, caseId string, body CaseEmptyRequest) (CaseResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarReturnValue CaseResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CasesApi.UnarchiveCase") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UnarchiveCase") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } @@ -572,14 +847,14 @@ func (a *CasesApi) UnarchiveCase(ctx _context.Context, caseId string, body CaseE // UnassignCase Unassign case. // Unassign case -func (a *CasesApi) UnassignCase(ctx _context.Context, caseId string, body CaseEmptyRequest) (CaseResponse, *_nethttp.Response, error) { +func (a *CaseManagementApi) UnassignCase(ctx _context.Context, caseId string, body CaseEmptyRequest) (CaseResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarReturnValue CaseResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CasesApi.UnassignCase") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UnassignCase") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } @@ -646,14 +921,14 @@ func (a *CasesApi) UnassignCase(ctx _context.Context, caseId string, body CaseEm // UpdatePriority Update case priority. // Update case priority -func (a *CasesApi) UpdatePriority(ctx _context.Context, caseId string, body CaseUpdatePriorityRequest) (CaseResponse, *_nethttp.Response, error) { +func (a *CaseManagementApi) UpdatePriority(ctx _context.Context, caseId string, body CaseUpdatePriorityRequest) (CaseResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarReturnValue CaseResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CasesApi.UpdatePriority") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UpdatePriority") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } @@ -720,14 +995,14 @@ func (a *CasesApi) UpdatePriority(ctx _context.Context, caseId string, body Case // UpdateStatus Update case status. // Update case status -func (a *CasesApi) UpdateStatus(ctx _context.Context, caseId string, body CaseUpdateStatusRequest) (CaseResponse, *_nethttp.Response, error) { +func (a *CaseManagementApi) UpdateStatus(ctx _context.Context, caseId string, body CaseUpdateStatusRequest) (CaseResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarReturnValue CaseResponse ) - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CasesApi.UpdateStatus") + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UpdateStatus") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } @@ -792,9 +1067,9 @@ func (a *CasesApi) UpdateStatus(ctx _context.Context, caseId string, body CaseUp return localVarReturnValue, localVarHTTPResponse, nil } -// NewCasesApi Returns NewCasesApi. -func NewCasesApi(client *datadog.APIClient) *CasesApi { - return &CasesApi{ +// NewCaseManagementApi Returns NewCaseManagementApi. +func NewCaseManagementApi(client *datadog.APIClient) *CaseManagementApi { + return &CaseManagementApi{ Client: client, } } diff --git a/api/datadogV2/api_cases_projects.go b/api/datadogV2/api_cases_projects.go deleted file mode 100644 index 67135edc08d..00000000000 --- a/api/datadogV2/api_cases_projects.go +++ /dev/null @@ -1,299 +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" - _nethttp "net/http" - _neturl "net/url" - "strings" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// CasesProjectsApi service type -type CasesProjectsApi datadog.Service - -// CreateProject Create a project. -// Create a project. -func (a *CasesProjectsApi) CreateProject(ctx _context.Context, body ProjectCreateRequest) (ProjectResponse, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarReturnValue ProjectResponse - ) - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CasesProjectsApi.CreateProject") - if err != nil { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/api/v2/cases/projects" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - localVarHeaderParams["Content-Type"] = "application/json" - localVarHeaderParams["Accept"] = "application/json" - - // body params - localVarPostBody = &body - 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 == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || 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 -} - -// DeleteProject Remove a project. -// Remove a project using the project's `id`. -func (a *CasesProjectsApi) DeleteProject(ctx _context.Context, projectId string) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - ) - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CasesProjectsApi.DeleteProject") - if err != nil { - return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}" - localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", _neturl.PathEscape(datadog.ParameterToString(projectId, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - localVarHeaderParams["Accept"] = "*/*" - - 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 nil, err - } - - localVarHTTPResponse, err := a.Client.CallAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := datadog.ReadBody(localVarHTTPResponse) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := datadog.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { - var v APIErrorResponse - err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - return localVarHTTPResponse, newErr - } - newErr.ErrorModel = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -// GetProject Get the details of a project. -// Get the details of a project by `project_id`. -func (a *CasesProjectsApi) GetProject(ctx _context.Context, projectId string) (ProjectResponse, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ProjectResponse - ) - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CasesProjectsApi.GetProject") - if err != nil { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/api/v2/cases/projects/{project_id}" - localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", _neturl.PathEscape(datadog.ParameterToString(projectId, "")), -1) - - 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 == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || 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 -} - -// GetProjects Get all projects. -// Get all projects. -func (a *CasesProjectsApi) GetProjects(ctx _context.Context) (ProjectsResponse, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ProjectsResponse - ) - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CasesProjectsApi.GetProjects") - if err != nil { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/api/v2/cases/projects" - - 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 == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || 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 -} - -// NewCasesProjectsApi Returns NewCasesProjectsApi. -func NewCasesProjectsApi(client *datadog.APIClient) *CasesProjectsApi { - return &CasesProjectsApi{ - Client: client, - } -} diff --git a/api/datadogV2/doc.go b/api/datadogV2/doc.go index cfed7b42245..db1f8eb48f8 100644 --- a/api/datadogV2/doc.go +++ b/api/datadogV2/doc.go @@ -27,19 +27,19 @@ // - [CIVisibilityTestsApi.AggregateCIAppTestEvents] // - [CIVisibilityTestsApi.ListCIAppTestEvents] // - [CIVisibilityTestsApi.SearchCIAppTestEvents] -// - [CasesApi.ArchiveCase] -// - [CasesApi.AssignCase] -// - [CasesApi.CreateCase] -// - [CasesApi.GetCase] -// - [CasesApi.SearchCases] -// - [CasesApi.UnarchiveCase] -// - [CasesApi.UnassignCase] -// - [CasesApi.UpdatePriority] -// - [CasesApi.UpdateStatus] -// - [CasesProjectsApi.CreateProject] -// - [CasesProjectsApi.DeleteProject] -// - [CasesProjectsApi.GetProject] -// - [CasesProjectsApi.GetProjects] +// - [CaseManagementApi.ArchiveCase] +// - [CaseManagementApi.AssignCase] +// - [CaseManagementApi.CreateCase] +// - [CaseManagementApi.CreateProject] +// - [CaseManagementApi.DeleteProject] +// - [CaseManagementApi.GetCase] +// - [CaseManagementApi.GetProject] +// - [CaseManagementApi.GetProjects] +// - [CaseManagementApi.SearchCases] +// - [CaseManagementApi.UnarchiveCase] +// - [CaseManagementApi.UnassignCase] +// - [CaseManagementApi.UpdatePriority] +// - [CaseManagementApi.UpdateStatus] // - [CloudCostManagementApi.CreateCostAWSCURConfig] // - [CloudCostManagementApi.CreateCostAzureUCConfigs] // - [CloudCostManagementApi.DeleteCostAWSCURConfig] diff --git a/examples/v2/cases/ArchiveCase.go b/examples/v2/case-management/ArchiveCase.go similarity index 76% rename from examples/v2/cases/ArchiveCase.go rename to examples/v2/case-management/ArchiveCase.go index d90469d39fb..87819e69199 100644 --- a/examples/v2/cases/ArchiveCase.go +++ b/examples/v2/case-management/ArchiveCase.go @@ -24,14 +24,14 @@ func main() { ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewCasesApi(apiClient) + api := datadogV2.NewCaseManagementApi(apiClient) resp, r, err := api.ArchiveCase(ctx, CaseID, body) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `CasesApi.ArchiveCase`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.ArchiveCase`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `CasesApi.ArchiveCase`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.ArchiveCase`:\n%s\n", responseContent) } diff --git a/examples/v2/cases/AssignCase.go b/examples/v2/case-management/AssignCase.go similarity index 79% rename from examples/v2/cases/AssignCase.go rename to examples/v2/case-management/AssignCase.go index 045c00f10c0..9e8c7d47c02 100644 --- a/examples/v2/cases/AssignCase.go +++ b/examples/v2/case-management/AssignCase.go @@ -30,14 +30,14 @@ func main() { ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewCasesApi(apiClient) + api := datadogV2.NewCaseManagementApi(apiClient) resp, r, err := api.AssignCase(ctx, CaseID, body) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `CasesApi.AssignCase`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.AssignCase`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `CasesApi.AssignCase`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.AssignCase`:\n%s\n", responseContent) } diff --git a/examples/v2/cases/CreateCase.go b/examples/v2/case-management/CreateCase.go similarity index 83% rename from examples/v2/cases/CreateCase.go rename to examples/v2/case-management/CreateCase.go index 065e2c001b2..becb845f488 100644 --- a/examples/v2/cases/CreateCase.go +++ b/examples/v2/case-management/CreateCase.go @@ -20,7 +20,7 @@ func main() { Data: datadogV2.CaseCreate{ Attributes: datadogV2.CaseCreateAttributes{ Priority: datadogV2.CASEPRIORITY_NOT_DEFINED.Ptr(), - Title: "Security breach investigation in 3dcc5b2ebf9bfb8f", + Title: "Security breach investigation in 0cfbc5cbc676ee71", Type: datadogV2.CASETYPE_STANDARD, }, Relationships: &datadogV2.CaseCreateRelationships{ @@ -43,14 +43,14 @@ func main() { ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewCasesApi(apiClient) + api := datadogV2.NewCaseManagementApi(apiClient) resp, r, err := api.CreateCase(ctx, body) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `CasesApi.CreateCase`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.CreateCase`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `CasesApi.CreateCase`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.CreateCase`:\n%s\n", responseContent) } diff --git a/examples/v2/cases-projects/CreateProject.go b/examples/v2/case-management/CreateProject.go similarity index 77% rename from examples/v2/cases-projects/CreateProject.go rename to examples/v2/case-management/CreateProject.go index 05484d97add..97f7e714829 100644 --- a/examples/v2/cases-projects/CreateProject.go +++ b/examples/v2/case-management/CreateProject.go @@ -25,14 +25,14 @@ func main() { ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewCasesProjectsApi(apiClient) + api := datadogV2.NewCaseManagementApi(apiClient) resp, r, err := api.CreateProject(ctx, body) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `CasesProjectsApi.CreateProject`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.CreateProject`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `CasesProjectsApi.CreateProject`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.CreateProject`:\n%s\n", responseContent) } diff --git a/examples/v2/cases-projects/DeleteProject.go b/examples/v2/case-management/DeleteProject.go similarity index 78% rename from examples/v2/cases-projects/DeleteProject.go rename to examples/v2/case-management/DeleteProject.go index 243537a767d..3d7753a7dcf 100644 --- a/examples/v2/cases-projects/DeleteProject.go +++ b/examples/v2/case-management/DeleteProject.go @@ -15,11 +15,11 @@ func main() { ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewCasesProjectsApi(apiClient) + api := datadogV2.NewCaseManagementApi(apiClient) r, err := api.DeleteProject(ctx, "project_id") if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `CasesProjectsApi.DeleteProject`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.DeleteProject`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } } diff --git a/examples/v2/cases/GetCase.go b/examples/v2/case-management/GetCase.go similarity index 74% rename from examples/v2/cases/GetCase.go rename to examples/v2/case-management/GetCase.go index 070b92608c3..058aa55c33b 100644 --- a/examples/v2/cases/GetCase.go +++ b/examples/v2/case-management/GetCase.go @@ -19,14 +19,14 @@ func main() { ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewCasesApi(apiClient) + api := datadogV2.NewCaseManagementApi(apiClient) resp, r, err := api.GetCase(ctx, CaseID) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `CasesApi.GetCase`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.GetCase`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `CasesApi.GetCase`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.GetCase`:\n%s\n", responseContent) } diff --git a/examples/v2/cases-projects/GetProject.go b/examples/v2/case-management/GetProject.go similarity index 71% rename from examples/v2/cases-projects/GetProject.go rename to examples/v2/case-management/GetProject.go index d33b7d87820..32b19b1b58c 100644 --- a/examples/v2/cases-projects/GetProject.go +++ b/examples/v2/case-management/GetProject.go @@ -16,14 +16,14 @@ func main() { ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewCasesProjectsApi(apiClient) + api := datadogV2.NewCaseManagementApi(apiClient) resp, r, err := api.GetProject(ctx, "project_id") if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `CasesProjectsApi.GetProject`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.GetProject`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `CasesProjectsApi.GetProject`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.GetProject`:\n%s\n", responseContent) } diff --git a/examples/v2/cases-projects/GetProjects.go b/examples/v2/case-management/GetProjects.go similarity index 70% rename from examples/v2/cases-projects/GetProjects.go rename to examples/v2/case-management/GetProjects.go index da17cfbdc52..ab1038c91b5 100644 --- a/examples/v2/cases-projects/GetProjects.go +++ b/examples/v2/case-management/GetProjects.go @@ -16,14 +16,14 @@ func main() { ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewCasesProjectsApi(apiClient) + api := datadogV2.NewCaseManagementApi(apiClient) resp, r, err := api.GetProjects(ctx) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `CasesProjectsApi.GetProjects`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.GetProjects`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `CasesProjectsApi.GetProjects`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.GetProjects`:\n%s\n", responseContent) } diff --git a/examples/v2/cases/SearchCases.go b/examples/v2/case-management/SearchCases.go similarity index 72% rename from examples/v2/cases/SearchCases.go rename to examples/v2/case-management/SearchCases.go index 352d168ad91..618aff4ae88 100644 --- a/examples/v2/cases/SearchCases.go +++ b/examples/v2/case-management/SearchCases.go @@ -16,14 +16,14 @@ func main() { ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewCasesApi(apiClient) + api := datadogV2.NewCaseManagementApi(apiClient) resp, r, err := api.SearchCases(ctx, *datadogV2.NewSearchCasesOptionalParameters()) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `CasesApi.SearchCases`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.SearchCases`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `CasesApi.SearchCases`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.SearchCases`:\n%s\n", responseContent) } diff --git a/examples/v2/cases/SearchCases_3433960044.go b/examples/v2/case-management/SearchCases_3433960044.go similarity index 81% rename from examples/v2/cases/SearchCases_3433960044.go rename to examples/v2/case-management/SearchCases_3433960044.go index 6add1e4b2fa..aa3abe94d82 100644 --- a/examples/v2/cases/SearchCases_3433960044.go +++ b/examples/v2/case-management/SearchCases_3433960044.go @@ -16,12 +16,12 @@ func main() { ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewCasesApi(apiClient) + api := datadogV2.NewCaseManagementApi(apiClient) resp, _ := api.SearchCasesWithPagination(ctx, *datadogV2.NewSearchCasesOptionalParameters()) for paginationResult := range resp { if paginationResult.Error != nil { - fmt.Fprintf(os.Stderr, "Error when calling `CasesApi.SearchCases`: %v\n", paginationResult.Error) + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.SearchCases`: %v\n", paginationResult.Error) } responseContent, _ := json.MarshalIndent(paginationResult.Item, "", " ") fmt.Fprintf(os.Stdout, "%s\n", responseContent) diff --git a/examples/v2/cases/UnarchiveCase.go b/examples/v2/case-management/UnarchiveCase.go similarity index 76% rename from examples/v2/cases/UnarchiveCase.go rename to examples/v2/case-management/UnarchiveCase.go index c839b0e7030..ed2bff3f64e 100644 --- a/examples/v2/cases/UnarchiveCase.go +++ b/examples/v2/case-management/UnarchiveCase.go @@ -24,14 +24,14 @@ func main() { ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewCasesApi(apiClient) + api := datadogV2.NewCaseManagementApi(apiClient) resp, r, err := api.UnarchiveCase(ctx, CaseID, body) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `CasesApi.UnarchiveCase`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.UnarchiveCase`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `CasesApi.UnarchiveCase`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.UnarchiveCase`:\n%s\n", responseContent) } diff --git a/examples/v2/cases/UnassignCase.go b/examples/v2/case-management/UnassignCase.go similarity index 76% rename from examples/v2/cases/UnassignCase.go rename to examples/v2/case-management/UnassignCase.go index 9df3f287dfc..9b9d1578294 100644 --- a/examples/v2/cases/UnassignCase.go +++ b/examples/v2/case-management/UnassignCase.go @@ -24,14 +24,14 @@ func main() { ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewCasesApi(apiClient) + api := datadogV2.NewCaseManagementApi(apiClient) resp, r, err := api.UnassignCase(ctx, CaseID, body) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `CasesApi.UnassignCase`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.UnassignCase`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `CasesApi.UnassignCase`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.UnassignCase`:\n%s\n", responseContent) } diff --git a/examples/v2/cases/UpdatePriority.go b/examples/v2/case-management/UpdatePriority.go similarity index 78% rename from examples/v2/cases/UpdatePriority.go rename to examples/v2/case-management/UpdatePriority.go index 91ea5718be1..896a609163b 100644 --- a/examples/v2/cases/UpdatePriority.go +++ b/examples/v2/case-management/UpdatePriority.go @@ -27,14 +27,14 @@ func main() { ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewCasesApi(apiClient) + api := datadogV2.NewCaseManagementApi(apiClient) resp, r, err := api.UpdatePriority(ctx, CaseID, body) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `CasesApi.UpdatePriority`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.UpdatePriority`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `CasesApi.UpdatePriority`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.UpdatePriority`:\n%s\n", responseContent) } diff --git a/examples/v2/cases/UpdateStatus.go b/examples/v2/case-management/UpdateStatus.go similarity index 78% rename from examples/v2/cases/UpdateStatus.go rename to examples/v2/case-management/UpdateStatus.go index c62be07044e..c136e8b9e17 100644 --- a/examples/v2/cases/UpdateStatus.go +++ b/examples/v2/case-management/UpdateStatus.go @@ -27,14 +27,14 @@ func main() { ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewCasesApi(apiClient) + api := datadogV2.NewCaseManagementApi(apiClient) resp, r, err := api.UpdateStatus(ctx, CaseID, body) if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `CasesApi.UpdateStatus`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.UpdateStatus`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `CasesApi.UpdateStatus`:\n%s\n", responseContent) + fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.UpdateStatus`:\n%s\n", responseContent) } diff --git a/tests/scenarios/api_mappings.go b/tests/scenarios/api_mappings.go index 68ebd0af853..905c587e251 100644 --- a/tests/scenarios/api_mappings.go +++ b/tests/scenarios/api_mappings.go @@ -50,8 +50,7 @@ var apiMappings = map[string]map[string]reflect.Value{ "APMRetentionFiltersApi": reflect.ValueOf(datadogV2.NewAPMRetentionFiltersApi), "AuditApi": reflect.ValueOf(datadogV2.NewAuditApi), "AuthNMappingsApi": reflect.ValueOf(datadogV2.NewAuthNMappingsApi), - "CasesApi": reflect.ValueOf(datadogV2.NewCasesApi), - "CasesProjectsApi": reflect.ValueOf(datadogV2.NewCasesProjectsApi), + "CaseManagementApi": reflect.ValueOf(datadogV2.NewCaseManagementApi), "CIVisibilityPipelinesApi": reflect.ValueOf(datadogV2.NewCIVisibilityPipelinesApi), "CIVisibilityTestsApi": reflect.ValueOf(datadogV2.NewCIVisibilityTestsApi), "ContainerImagesApi": reflect.ValueOf(datadogV2.NewContainerImagesApi), diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Archive_case_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Archive_case_returns_Bad_Request_response.freeze index ef6c63cf9ee..b5af426fb50 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Archive_case_returns_Bad_Request_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Archive_case_returns_Bad_Request_response.freeze @@ -1 +1 @@ -2024-02-07T18:00:35.988Z \ No newline at end of file +2024-02-14T16:39:10.110Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Archive_case_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Archive_case_returns_Bad_Request_response.yaml index 6226f0fd52d..a3956e65423 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Archive_case_returns_Bad_Request_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Archive_case_returns_Bad_Request_response.yaml @@ -12,9 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/cases response: - body: '{"data":{"id":"1f205230-5ea9-444e-a5f9-48f93d6a2cde","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:36.54518451Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"1f205230-5ea9-444e-a5f9-48f93d6a2cde","key":"DDFC-2","priority":"P4","public_id":"62","status":"OPEN","title":"My - new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"}}]}' + body: '{"data":{"id":"94695a50-bd52-4f4a-b656-68184e7851dd","type":"case","attributes":{"attributes":{},"created_at":"2024-02-14T16:39:10.214369167Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"94695a50-bd52-4f4a-b656-68184e7851dd","key":"DDFC-159","priority":"P4","public_id":"219","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user","attributes":{"email":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":""}}]}' code: 201 duration: 0ms headers: @@ -32,7 +31,7 @@ interactions: - application/json id: 1 method: POST - url: https://api.datadoghq.com/api/v2/cases/1f205230-5ea9-444e-a5f9-48f93d6a2cde/archive + url: https://api.datadoghq.com/api/v2/cases/94695a50-bd52-4f4a-b656-68184e7851dd/archive response: body: '{"errors":[{"status":"400","title":"Bad Request","detail":"got type \"project\" expected one of \"case\""}]}' diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Archive_case_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Archive_case_returns_Not_Found_response.freeze index 6b42677b0f5..d76c1251a19 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Archive_case_returns_Not_Found_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Archive_case_returns_Not_Found_response.freeze @@ -1 +1 @@ -2024-02-07T13:09:07.949Z \ No newline at end of file +2024-02-14T16:39:10.324Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Archive_case_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Archive_case_returns_OK_response.freeze index 558899ce6da..981c16a4eb2 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Archive_case_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Archive_case_returns_OK_response.freeze @@ -1 +1 @@ -2024-02-07T18:00:36.901Z \ No newline at end of file +2024-02-14T16:39:10.413Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Archive_case_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Archive_case_returns_OK_response.yaml index f25e3103e9c..cc09fa18bfb 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Archive_case_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Archive_case_returns_OK_response.yaml @@ -12,9 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/cases response: - body: '{"data":{"id":"99e6e8cd-f115-4168-8814-30776007f44c","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:37.185776261Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"99e6e8cd-f115-4168-8814-30776007f44c","key":"DDFC-3","priority":"P4","public_id":"63","status":"OPEN","title":"My - new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"}}]}' + body: '{"data":{"id":"bef3acd7-018b-4f67-882e-fa8a6295d371","type":"case","attributes":{"attributes":{},"created_at":"2024-02-14T16:39:10.477772726Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"bef3acd7-018b-4f67-882e-fa8a6295d371","key":"DDFC-160","priority":"P4","public_id":"220","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user","attributes":{"email":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":""}}]}' code: 201 duration: 0ms headers: @@ -32,11 +31,10 @@ interactions: - application/json id: 1 method: POST - url: https://api.datadoghq.com/api/v2/cases/99e6e8cd-f115-4168-8814-30776007f44c/archive + url: https://api.datadoghq.com/api/v2/cases/bef3acd7-018b-4f67-882e-fa8a6295d371/archive response: - body: '{"data":{"id":"99e6e8cd-f115-4168-8814-30776007f44c","type":"case","attributes":{"archived_at":"2024-02-07T18:00:37.47125606Z","attributes":{},"created_at":"2024-02-07T18:00:37.185776Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"99e6e8cd-f115-4168-8814-30776007f44c","key":"DDFC-3","priority":"P4","public_id":"63","status":"OPEN","title":"My - new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"modified_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"}}]}' + body: '{"data":{"id":"bef3acd7-018b-4f67-882e-fa8a6295d371","type":"case","attributes":{"archived_at":"2024-02-14T16:39:10.575810049Z","attributes":{},"created_at":"2024-02-14T16:39:10.477773Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"bef3acd7-018b-4f67-882e-fa8a6295d371","key":"DDFC-160","priority":"P4","public_id":"220","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"modified_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user","attributes":{"email":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":""}}]}' code: 200 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_Bad_Request_response.freeze index 9f1a33f2842..996d73b29b3 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_Bad_Request_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_Bad_Request_response.freeze @@ -1 +1 @@ -2024-02-12T13:25:55.665Z \ No newline at end of file +2024-02-14T16:39:10.606Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_Bad_Request_response.yaml index ecac977f96a..ec7044bd557 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_Bad_Request_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_Bad_Request_response.yaml @@ -12,9 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/cases response: - body: '{"data":{"id":"4039be1a-5f87-4666-b986-a8396c0225c3","type":"case","attributes":{"attributes":{},"created_at":"2024-02-12T13:25:56.280897807Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"4039be1a-5f87-4666-b986-a8396c0225c3","key":"DDFC-17","priority":"P4","public_id":"77","status":"OPEN","title":"My - new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"}}]}' + body: '{"data":{"id":"033e9f6e-3c89-448d-934a-acb9918a34d6","type":"case","attributes":{"attributes":{},"created_at":"2024-02-14T16:39:10.669565483Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"033e9f6e-3c89-448d-934a-acb9918a34d6","key":"DDFC-161","priority":"P4","public_id":"221","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user","attributes":{"email":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":""}}]}' code: 201 duration: 0ms headers: @@ -32,7 +31,7 @@ interactions: - application/json id: 1 method: POST - url: https://api.datadoghq.com/api/v2/cases/4039be1a-5f87-4666-b986-a8396c0225c3/assign + url: https://api.datadoghq.com/api/v2/cases/033e9f6e-3c89-448d-934a-acb9918a34d6/assign response: body: '{"errors":[{"code":"invalid_command","title":"error when validating input command: ''assigneeid'' field must be an uuid","meta":{"entity":"assigneeid","rule":"uuid"}}]}' diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_Not_Found_response.freeze index 1f0ce04277c..83a02805a9e 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_Not_Found_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_Not_Found_response.freeze @@ -1 +1 @@ -2024-02-07T13:09:08.433Z \ No newline at end of file +2024-02-14T16:40:03.079Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_Not_Found_response.yaml index 8ed4e31f2f0..3612a80b40c 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_Not_Found_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_Not_Found_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"email":"Test-Assign_case_returns_Not_Found_response-1707311348@datadoghq.com","title":"user title"},"type":"users"}} + {"data":{"attributes":{"email":"Test-Assign_case_returns_Not_Found_response-1707928803@datadoghq.com","title":"user title"},"type":"users"}} form: {} headers: Accept: @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/users response: - body: '{"data":{"type":"users","id":"14040f89-c5ba-11ee-87b5-f6892353f87d","attributes":{"name":null,"handle":"test-assign_case_returns_not_found_response-1707311348@datadoghq.com","created_at":"2024-02-07T13:09:08.546371+00:00","modified_at":"2024-02-07T13:09:08.546371+00:00","email":"test-assign_case_returns_not_found_response-1707311348@datadoghq.com","icon":"https://secure.gravatar.com/avatar/e0a6ed9703a1166a2c07bca15e37d0d6?s=48&d=retro","title":"user + body: '{"data":{"type":"users","id":"b3b23788-cb57-11ee-8748-faa985cef958","attributes":{"name":null,"handle":"test-assign_case_returns_not_found_response-1707928803@datadoghq.com","created_at":"2024-02-14T16:40:03.245892+00:00","modified_at":"2024-02-14T16:40:03.245892+00:00","email":"test-assign_case_returns_not_found_response-1707928803@datadoghq.com","icon":"https://secure.gravatar.com/avatar/cf0137aa34a05ba5c2347190f7b2558c?s=48&d=retro","title":"user title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -24,7 +24,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"assignee_id":"14040f89-c5ba-11ee-87b5-f6892353f87d"},"type":"case"}} + {"data":{"attributes":{"assignee_id":"b3b23788-cb57-11ee-8748-faa985cef958"},"type":"case"}} form: {} headers: Accept: @@ -50,7 +50,7 @@ interactions: - '*/*' id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/users/14040f89-c5ba-11ee-87b5-f6892353f87d + url: https://api.datadoghq.com/api/v2/users/b3b23788-cb57-11ee-8748-faa985cef958 response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_OK_response.freeze index 5b2d1f17d03..0e3fb374a3d 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_OK_response.freeze @@ -1 +1 @@ -2024-02-07T18:00:38.147Z \ No newline at end of file +2024-02-14T16:40:56.542Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_OK_response.yaml index ffd7db5f2eb..81c82dcdf6a 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Assign_case_returns_OK_response.yaml @@ -12,9 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/cases response: - body: '{"data":{"id":"a0801fce-a045-4b66-ad78-effcd959fa4f","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:38.353039559Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"a0801fce-a045-4b66-ad78-effcd959fa4f","key":"DDFC-5","priority":"P4","public_id":"65","status":"OPEN","title":"My - new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"}}]}' + body: '{"data":{"id":"f9835ff9-2444-4f78-9e17-ef90de799da6","type":"case","attributes":{"attributes":{},"created_at":"2024-02-14T16:40:56.626960295Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"f9835ff9-2444-4f78-9e17-ef90de799da6","key":"DDFC-173","priority":"P4","public_id":"233","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user","attributes":{"email":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":""}}]}' code: 201 duration: 0ms headers: @@ -23,7 +22,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"email":"Test-Assign_case_returns_OK_response-1707328838@datadoghq.com","title":"user title"},"type":"users"}} + {"data":{"attributes":{"email":"Test-Assign_case_returns_OK_response-1707928856@datadoghq.com","title":"user title"},"type":"users"}} form: {} headers: Accept: @@ -34,7 +33,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/users response: - body: '{"data":{"type":"users","id":"cced7029-c5e2-11ee-ac63-c24751e8bab0","attributes":{"name":null,"handle":"test-assign_case_returns_ok_response-1707328838@datadoghq.com","created_at":"2024-02-07T18:00:38.645791+00:00","modified_at":"2024-02-07T18:00:38.645791+00:00","email":"test-assign_case_returns_ok_response-1707328838@datadoghq.com","icon":"https://secure.gravatar.com/avatar/dd4005a3eca9e7c6aed30c77d193bc37?s=48&d=retro","title":"user + body: '{"data":{"type":"users","id":"d3966bf5-cb57-11ee-8970-ca504578d5d4","attributes":{"name":null,"handle":"test-assign_case_returns_ok_response-1707928856@datadoghq.com","created_at":"2024-02-14T16:40:56.750824+00:00","modified_at":"2024-02-14T16:40:56.750824+00:00","email":"test-assign_case_returns_ok_response-1707928856@datadoghq.com","icon":"https://secure.gravatar.com/avatar/2972eeea20897679a0181d6b2c9c999c?s=48&d=retro","title":"user title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -46,7 +45,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"assignee_id":"cced7029-c5e2-11ee-ac63-c24751e8bab0"},"type":"case"}} + {"data":{"attributes":{"assignee_id":"d3966bf5-cb57-11ee-8970-ca504578d5d4"},"type":"case"}} form: {} headers: Accept: @@ -55,11 +54,10 @@ interactions: - application/json id: 2 method: POST - url: https://api.datadoghq.com/api/v2/cases/a0801fce-a045-4b66-ad78-effcd959fa4f/assign + url: https://api.datadoghq.com/api/v2/cases/f9835ff9-2444-4f78-9e17-ef90de799da6/assign response: - body: '{"data":{"id":"a0801fce-a045-4b66-ad78-effcd959fa4f","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:38.35304Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"a0801fce-a045-4b66-ad78-effcd959fa4f","key":"DDFC-5","modified_at":"2024-02-07T18:00:39.010235Z","priority":"P4","public_id":"65","status":"OPEN","title":"My - new case","type":"STANDARD"},"relationships":{"assignee":{"data":{"id":"cced7029-c5e2-11ee-ac63-c24751e8bab0","type":"user"}},"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"modified_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"}},{"id":"cced7029-c5e2-11ee-ac63-c24751e8bab0","type":"user","attributes":{"email":"test-assign_case_returns_ok_response-1707328838@datadoghq.com","handle":"test-assign_case_returns_ok_response-1707328838@datadoghq.com","name":""}}]}' + body: '{"data":{"id":"f9835ff9-2444-4f78-9e17-ef90de799da6","type":"case","attributes":{"attributes":{},"created_at":"2024-02-14T16:40:56.62696Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"f9835ff9-2444-4f78-9e17-ef90de799da6","key":"DDFC-173","modified_at":"2024-02-14T16:40:56.879935Z","priority":"P4","public_id":"233","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"assignee":{"data":{"id":"d3966bf5-cb57-11ee-8970-ca504578d5d4","type":"user"}},"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"modified_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"d3966bf5-cb57-11ee-8970-ca504578d5d4","type":"user","attributes":{"email":"test-assign_case_returns_ok_response-1707928856@datadoghq.com","handle":"test-assign_case_returns_ok_response-1707928856@datadoghq.com","name":""}},{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user","attributes":{"email":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":""}}]}' code: 200 duration: 0ms headers: @@ -74,7 +72,7 @@ interactions: - '*/*' id: 3 method: DELETE - url: https://api.datadoghq.com/api/v2/users/cced7029-c5e2-11ee-ac63-c24751e8bab0 + url: https://api.datadoghq.com/api/v2/users/d3966bf5-cb57-11ee-8970-ca504578d5d4 response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Create_a_case_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Create_a_case_returns_Bad_Request_response.freeze index 14b7cfa0a25..a86e1bf6649 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Create_a_case_returns_Bad_Request_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Create_a_case_returns_Bad_Request_response.freeze @@ -1 +1 @@ -2024-02-07T13:09:09.415Z \ No newline at end of file +2024-02-14T16:39:11.745Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Create_a_case_returns_CREATED_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Create_a_case_returns_CREATED_response.freeze index 1132edd29cf..5f3bb601e96 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Create_a_case_returns_CREATED_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Create_a_case_returns_CREATED_response.freeze @@ -1 +1 @@ -2024-02-07T18:00:39.566Z \ No newline at end of file +2024-02-14T16:40:46.895Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Create_a_case_returns_CREATED_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Create_a_case_returns_CREATED_response.yaml index 8248e92c56c..be8bb4879a8 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Create_a_case_returns_CREATED_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Create_a_case_returns_CREATED_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"email":"Test-Create_a_case_returns_CREATED_response-1707328839@datadoghq.com","title":"user title"},"type":"users"}} + {"data":{"attributes":{"email":"Test-Create_a_case_returns_CREATED_response-1707928846@datadoghq.com","title":"user title"},"type":"users"}} form: {} headers: Accept: @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/users response: - body: '{"data":{"type":"users","id":"cda929dc-c5e2-11ee-883d-6ad03867f364","attributes":{"name":null,"handle":"test-create_a_case_returns_created_response-1707328839@datadoghq.com","created_at":"2024-02-07T18:00:39.876070+00:00","modified_at":"2024-02-07T18:00:39.876070+00:00","email":"test-create_a_case_returns_created_response-1707328839@datadoghq.com","icon":"https://secure.gravatar.com/avatar/e564f62a22caae2dd8e878a8d73c6328?s=48&d=retro","title":"user + body: '{"data":{"type":"users","id":"cdcbfe6e-cb57-11ee-8748-faa985cef958","attributes":{"name":null,"handle":"test-create_a_case_returns_created_response-1707928846@datadoghq.com","created_at":"2024-02-14T16:40:47.035585+00:00","modified_at":"2024-02-14T16:40:47.035585+00:00","email":"test-create_a_case_returns_created_response-1707928846@datadoghq.com","icon":"https://secure.gravatar.com/avatar/0fce68e8ef99663143d1a0fa4b90f593?s=48&d=retro","title":"user title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -24,7 +24,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"priority":"NOT_DEFINED","title":"Security breach investigation in 3b9b6a6abdcf0b9b","type":"STANDARD"},"relationships":{"assignee":{"data":{"id":"cda929dc-c5e2-11ee-883d-6ad03867f364","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}},"type":"case"}} + {"data":{"attributes":{"priority":"NOT_DEFINED","title":"Security breach investigation in 71e6c6d95aea3817","type":"STANDARD"},"relationships":{"assignee":{"data":{"id":"cdcbfe6e-cb57-11ee-8748-faa985cef958","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}},"type":"case"}} form: {} headers: Accept: @@ -35,9 +35,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/cases response: - body: '{"data":{"id":"4045de8b-3808-4bb6-94c9-f55ced4811c7","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:40.197151067Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"4045de8b-3808-4bb6-94c9-f55ced4811c7","key":"DDFC-6","priority":"NOT_DEFINED","public_id":"66","status":"OPEN","title":"Security - breach investigation in 3b9b6a6abdcf0b9b","type":"STANDARD"},"relationships":{"assignee":{"data":{"id":"cda929dc-c5e2-11ee-883d-6ad03867f364","type":"user"}},"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"}},{"id":"cda929dc-c5e2-11ee-883d-6ad03867f364","type":"user","attributes":{"email":"test-create_a_case_returns_created_response-1707328839@datadoghq.com","handle":"test-create_a_case_returns_created_response-1707328839@datadoghq.com","name":""}}]}' + body: '{"data":{"id":"c3b3411f-0d5c-414f-ab0d-d3b3e3b80d3d","type":"case","attributes":{"attributes":{},"created_at":"2024-02-14T16:40:47.204058163Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"c3b3411f-0d5c-414f-ab0d-d3b3e3b80d3d","key":"DDFC-172","priority":"NOT_DEFINED","public_id":"232","status":"OPEN","title":"Security + breach investigation in 71e6c6d95aea3817","type":"STANDARD"},"relationships":{"assignee":{"data":{"id":"cdcbfe6e-cb57-11ee-8748-faa985cef958","type":"user"}},"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user","attributes":{"email":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":""}},{"id":"cdcbfe6e-cb57-11ee-8748-faa985cef958","type":"user","attributes":{"email":"test-create_a_case_returns_created_response-1707928846@datadoghq.com","handle":"test-create_a_case_returns_created_response-1707928846@datadoghq.com","name":""}}]}' code: 201 duration: 0ms headers: @@ -52,7 +51,7 @@ interactions: - '*/*' id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/users/cda929dc-c5e2-11ee-883d-6ad03867f364 + url: https://api.datadoghq.com/api/v2/users/cdcbfe6e-cb57-11ee-8748-faa985cef958 response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Get_the_details_of_a_case_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Get_the_details_of_a_case_returns_Not_Found_response.freeze index 3601a30777b..bf9283a7aee 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Get_the_details_of_a_case_returns_Not_Found_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Get_the_details_of_a_case_returns_Not_Found_response.freeze @@ -1 +1 @@ -2024-02-07T13:09:09.931Z \ No newline at end of file +2024-02-14T16:39:12.227Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Get_the_details_of_a_case_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Get_the_details_of_a_case_returns_OK_response.freeze index a1285495136..b9b5d0cd701 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Get_the_details_of_a_case_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Get_the_details_of_a_case_returns_OK_response.freeze @@ -1 +1 @@ -2024-02-07T18:00:40.743Z \ No newline at end of file +2024-02-14T16:39:12.312Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Get_the_details_of_a_case_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Get_the_details_of_a_case_returns_OK_response.yaml index 55be4e3f1d8..5be886b38f3 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Get_the_details_of_a_case_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Get_the_details_of_a_case_returns_OK_response.yaml @@ -12,9 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/cases response: - body: '{"data":{"id":"8fd1a1c3-3f55-4d6b-807f-ca70bc0e5749","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:41.007812312Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"8fd1a1c3-3f55-4d6b-807f-ca70bc0e5749","key":"DDFC-7","priority":"P4","public_id":"67","status":"OPEN","title":"My - new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"}}]}' + body: '{"data":{"id":"8faf858e-4034-4207-a395-c762de23273d","type":"case","attributes":{"attributes":{},"created_at":"2024-02-14T16:39:12.38138722Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"8faf858e-4034-4207-a395-c762de23273d","key":"DDFC-163","priority":"P4","public_id":"223","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user","attributes":{"email":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":""}}]}' code: 201 duration: 0ms headers: @@ -29,11 +28,10 @@ interactions: - application/json id: 1 method: GET - url: https://api.datadoghq.com/api/v2/cases/8fd1a1c3-3f55-4d6b-807f-ca70bc0e5749 + url: https://api.datadoghq.com/api/v2/cases/8faf858e-4034-4207-a395-c762de23273d response: - body: '{"data":{"id":"8fd1a1c3-3f55-4d6b-807f-ca70bc0e5749","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:41.007812Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"8fd1a1c3-3f55-4d6b-807f-ca70bc0e5749","key":"DDFC-7","priority":"P4","public_id":"67","status":"OPEN","title":"My - new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"}}]}' + body: '{"data":{"id":"8faf858e-4034-4207-a395-c762de23273d","type":"case","attributes":{"attributes":{},"created_at":"2024-02-14T16:39:12.381387Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"8faf858e-4034-4207-a395-c762de23273d","key":"DDFC-163","priority":"P4","public_id":"223","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user","attributes":{"email":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":""}}]}' code: 200 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unarchive_case_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unarchive_case_returns_Bad_Request_response.freeze index 5d3fc771c20..3d13ee79beb 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unarchive_case_returns_Bad_Request_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unarchive_case_returns_Bad_Request_response.freeze @@ -1 +1 @@ -2024-02-07T18:00:41.393Z \ No newline at end of file +2024-02-14T16:39:12.520Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unarchive_case_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unarchive_case_returns_Bad_Request_response.yaml index dca33b425fa..0b674a21a12 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unarchive_case_returns_Bad_Request_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unarchive_case_returns_Bad_Request_response.yaml @@ -12,9 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/cases response: - body: '{"data":{"id":"91b52d3b-4d67-4b7f-ba4d-da67d8b46798","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:41.662578539Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"91b52d3b-4d67-4b7f-ba4d-da67d8b46798","key":"DDFC-8","priority":"P4","public_id":"68","status":"OPEN","title":"My - new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"}}]}' + body: '{"data":{"id":"14d7ab5b-a257-470d-b894-9d4105c3f98c","type":"case","attributes":{"attributes":{},"created_at":"2024-02-14T16:39:12.586490003Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"14d7ab5b-a257-470d-b894-9d4105c3f98c","key":"DDFC-164","priority":"P4","public_id":"224","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user","attributes":{"email":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":""}}]}' code: 201 duration: 0ms headers: @@ -32,7 +31,7 @@ interactions: - application/json id: 1 method: POST - url: https://api.datadoghq.com/api/v2/cases/91b52d3b-4d67-4b7f-ba4d-da67d8b46798/unarchive + url: https://api.datadoghq.com/api/v2/cases/14d7ab5b-a257-470d-b894-9d4105c3f98c/unarchive response: body: '{"errors":[{"status":"400","title":"Bad Request","detail":"got type \"project\" expected one of \"case\""}]}' diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unarchive_case_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unarchive_case_returns_Not_Found_response.freeze index df6e8d3aea0..78d9205fced 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unarchive_case_returns_Not_Found_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unarchive_case_returns_Not_Found_response.freeze @@ -1 +1 @@ -2024-02-07T13:09:10.329Z \ No newline at end of file +2024-02-14T16:39:12.688Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unarchive_case_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unarchive_case_returns_OK_response.freeze index c639a2463ee..a7fee903219 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unarchive_case_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unarchive_case_returns_OK_response.freeze @@ -1 +1 @@ -2024-02-07T18:00:42.027Z \ No newline at end of file +2024-02-14T16:39:12.775Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unarchive_case_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unarchive_case_returns_OK_response.yaml index a4f1bf6bd0e..94275c7b2ab 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unarchive_case_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unarchive_case_returns_OK_response.yaml @@ -12,9 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/cases response: - body: '{"data":{"id":"020e2ce7-9fe8-4273-81ae-1e5873fba9d3","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:42.286687881Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"020e2ce7-9fe8-4273-81ae-1e5873fba9d3","key":"DDFC-9","priority":"P4","public_id":"69","status":"OPEN","title":"My - new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"}}]}' + body: '{"data":{"id":"83721c7f-b572-49bf-af51-b410b0de3b23","type":"case","attributes":{"attributes":{},"created_at":"2024-02-14T16:39:12.827055271Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"83721c7f-b572-49bf-af51-b410b0de3b23","key":"DDFC-165","priority":"P4","public_id":"225","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user","attributes":{"email":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":""}}]}' code: 201 duration: 0ms headers: @@ -32,11 +31,10 @@ interactions: - application/json id: 1 method: POST - url: https://api.datadoghq.com/api/v2/cases/020e2ce7-9fe8-4273-81ae-1e5873fba9d3/unarchive + url: https://api.datadoghq.com/api/v2/cases/83721c7f-b572-49bf-af51-b410b0de3b23/unarchive response: - body: '{"data":{"id":"020e2ce7-9fe8-4273-81ae-1e5873fba9d3","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:42.286688Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"020e2ce7-9fe8-4273-81ae-1e5873fba9d3","key":"DDFC-9","priority":"P4","public_id":"69","status":"OPEN","title":"My - new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"}}]}' + body: '{"data":{"id":"83721c7f-b572-49bf-af51-b410b0de3b23","type":"case","attributes":{"attributes":{},"created_at":"2024-02-14T16:39:12.827055Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"83721c7f-b572-49bf-af51-b410b0de3b23","key":"DDFC-165","priority":"P4","public_id":"225","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user","attributes":{"email":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":""}}]}' code: 200 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unassign_case_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unassign_case_returns_Bad_Request_response.freeze index a7b2a9e33bf..1c5bf0f4a94 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unassign_case_returns_Bad_Request_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unassign_case_returns_Bad_Request_response.freeze @@ -1 +1 @@ -2024-02-07T18:00:42.637Z \ No newline at end of file +2024-02-14T16:39:12.927Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unassign_case_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unassign_case_returns_Bad_Request_response.yaml index f0963174ce5..886ee8455f2 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unassign_case_returns_Bad_Request_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unassign_case_returns_Bad_Request_response.yaml @@ -12,9 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/cases response: - body: '{"data":{"id":"8a6e4254-7429-4398-99c2-ba9363fb3f98","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:42.908434394Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"8a6e4254-7429-4398-99c2-ba9363fb3f98","key":"DDFC-10","priority":"P4","public_id":"70","status":"OPEN","title":"My - new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"}}]}' + body: '{"data":{"id":"1343d61e-0cc0-44fd-838f-c8b420ca80cb","type":"case","attributes":{"attributes":{},"created_at":"2024-02-14T16:39:12.994450881Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"1343d61e-0cc0-44fd-838f-c8b420ca80cb","key":"DDFC-166","priority":"P4","public_id":"226","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user","attributes":{"email":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":""}}]}' code: 201 duration: 0ms headers: @@ -32,7 +31,7 @@ interactions: - application/json id: 1 method: POST - url: https://api.datadoghq.com/api/v2/cases/8a6e4254-7429-4398-99c2-ba9363fb3f98/unassign + url: https://api.datadoghq.com/api/v2/cases/1343d61e-0cc0-44fd-838f-c8b420ca80cb/unassign response: body: '{"errors":[{"status":"400","title":"Bad Request","detail":"got type \"project\" expected one of \"case\""}]}' diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unassign_case_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unassign_case_returns_Not_Found_response.freeze index fee1f808458..b90e19278e9 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unassign_case_returns_Not_Found_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unassign_case_returns_Not_Found_response.freeze @@ -1 +1 @@ -2024-02-07T13:09:10.714Z \ No newline at end of file +2024-02-14T16:39:13.089Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unassign_case_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unassign_case_returns_OK_response.freeze index 0a5d0226a27..6a72d71ba0a 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unassign_case_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unassign_case_returns_OK_response.freeze @@ -1 +1 @@ -2024-02-07T18:00:43.176Z \ No newline at end of file +2024-02-14T16:39:13.176Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unassign_case_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unassign_case_returns_OK_response.yaml index ed1d76f2fee..593b8a7c758 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unassign_case_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Unassign_case_returns_OK_response.yaml @@ -12,9 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/cases response: - body: '{"data":{"id":"8c5de575-685c-4ac4-a78a-9774c4f2160b","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:43.427988311Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"8c5de575-685c-4ac4-a78a-9774c4f2160b","key":"DDFC-11","priority":"P4","public_id":"71","status":"OPEN","title":"My - new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"}}]}' + body: '{"data":{"id":"521b08a2-7cb8-49f7-8cfe-2620c105b142","type":"case","attributes":{"attributes":{},"created_at":"2024-02-14T16:39:13.240638945Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"521b08a2-7cb8-49f7-8cfe-2620c105b142","key":"DDFC-167","priority":"P4","public_id":"227","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user","attributes":{"email":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":""}}]}' code: 201 duration: 0ms headers: @@ -32,11 +31,10 @@ interactions: - application/json id: 1 method: POST - url: https://api.datadoghq.com/api/v2/cases/8c5de575-685c-4ac4-a78a-9774c4f2160b/unassign + url: https://api.datadoghq.com/api/v2/cases/521b08a2-7cb8-49f7-8cfe-2620c105b142/unassign response: - body: '{"data":{"id":"8c5de575-685c-4ac4-a78a-9774c4f2160b","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:43.427988Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"8c5de575-685c-4ac4-a78a-9774c4f2160b","key":"DDFC-11","priority":"P4","public_id":"71","status":"OPEN","title":"My - new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"}}]}' + body: '{"data":{"id":"521b08a2-7cb8-49f7-8cfe-2620c105b142","type":"case","attributes":{"attributes":{},"created_at":"2024-02-14T16:39:13.240639Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"521b08a2-7cb8-49f7-8cfe-2620c105b142","key":"DDFC-167","priority":"P4","public_id":"227","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user","attributes":{"email":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":""}}]}' code: 200 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_priority_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_priority_returns_Bad_Request_response.freeze index da678b9cae1..3a2af28335a 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_priority_returns_Bad_Request_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_priority_returns_Bad_Request_response.freeze @@ -1 +1 @@ -2024-02-07T18:00:43.807Z \ No newline at end of file +2024-02-14T16:39:13.332Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_priority_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_priority_returns_Bad_Request_response.yaml index 25ce912a2a4..bb401848a99 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_priority_returns_Bad_Request_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_priority_returns_Bad_Request_response.yaml @@ -12,9 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/cases response: - body: '{"data":{"id":"09077090-4370-4539-b9e5-445173f4fced","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:44.06773183Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"09077090-4370-4539-b9e5-445173f4fced","key":"DDFC-12","priority":"P4","public_id":"72","status":"OPEN","title":"My - new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"}}]}' + body: '{"data":{"id":"a4804e04-0b37-4153-9ead-17d3bbcbcbb6","type":"case","attributes":{"attributes":{},"created_at":"2024-02-14T16:39:13.382413881Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"a4804e04-0b37-4153-9ead-17d3bbcbcbb6","key":"DDFC-168","priority":"P4","public_id":"228","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user","attributes":{"email":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":""}}]}' code: 201 duration: 0ms headers: @@ -32,10 +31,10 @@ interactions: - application/json id: 1 method: POST - url: https://api.datadoghq.com/api/v2/cases/09077090-4370-4539-b9e5-445173f4fced/priority + url: https://api.datadoghq.com/api/v2/cases/a4804e04-0b37-4153-9ead-17d3bbcbcbb6/priority response: body: '{"errors":[{"title":"Generic Error","detail":"invalid priority P1234. Must - be one of P3, P4, P5, NOT_DEFINED, P1, P2"}]}' + be one of NOT_DEFINED, P1, P2, P3, P4, P5"}]}' code: 400 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_priority_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_priority_returns_Not_Found_response.freeze index 33edf5b4580..897996bf0cd 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_priority_returns_Not_Found_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_priority_returns_Not_Found_response.freeze @@ -1 +1 @@ -2024-02-07T13:09:11.084Z \ No newline at end of file +2024-02-14T16:39:13.489Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_priority_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_priority_returns_OK_response.freeze index ac293b567ad..58855d3a268 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_priority_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_priority_returns_OK_response.freeze @@ -1 +1 @@ -2024-02-07T18:00:44.433Z \ No newline at end of file +2024-02-14T16:39:13.566Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_priority_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_priority_returns_OK_response.yaml index 37a52fcdd7c..126f9e8eca9 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_priority_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_priority_returns_OK_response.yaml @@ -12,9 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/cases response: - body: '{"data":{"id":"60fdb1eb-209a-4072-9db3-4d08a9c4180c","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:44.723781245Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"60fdb1eb-209a-4072-9db3-4d08a9c4180c","key":"DDFC-13","priority":"P4","public_id":"73","status":"OPEN","title":"My - new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"}}]}' + body: '{"data":{"id":"55a03858-0897-4f73-87dd-909e4bfe914e","type":"case","attributes":{"attributes":{},"created_at":"2024-02-14T16:39:13.618301232Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"55a03858-0897-4f73-87dd-909e4bfe914e","key":"DDFC-169","priority":"P4","public_id":"229","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user","attributes":{"email":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":""}}]}' code: 201 duration: 0ms headers: @@ -32,11 +31,10 @@ interactions: - application/json id: 1 method: POST - url: https://api.datadoghq.com/api/v2/cases/60fdb1eb-209a-4072-9db3-4d08a9c4180c/priority + url: https://api.datadoghq.com/api/v2/cases/55a03858-0897-4f73-87dd-909e4bfe914e/priority response: - body: '{"data":{"id":"60fdb1eb-209a-4072-9db3-4d08a9c4180c","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:44.723781Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"60fdb1eb-209a-4072-9db3-4d08a9c4180c","key":"DDFC-13","modified_at":"2024-02-07T18:00:45.028076Z","priority":"P3","public_id":"73","status":"OPEN","title":"My - new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"modified_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"}}]}' + body: '{"data":{"id":"55a03858-0897-4f73-87dd-909e4bfe914e","type":"case","attributes":{"attributes":{},"created_at":"2024-02-14T16:39:13.618301Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"55a03858-0897-4f73-87dd-909e4bfe914e","key":"DDFC-169","modified_at":"2024-02-14T16:39:13.695103Z","priority":"P3","public_id":"229","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"modified_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user","attributes":{"email":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":""}}]}' code: 200 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_status_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_status_returns_Bad_Request_response.freeze index 8a9c88da383..5eb283ba031 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_status_returns_Bad_Request_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_status_returns_Bad_Request_response.freeze @@ -1 +1 @@ -2024-02-07T18:00:45.069Z \ No newline at end of file +2024-02-14T16:39:13.715Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_status_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_status_returns_Bad_Request_response.yaml index 6582c75c27b..77024d14186 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_status_returns_Bad_Request_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_status_returns_Bad_Request_response.yaml @@ -12,9 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/cases response: - body: '{"data":{"id":"243feddb-69f8-4e22-988a-8ae954b643fa","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:45.265151303Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"243feddb-69f8-4e22-988a-8ae954b643fa","key":"DDFC-14","priority":"P4","public_id":"74","status":"OPEN","title":"My - new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"}}]}' + body: '{"data":{"id":"3d6ee0da-fc45-4c30-846d-26c88c311e46","type":"case","attributes":{"attributes":{},"created_at":"2024-02-14T16:39:13.782298138Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"3d6ee0da-fc45-4c30-846d-26c88c311e46","key":"DDFC-170","priority":"P4","public_id":"230","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user","attributes":{"email":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":""}}]}' code: 201 duration: 0ms headers: @@ -32,10 +31,10 @@ interactions: - application/json id: 1 method: POST - url: https://api.datadoghq.com/api/v2/cases/243feddb-69f8-4e22-988a-8ae954b643fa/status + url: https://api.datadoghq.com/api/v2/cases/3d6ee0da-fc45-4c30-846d-26c88c311e46/status response: body: '{"errors":[{"title":"Generic Error","detail":"invalid status OPENED. Must - be one of CLOSED, SUNKNOWN, OPEN, IN_PROGRESS"}]}' + be one of SUNKNOWN, OPEN, IN_PROGRESS, CLOSED"}]}' code: 400 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_status_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_status_returns_Not_Found_response.freeze index 52aa1297fc5..ae39f521338 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_status_returns_Not_Found_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_status_returns_Not_Found_response.freeze @@ -1 +1 @@ -2024-02-07T13:09:11.471Z \ No newline at end of file +2024-02-14T16:39:13.883Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_status_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_status_returns_OK_response.freeze index 2c362818582..4441118f933 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_status_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_status_returns_OK_response.freeze @@ -1 +1 @@ -2024-02-07T18:00:45.628Z \ No newline at end of file +2024-02-14T16:39:13.971Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_status_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_status_returns_OK_response.yaml index 00fe5714fc6..a1917c0638a 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_status_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cases/Scenario_Update_case_status_returns_OK_response.yaml @@ -12,9 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/cases response: - body: '{"data":{"id":"ceae478d-b504-4cb7-bad2-e8f8e5a0a77b","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:45.905784777Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"ceae478d-b504-4cb7-bad2-e8f8e5a0a77b","key":"DDFC-15","priority":"P4","public_id":"75","status":"OPEN","title":"My - new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"}}]}' + body: '{"data":{"id":"e90af850-8c1d-49f4-bac3-948dd1faecad","type":"case","attributes":{"attributes":{},"created_at":"2024-02-14T16:39:14.025230076Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"e90af850-8c1d-49f4-bac3-948dd1faecad","key":"DDFC-171","priority":"P4","public_id":"231","status":"OPEN","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user","attributes":{"email":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":""}}]}' code: 201 duration: 0ms headers: @@ -32,11 +31,10 @@ interactions: - application/json id: 1 method: POST - url: https://api.datadoghq.com/api/v2/cases/ceae478d-b504-4cb7-bad2-e8f8e5a0a77b/status + url: https://api.datadoghq.com/api/v2/cases/e90af850-8c1d-49f4-bac3-948dd1faecad/status response: - body: '{"data":{"id":"ceae478d-b504-4cb7-bad2-e8f8e5a0a77b","type":"case","attributes":{"attributes":{},"created_at":"2024-02-07T18:00:45.905785Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"ceae478d-b504-4cb7-bad2-e8f8e5a0a77b","key":"DDFC-15","modified_at":"2024-02-07T18:00:46.22949Z","priority":"P4","public_id":"75","status":"IN_PROGRESS","title":"My - new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"modified_by":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"user","attributes":{"email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"}}]}' + body: '{"data":{"id":"e90af850-8c1d-49f4-bac3-948dd1faecad","type":"case","attributes":{"attributes":{},"created_at":"2024-02-14T16:39:14.02523Z","creation_source":"MANUAL","description":"","insights":[],"internal_id":"e90af850-8c1d-49f4-bac3-948dd1faecad","key":"DDFC-171","modified_at":"2024-02-14T16:39:14.100498Z","priority":"P4","public_id":"231","status":"IN_PROGRESS","title":"My + new case","type":"STANDARD"},"relationships":{"created_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"modified_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}}},"included":[{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"user","attributes":{"email":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":""}}]}' code: 200 duration: 0ms headers: diff --git a/tests/scenarios/features/v2/case_management.feature b/tests/scenarios/features/v2/case_management.feature new file mode 100644 index 00000000000..2d99e555384 --- /dev/null +++ b/tests/scenarios/features/v2/case_management.feature @@ -0,0 +1,315 @@ +@endpoint(case-management) @endpoint(case-management-v2) +Feature: Case Management + View and manage cases and project within Case Management + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "CaseManagement" API + + @team:DataDog/case-management + Scenario: Archive case returns "Bad Request" response + Given new "ArchiveCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"type": "project"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Archive case returns "Not Found" response + Given new "ArchiveCase" request + And request contains "case_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And body with value {"data": {"type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Archive case returns "OK" response + Given new "ArchiveCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"type": "case"}} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/case-management + Scenario: Assign case returns "Bad Request" response + Given new "AssignCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"attributes": {"assignee_id": "invalid-uuid"}, "type": "case"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Assign case returns "Not Found" response + Given new "AssignCase" request + And there is a valid "user" in the system + And request contains "case_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And body with value {"data": {"attributes": {"assignee_id": "{{user.data.id}}"}, "type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Assign case returns "OK" response + Given new "AssignCase" request + And there is a valid "case" in the system + And there is a valid "user" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"attributes": {"assignee_id": "{{user.data.id}}"}, "type": "case"}} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/case-management + Scenario: Create a case returns "Bad Request" response + Given new "CreateCase" request + And body with value {"data": {"attributes": {"priority": "NOT_DEFINED", "title": "Security breach investigation", "type": "STANDARD"}, "relationships": {"assignee": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "userx"}}, "project": {"data": {"id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "type": "project"}}}, "type": "case"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Create a case returns "CREATED" response + Given new "CreateCase" request + And there is a valid "user" in the system + And body with value {"data": {"attributes": {"priority": "NOT_DEFINED", "title": "Security breach investigation in {{ unique_hash }}", "type": "STANDARD"}, "relationships": {"assignee": {"data": {"id": "{{user.data.id}}", "type": "user"} }, "project": {"data": {"id": "d4bbe1af-f36e-42f1-87c1-493ca35c320e", "type": "project"}}}, "type": "case"}} + When the request is sent + Then the response status is 201 CREATED + And the response "data" has field "id" + And the response "data.attributes.title" is equal to "Security breach investigation in {{ unique_hash }}" + And the response "data.attributes.type" is equal to "STANDARD" + And the response "data.attributes.priority" is equal to "NOT_DEFINED" + + @generated @skip @team:DataDog/case-management + Scenario: Create a case returns "Not Found" response + Given new "CreateCase" request + And body with value {"data": {"attributes": {"priority": "NOT_DEFINED", "title": "Security breach investigation", "type": "STANDARD"}, "relationships": {"assignee": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "user"}}, "project": {"data": {"id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "type": "project"}}}, "type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Create a project returns "Bad Request" response + Given new "CreateProject" request + And body with value {"data": {"attributes": {"key": "SEC", "name": "Security Investigation"}, "type": "project"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Create a project returns "CREATED" response + Given new "CreateProject" request + And body with value {"data": {"attributes": {"key": "SEC", "name": "Security Investigation"}, "type": "project"}} + When the request is sent + Then the response status is 201 CREATED + + @generated @skip @team:DataDog/case-management + Scenario: Create a project returns "Not Found" response + Given new "CreateProject" request + And body with value {"data": {"attributes": {"key": "SEC", "name": "Security Investigation"}, "type": "project"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Get all projects returns "Bad Request" response + Given new "GetProjects" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Get all projects returns "Not Found" response + Given new "GetProjects" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Get all projects returns "OK" response + Given new "GetProjects" request + When the request is sent + Then the response status is 200 OK + + @skip @team:DataDog/case-management + Scenario: Get the details of a case returns "Bad Request" response + Given new "GetCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Get the details of a case returns "Not Found" response + Given new "GetCase" request + And request contains "case_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Get the details of a case returns "OK" response + Given new "GetCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Get the details of a project returns "Bad Request" response + Given new "GetProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Get the details of a project returns "Not Found" response + Given new "GetProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Get the details of a project returns "OK" response + Given new "GetProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management + Scenario: Remove a project returns "API error response" response + Given new "DeleteProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response + + @generated @skip @team:DataDog/case-management + Scenario: Remove a project returns "No Content" response + Given new "DeleteProject" request + And request contains "project_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/case-management + Scenario: Search cases returns "Bad Request" response + Given new "SearchCases" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Search cases returns "Not Found" response + Given new "SearchCases" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Search cases returns "OK" response + Given new "SearchCases" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/case-management @with-pagination + Scenario: Search cases returns "OK" response with pagination + Given new "SearchCases" request + When the request with pagination is sent + Then the response status is 200 OK + + @team:DataDog/case-management + Scenario: Unarchive case returns "Bad Request" response + Given new "UnarchiveCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"type": "project"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Unarchive case returns "Not Found" response + Given new "UnarchiveCase" request + And request contains "case_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And body with value {"data": {"type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Unarchive case returns "OK" response + Given new "UnarchiveCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"type": "case"}} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/case-management + Scenario: Unassign case returns "Bad Request" response + Given new "UnassignCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"type": "project"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Unassign case returns "Not Found" response + Given new "UnassignCase" request + And request contains "case_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And body with value {"data": {"type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Unassign case returns "OK" response + Given new "UnassignCase" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"type": "case"}} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/case-management + Scenario: Update case priority returns "Bad Request" response + Given new "UpdatePriority" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"attributes": {"priority": "P1234"}, "type": "case"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Update case priority returns "Not Found" response + Given new "UpdatePriority" request + And request contains "case_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And body with value {"data": {"attributes": {"priority": "P3"}, "type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Update case priority returns "OK" response + Given new "UpdatePriority" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"attributes": {"priority": "P3"}, "type": "case"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.priority" is equal to "P3" + + @team:DataDog/case-management + Scenario: Update case status returns "Bad Request" response + Given new "UpdateStatus" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"attributes": {"status": "OPENED"}, "type": "case"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/case-management + Scenario: Update case status returns "Not Found" response + Given new "UpdateStatus" request + And request contains "case_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737" + And body with value {"data": {"attributes": {"status": "OPEN"}, "type": "case"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/case-management + Scenario: Update case status returns "OK" response + Given new "UpdateStatus" request + And there is a valid "case" in the system + And request contains "case_id" parameter from "case.id" + And body with value {"data": {"attributes": {"status": "IN_PROGRESS"}, "type": "case"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.status" is equal to "IN_PROGRESS" diff --git a/tests/scenarios/features/v2/given.json b/tests/scenarios/features/v2/given.json index cbaee96cb71..8c2a75b9b1b 100644 --- a/tests/scenarios/features/v2/given.json +++ b/tests/scenarios/features/v2/given.json @@ -69,7 +69,7 @@ "source": "data", "step": "there is a valid \"case\" in the system", "key": "case", - "tag": "Cases", + "tag": "Case Management", "operationId": "CreateCase" }, { diff --git a/tests/scenarios/features/v2/undo.json b/tests/scenarios/features/v2/undo.json index 1268756c9d2..f58d4d35346 100644 --- a/tests/scenarios/features/v2/undo.json +++ b/tests/scenarios/features/v2/undo.json @@ -221,25 +221,25 @@ } }, "SearchCases": { - "tag": "Cases", + "tag": "Case Management", "undo": { "type": "safe" } }, "CreateCase": { - "tag": "Cases", + "tag": "Case Management", "undo": { "type": "safe" } }, "GetProjects": { - "tag": "Cases Projects", + "tag": "Case Management", "undo": { "type": "safe" } }, "CreateProject": { - "tag": "Cases Projects", + "tag": "Case Management", "undo": { "operationId": "DeleteProject", "parameters": [ @@ -252,55 +252,55 @@ } }, "DeleteProject": { - "tag": "Cases Projects", + "tag": "Case Management", "undo": { "type": "idempotent" } }, "GetProject": { - "tag": "Cases Projects", + "tag": "Case Management", "undo": { "type": "safe" } }, "GetCase": { - "tag": "Cases", + "tag": "Case Management", "undo": { "type": "safe" } }, "ArchiveCase": { - "tag": "Cases", + "tag": "Case Management", "undo": { "type": "idempotent" } }, "AssignCase": { - "tag": "Cases", + "tag": "Case Management", "undo": { "type": "idempotent" } }, "UpdatePriority": { - "tag": "Cases", + "tag": "Case Management", "undo": { "type": "idempotent" } }, "UpdateStatus": { - "tag": "Cases", + "tag": "Case Management", "undo": { "type": "idempotent" } }, "UnarchiveCase": { - "tag": "Cases", + "tag": "Case Management", "undo": { "type": "idempotent" } }, "UnassignCase": { - "tag": "Cases", + "tag": "Case Management", "undo": { "type": "idempotent" }