From a99a341f56aaccb675cf0522acd3c46650450319 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 26 Feb 2025 21:00:41 +0000 Subject: [PATCH] Regenerate client from commit 0498d5b9 of spec repo --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 352 +++++++++++++--- api/datadog/configuration.go | 8 - api/datadogV2/api_app_builder.go | 76 +--- api/datadogV2/model_action_query.go | 249 ++++++++++++ api/datadogV2/model_action_query_condition.go | 105 +++++ .../model_action_query_debounce_in_ms.go | 105 +++++ .../model_action_query_mocked_outputs.go | 105 +++++ ...del_action_query_mocked_outputs_enabled.go | 105 +++++ ...odel_action_query_mocked_outputs_object.go | 136 +++++++ ...odel_action_query_only_trigger_manually.go | 105 +++++ ...del_action_query_polling_interval_in_ms.go | 105 +++++ .../model_action_query_properties.go | 381 ++++++++++++++++++ ...odel_action_query_requires_confirmation.go | 105 +++++ .../model_action_query_show_toast_on_error.go | 105 +++++ api/datadogV2/model_action_query_spec.go | 105 +++++ ...odel_action_query_spec_connection_group.go | 139 +++++++ .../model_action_query_spec_inputs.go | 105 +++++ .../model_action_query_spec_object.go | 217 ++++++++++ api/datadogV2/model_action_query_type.go | 64 +++ api/datadogV2/model_data_transform.go | 214 ++++++++++ .../model_data_transform_properties.go | 102 +++++ api/datadogV2/model_data_transform_type.go | 64 +++ api/datadogV2/model_query.go | 300 +++++--------- api/datadogV2/model_query_type.go | 68 ---- api/datadogV2/model_state_variable.go | 214 ++++++++++ .../model_state_variable_properties.go | 102 +++++ api/datadogV2/model_state_variable_type.go | 64 +++ examples/v2/app-builder/CreateApp.go | 156 ++++++- examples/v2/app-builder/DeleteApp.go | 1 - examples/v2/app-builder/DeleteApps.go | 1 - examples/v2/app-builder/GetApp.go | 1 - examples/v2/app-builder/ListApps.go | 1 - examples/v2/app-builder/PublishApp.go | 1 - examples/v2/app-builder/UnpublishApp.go | 1 - examples/v2/app-builder/UpdateApp.go | 1 - ...te_App_returns_Bad_Request_response.freeze | 2 +- ...Create_App_returns_Created_response.freeze | 2 +- ...o_Create_App_returns_Created_response.yaml | 8 +- ...lete_App_returns_Not_Found_response.freeze | 2 +- ...ario_Delete_App_returns_OK_response.freeze | 2 +- ...enario_Delete_App_returns_OK_response.yaml | 10 +- ...ple_Apps_returns_Not_Found_response.freeze | 2 +- ...e_Multiple_Apps_returns_OK_response.freeze | 2 +- ...ete_Multiple_Apps_returns_OK_response.yaml | 10 +- ...nario_Get_App_returns_Gone_response.freeze | 1 + ...cenario_Get_App_returns_Gone_response.yaml | 56 +++ ..._Get_App_returns_Not_Found_response.freeze | 2 +- ...cenario_Get_App_returns_OK_response.freeze | 2 +- .../Scenario_Get_App_returns_OK_response.yaml | 26 +- ...nario_List_Apps_returns_OK_response.freeze | 2 +- ...cenario_List_Apps_returns_OK_response.yaml | 6 +- ...ublish_App_returns_Created_response.freeze | 2 +- ..._Publish_App_returns_Created_response.yaml | 12 +- ...lish_App_returns_Not_Found_response.freeze | 2 +- ...lish_App_returns_Not_Found_response.freeze | 2 +- ...o_Unpublish_App_returns_OK_response.freeze | 2 +- ...rio_Unpublish_App_returns_OK_response.yaml | 12 +- ...te_App_returns_Bad_Request_response.freeze | 2 +- ...date_App_returns_Bad_Request_response.yaml | 12 +- ...ario_Update_App_returns_OK_response.freeze | 2 +- ...enario_Update_App_returns_OK_response.yaml | 28 +- .../scenarios/features/v2/app_builder.feature | 77 ++-- tests/scenarios/features/v2/given.json | 2 +- 64 files changed, 3713 insertions(+), 548 deletions(-) create mode 100644 api/datadogV2/model_action_query.go create mode 100644 api/datadogV2/model_action_query_condition.go create mode 100644 api/datadogV2/model_action_query_debounce_in_ms.go create mode 100644 api/datadogV2/model_action_query_mocked_outputs.go create mode 100644 api/datadogV2/model_action_query_mocked_outputs_enabled.go create mode 100644 api/datadogV2/model_action_query_mocked_outputs_object.go create mode 100644 api/datadogV2/model_action_query_only_trigger_manually.go create mode 100644 api/datadogV2/model_action_query_polling_interval_in_ms.go create mode 100644 api/datadogV2/model_action_query_properties.go create mode 100644 api/datadogV2/model_action_query_requires_confirmation.go create mode 100644 api/datadogV2/model_action_query_show_toast_on_error.go create mode 100644 api/datadogV2/model_action_query_spec.go create mode 100644 api/datadogV2/model_action_query_spec_connection_group.go create mode 100644 api/datadogV2/model_action_query_spec_inputs.go create mode 100644 api/datadogV2/model_action_query_spec_object.go create mode 100644 api/datadogV2/model_action_query_type.go create mode 100644 api/datadogV2/model_data_transform.go create mode 100644 api/datadogV2/model_data_transform_properties.go create mode 100644 api/datadogV2/model_data_transform_type.go delete mode 100644 api/datadogV2/model_query_type.go create mode 100644 api/datadogV2/model_state_variable.go create mode 100644 api/datadogV2/model_state_variable_properties.go create mode 100644 api/datadogV2/model_state_variable_type.go create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_Gone_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_Gone_response.yaml diff --git a/.apigentools-info b/.apigentools-info index 5abcc0cbd0f..aca1fed7159 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-02-26 17:41:54.560567", - "spec_repo_commit": "e04872fb" + "regenerated": "2025-02-26 20:59:21.108010", + "spec_repo_commit": "0498d5b9" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-02-26 17:41:54.579763", - "spec_repo_commit": "e04872fb" + "regenerated": "2025-02-26 20:59:21.123591", + "spec_repo_commit": "0498d5b9" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index faa8d0f140e..9ab39bad114 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1809,6 +1809,208 @@ components: oneOf: - $ref: '#/components/schemas/AWSIntegrationUpdate' - $ref: '#/components/schemas/HTTPIntegrationUpdate' + ActionQuery: + description: An action query. This query type is used to trigger an action, + such as sending a HTTP request. + properties: + events: + description: Events to listen for downstream of the action query. + items: + $ref: '#/components/schemas/AppBuilderEvent' + type: array + id: + description: The ID of the action query. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid + type: string + name: + description: A unique identifier for this action query. This name is also + used to access the query's result throughout the app. + example: fetchPendingOrders + type: string + properties: + $ref: '#/components/schemas/ActionQueryProperties' + type: + $ref: '#/components/schemas/ActionQueryType' + required: + - id + - name + - type + - properties + type: object + ActionQueryCondition: + description: Whether to run this query. If specified, the query will only run + if this condition evaluates to `true` in JavaScript and all other conditions + are also met. + oneOf: + - type: boolean + - example: ${true} + type: string + ActionQueryDebounceInMs: + description: The minimum time in milliseconds that must pass before the query + can be triggered again. This is useful for preventing accidental double-clicks + from triggering the query multiple times. + oneOf: + - example: 310.5 + format: double + type: number + - description: If this is a string, it must be a valid JavaScript expression + that evaluates to a number. + example: ${1000} + type: string + ActionQueryMockedOutputs: + description: The mocked outputs of the action query. This is useful for testing + the app without actually running the action. + oneOf: + - type: string + - $ref: '#/components/schemas/ActionQueryMockedOutputsObject' + ActionQueryMockedOutputsEnabled: + description: Whether to enable the mocked outputs for testing. + oneOf: + - type: boolean + - description: If this is a string, it must be a valid JavaScript expression + that evaluates to a boolean. + example: ${true} + type: string + ActionQueryMockedOutputsObject: + description: The mocked outputs of the action query. + properties: + enabled: + $ref: '#/components/schemas/ActionQueryMockedOutputsEnabled' + outputs: + description: The mocked outputs of the action query, serialized as JSON. + example: '{"status": "success"}' + type: string + required: + - enabled + type: object + ActionQueryOnlyTriggerManually: + description: Determines when this query is executed. If set to `false`, the + query will run when the app loads and whenever any query arguments change. + If set to `true`, the query will only run when manually triggered from elsewhere + in the app. + oneOf: + - type: boolean + - description: If this is a string, it must be a valid JavaScript expression + that evaluates to a boolean. + example: ${true} + type: string + ActionQueryPollingIntervalInMs: + description: If specified, the app will poll the query at the specified interval + in milliseconds. The minimum polling interval is 15 seconds. The query will + only poll when the app's browser tab is active. + oneOf: + - example: 30000.0 + format: double + minimum: 15000.0 + type: number + - description: If this is a string, it must be a valid JavaScript expression + that evaluates to a number. + example: ${15000} + type: string + ActionQueryProperties: + description: The properties of the action query. + properties: + condition: + $ref: '#/components/schemas/ActionQueryCondition' + debounceInMs: + $ref: '#/components/schemas/ActionQueryDebounceInMs' + mockedOutputs: + $ref: '#/components/schemas/ActionQueryMockedOutputs' + onlyTriggerManually: + $ref: '#/components/schemas/ActionQueryOnlyTriggerManually' + outputs: + description: The post-query transformation function, which is a JavaScript + function that changes the query's `.outputs` property after the query's + execution. + example: ${((outputs) => {return outputs.body.data})(self.rawOutputs)} + type: string + pollingIntervalInMs: + $ref: '#/components/schemas/ActionQueryPollingIntervalInMs' + requiresConfirmation: + $ref: '#/components/schemas/ActionQueryRequiresConfirmation' + showToastOnError: + $ref: '#/components/schemas/ActionQueryShowToastOnError' + spec: + $ref: '#/components/schemas/ActionQuerySpec' + required: + - spec + type: object + ActionQueryRequiresConfirmation: + description: Whether to prompt the user to confirm this query before it runs. + oneOf: + - type: boolean + - description: If this is a string, it must be a valid JavaScript expression + that evaluates to a boolean. + example: ${true} + type: string + ActionQueryShowToastOnError: + description: Whether to display a toast to the user when the query returns an + error. + oneOf: + - type: boolean + - description: If this is a string, it must be a valid JavaScript expression + that evaluates to a boolean. + example: ${true} + type: string + ActionQuerySpec: + description: The definition of the action query. + oneOf: + - type: string + - $ref: '#/components/schemas/ActionQuerySpecObject' + ActionQuerySpecConnectionGroup: + description: The connection group to use for an action query. + properties: + id: + description: The ID of the connection group. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid + type: string + tags: + description: The tags of the connection group. + items: + type: string + type: array + type: object + ActionQuerySpecInput: + additionalProperties: {} + description: The inputs to the action query. See the [Actions Catalog](https://docs.datadoghq.com/actions/actions_catalog/) + for more detail on each action and its inputs. + type: object + ActionQuerySpecInputs: + description: The inputs to the action query. These are the values that are passed + to the action when it is triggered. + oneOf: + - type: string + - $ref: '#/components/schemas/ActionQuerySpecInput' + ActionQuerySpecObject: + description: The action query spec object. + properties: + connectionGroup: + $ref: '#/components/schemas/ActionQuerySpecConnectionGroup' + connectionId: + description: The ID of the custom connection to use for this action query. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid + type: string + fqn: + description: The fully qualified name of the action type. + example: com.datadoghq.http.request + type: string + inputs: + $ref: '#/components/schemas/ActionQuerySpecInputs' + required: + - fqn + type: object + ActionQueryType: + default: action + description: The action query type. + enum: + - action + example: action + type: string + x-enum-varnames: + - ACTION ActiveBillingDimensionsAttributes: description: List of active billing dimensions. properties: @@ -9563,6 +9765,48 @@ components: type: number type: array type: object + DataTransform: + description: A data transformer, which is custom JavaScript code that executes + and transforms data when its inputs change. + properties: + id: + description: The ID of the data transformer. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid + type: string + name: + description: A unique identifier for this data transformer. This name is + also used to access the transformer's result throughout the app. + example: combineTwoOrders + type: string + properties: + $ref: '#/components/schemas/DataTransformProperties' + type: + $ref: '#/components/schemas/DataTransformType' + required: + - id + - name + - type + - properties + type: object + DataTransformProperties: + description: The properties of the data transformer. + properties: + outputs: + description: A JavaScript function that returns the transformed data. + example: "${(() => {return {\n allItems: [...fetchOrder1.outputs.items, + ...fetchOrder2.outputs.items],\n}})()}" + type: string + type: object + DataTransformType: + default: dataTransform + description: The data transform type. + enum: + - dataTransform + example: dataTransform + type: string + x-enum-varnames: + - DATATRANSFORM Date: description: Date as Unix timestamp in milliseconds. example: 1722439510282 @@ -21711,34 +21955,12 @@ components: $ref: '#/components/schemas/Deployment' type: object Query: - description: A query used by an app. This can take the form of an external action, - a data transformation, or a state variable change. - properties: - events: - description: Events to listen for downstream of the query. - items: - $ref: '#/components/schemas/AppBuilderEvent' - type: array - id: - description: The ID of the query. - example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 - format: uuid - type: string - name: - description: The name of the query. The name must be unique within the app - and is visible in the app editor. - example: '' - type: string - properties: - description: The properties of the query. The properties vary depending - on the query type. - type: - $ref: '#/components/schemas/QueryType' - required: - - id - - name - - type - type: object + description: A data query used by an app. This can take the form of an external + action, a data transformation, or a state variable. + oneOf: + - $ref: '#/components/schemas/ActionQuery' + - $ref: '#/components/schemas/DataTransform' + - $ref: '#/components/schemas/StateVariable' QueryFormula: description: A formula for calculation based on one or more queries. properties: @@ -21762,18 +21984,6 @@ components: x-enum-varnames: - ASC - DESC - QueryType: - description: The query type. - enum: - - action - - stateVariable - - dataTransform - example: action - type: string - x-enum-varnames: - - ACTION - - STATEVARIABLE - - DATATRANSFORM RUMAggregateBucketValue: description: A bucket value, can be either a timeseries or a single value. oneOf: @@ -29736,6 +29946,46 @@ components: - PASS - FAIL - SKIP + StateVariable: + description: A variable, which can be set and read by other components in the + app. + properties: + id: + description: The ID of the state variable. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid + type: string + name: + description: A unique identifier for this state variable. This name is also + used to access the variable's value throughout the app. + example: ordersToSubmit + type: string + properties: + $ref: '#/components/schemas/StateVariableProperties' + type: + $ref: '#/components/schemas/StateVariableType' + required: + - id + - name + - type + - properties + type: object + StateVariableProperties: + description: The properties of the state variable. + properties: + defaultValue: + description: The default value of the state variable. + example: ${['order_3145', 'order_4920']} + type: object + StateVariableType: + default: stateVariable + description: The state variable type. + enum: + - stateVariable + example: stateVariable + type: string + x-enum-varnames: + - STATEVARIABLE Step: description: A Step is a sub-component of a workflow. Each Step performs an action. @@ -33494,8 +33744,6 @@ paths: operator: OR permissions: - apps_write - x-unstable: '**Note**: App Builder API endpoints are still under active development - and might change at any time.' get: description: List all apps, with optional filters and sorting. This endpoint is paginated. Only basic app information such as the app ID, name, and description @@ -33604,8 +33852,6 @@ paths: operator: OR permissions: - apps_run - x-unstable: '**Note**: App Builder API endpoints are still under active development - and might change at any time.' post: description: Create a new app, returning the app ID. operationId: CreateApp @@ -33645,8 +33891,6 @@ paths: - apps_write - connections_resolve - workflows_run - x-unstable: '**Note**: App Builder API endpoints are still under active development - and might change at any time.' /api/v2/app-builder/apps/{app_id}: delete: description: Delete a single app. @@ -33700,8 +33944,6 @@ paths: operator: OR permissions: - apps_write - x-unstable: '**Note**: App Builder API endpoints are still under active development - and might change at any time.' get: description: Get the full definition of an app. operationId: GetApp @@ -33748,6 +33990,12 @@ paths: schema: $ref: '#/components/schemas/JSONAPIErrorResponse' description: Not Found + '410': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Gone '429': $ref: '#/components/responses/TooManyRequestsResponse' summary: Get App @@ -33758,8 +34006,6 @@ paths: permissions: - apps_run - connections_read - x-unstable: '**Note**: App Builder API endpoints are still under active development - and might change at any time.' patch: description: Update an existing app. This creates a new version of the app. operationId: UpdateApp @@ -33808,8 +34054,6 @@ paths: - apps_write - connections_resolve - workflows_run - x-unstable: '**Note**: App Builder API endpoints are still under active development - and might change at any time.' /api/v2/app-builder/apps/{app_id}/deployment: delete: description: Unpublish an app, removing the live version of the app. Unpublishing @@ -33860,8 +34104,6 @@ paths: operator: OR permissions: - apps_write - x-unstable: '**Note**: App Builder API endpoints are still under active development - and might change at any time.' post: description: Publish an app for use by other users. To ensure the app is accessible to the correct users, you also need to set a [Restriction Policy](https://docs.datadoghq.com/api/latest/restriction-policies/) @@ -33910,8 +34152,6 @@ paths: operator: OR permissions: - apps_write - x-unstable: '**Note**: App Builder API endpoints are still under active development - and might change at any time.' /api/v2/application_keys: get: description: List all application keys available for your org diff --git a/api/datadog/configuration.go b/api/datadog/configuration.go index 9d78f51152c..0c69441dacb 100644 --- a/api/datadog/configuration.go +++ b/api/datadog/configuration.go @@ -328,14 +328,6 @@ func NewConfiguration() *Configuration { "v2.GetOpenAPI": false, "v2.ListAPIs": false, "v2.UpdateOpenAPI": false, - "v2.CreateApp": false, - "v2.DeleteApp": false, - "v2.DeleteApps": false, - "v2.GetApp": false, - "v2.ListApps": false, - "v2.PublishApp": false, - "v2.UnpublishApp": false, - "v2.UpdateApp": false, "v2.CancelDataDeletionRequest": false, "v2.CreateDataDeletionRequest": false, "v2.GetDataDeletionRequests": false, diff --git a/api/datadogV2/api_app_builder.go b/api/datadogV2/api_app_builder.go index 0fb5aab2ec1..dacb5bc3bfa 100644 --- a/api/datadogV2/api_app_builder.go +++ b/api/datadogV2/api_app_builder.go @@ -6,8 +6,6 @@ package datadogV2 import ( _context "context" - _fmt "fmt" - _log "log" _nethttp "net/http" _neturl "net/url" @@ -27,15 +25,6 @@ func (a *AppBuilderApi) CreateApp(ctx _context.Context, body CreateAppRequest) ( localVarReturnValue CreateAppResponse ) - operationId := "v2.CreateApp" - isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) - if !isOperationEnabled { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} - } - if isOperationEnabled && a.Client.Cfg.Debug { - _log.Printf("WARNING: Using unstable operation '%s'", operationId) - } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.CreateApp") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -118,15 +107,6 @@ func (a *AppBuilderApi) DeleteApp(ctx _context.Context, appId uuid.UUID) (Delete localVarReturnValue DeleteAppResponse ) - operationId := "v2.DeleteApp" - isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) - if !isOperationEnabled { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} - } - if isOperationEnabled && a.Client.Cfg.Debug { - _log.Printf("WARNING: Using unstable operation '%s'", operationId) - } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.DeleteApp") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -207,15 +187,6 @@ func (a *AppBuilderApi) DeleteApps(ctx _context.Context, body DeleteAppsRequest) localVarReturnValue DeleteAppsResponse ) - operationId := "v2.DeleteApps" - isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) - if !isOperationEnabled { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} - } - if isOperationEnabled && a.Client.Cfg.Debug { - _log.Printf("WARNING: Using unstable operation '%s'", operationId) - } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.DeleteApps") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -323,15 +294,6 @@ func (a *AppBuilderApi) GetApp(ctx _context.Context, appId uuid.UUID, o ...GetAp optionalParams = o[0] } - operationId := "v2.GetApp" - isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) - if !isOperationEnabled { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} - } - if isOperationEnabled && a.Client.Cfg.Debug { - _log.Printf("WARNING: Using unstable operation '%s'", operationId) - } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.GetApp") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -374,7 +336,7 @@ func (a *AppBuilderApi) GetApp(ctx _context.Context, appId uuid.UUID, o ...GetAp ErrorBody: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 410 { var v JSONAPIErrorResponse err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -510,15 +472,6 @@ func (a *AppBuilderApi) ListApps(ctx _context.Context, o ...ListAppsOptionalPara optionalParams = o[0] } - operationId := "v2.ListApps" - isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) - if !isOperationEnabled { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} - } - if isOperationEnabled && a.Client.Cfg.Debug { - _log.Printf("WARNING: Using unstable operation '%s'", operationId) - } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.ListApps") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -631,15 +584,6 @@ func (a *AppBuilderApi) PublishApp(ctx _context.Context, appId uuid.UUID) (Publi localVarReturnValue PublishAppResponse ) - operationId := "v2.PublishApp" - isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) - if !isOperationEnabled { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} - } - if isOperationEnabled && a.Client.Cfg.Debug { - _log.Printf("WARNING: Using unstable operation '%s'", operationId) - } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.PublishApp") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -720,15 +664,6 @@ func (a *AppBuilderApi) UnpublishApp(ctx _context.Context, appId uuid.UUID) (Unp localVarReturnValue UnpublishAppResponse ) - operationId := "v2.UnpublishApp" - isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) - if !isOperationEnabled { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} - } - if isOperationEnabled && a.Client.Cfg.Debug { - _log.Printf("WARNING: Using unstable operation '%s'", operationId) - } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.UnpublishApp") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -809,15 +744,6 @@ func (a *AppBuilderApi) UpdateApp(ctx _context.Context, appId uuid.UUID, body Up localVarReturnValue UpdateAppResponse ) - operationId := "v2.UpdateApp" - isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) - if !isOperationEnabled { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} - } - if isOperationEnabled && a.Client.Cfg.Debug { - _log.Printf("WARNING: Using unstable operation '%s'", operationId) - } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppBuilderApi.UpdateApp") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} diff --git a/api/datadogV2/model_action_query.go b/api/datadogV2/model_action_query.go new file mode 100644 index 00000000000..7861d802e43 --- /dev/null +++ b/api/datadogV2/model_action_query.go @@ -0,0 +1,249 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/google/uuid" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ActionQuery An action query. This query type is used to trigger an action, such as sending a HTTP request. +type ActionQuery struct { + // Events to listen for downstream of the action query. + Events []AppBuilderEvent `json:"events,omitempty"` + // The ID of the action query. + Id uuid.UUID `json:"id"` + // A unique identifier for this action query. This name is also used to access the query's result throughout the app. + Name string `json:"name"` + // The properties of the action query. + Properties ActionQueryProperties `json:"properties"` + // The action query type. + Type ActionQueryType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewActionQuery instantiates a new ActionQuery object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewActionQuery(id uuid.UUID, name string, properties ActionQueryProperties, typeVar ActionQueryType) *ActionQuery { + this := ActionQuery{} + this.Id = id + this.Name = name + this.Properties = properties + this.Type = typeVar + return &this +} + +// NewActionQueryWithDefaults instantiates a new ActionQuery object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewActionQueryWithDefaults() *ActionQuery { + this := ActionQuery{} + var typeVar ActionQueryType = ACTIONQUERYTYPE_ACTION + this.Type = typeVar + return &this +} + +// GetEvents returns the Events field value if set, zero value otherwise. +func (o *ActionQuery) GetEvents() []AppBuilderEvent { + if o == nil || o.Events == nil { + var ret []AppBuilderEvent + return ret + } + return o.Events +} + +// GetEventsOk returns a tuple with the Events field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionQuery) GetEventsOk() (*[]AppBuilderEvent, bool) { + if o == nil || o.Events == nil { + return nil, false + } + return &o.Events, true +} + +// HasEvents returns a boolean if a field has been set. +func (o *ActionQuery) HasEvents() bool { + return o != nil && o.Events != nil +} + +// SetEvents gets a reference to the given []AppBuilderEvent and assigns it to the Events field. +func (o *ActionQuery) SetEvents(v []AppBuilderEvent) { + o.Events = v +} + +// GetId returns the Id field value. +func (o *ActionQuery) GetId() uuid.UUID { + if o == nil { + var ret uuid.UUID + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ActionQuery) GetIdOk() (*uuid.UUID, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *ActionQuery) SetId(v uuid.UUID) { + o.Id = v +} + +// GetName returns the Name field value. +func (o *ActionQuery) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ActionQuery) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *ActionQuery) SetName(v string) { + o.Name = v +} + +// GetProperties returns the Properties field value. +func (o *ActionQuery) GetProperties() ActionQueryProperties { + if o == nil { + var ret ActionQueryProperties + return ret + } + return o.Properties +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +func (o *ActionQuery) GetPropertiesOk() (*ActionQueryProperties, bool) { + if o == nil { + return nil, false + } + return &o.Properties, true +} + +// SetProperties sets field value. +func (o *ActionQuery) SetProperties(v ActionQueryProperties) { + o.Properties = v +} + +// GetType returns the Type field value. +func (o *ActionQuery) GetType() ActionQueryType { + if o == nil { + var ret ActionQueryType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ActionQuery) GetTypeOk() (*ActionQueryType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *ActionQuery) SetType(v ActionQueryType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ActionQuery) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Events != nil { + toSerialize["events"] = o.Events + } + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["properties"] = o.Properties + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ActionQuery) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Events []AppBuilderEvent `json:"events,omitempty"` + Id *uuid.UUID `json:"id"` + Name *string `json:"name"` + Properties *ActionQueryProperties `json:"properties"` + Type *ActionQueryType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.Properties == nil { + return fmt.Errorf("required field properties missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"events", "id", "name", "properties", "type"}) + } else { + return err + } + + hasInvalidField := false + o.Events = all.Events + o.Id = *all.Id + o.Name = *all.Name + if all.Properties.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Properties = *all.Properties + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_action_query_condition.go b/api/datadogV2/model_action_query_condition.go new file mode 100644 index 00000000000..b0ffc3183ed --- /dev/null +++ b/api/datadogV2/model_action_query_condition.go @@ -0,0 +1,105 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ActionQueryCondition - Whether to run this query. If specified, the query will only run if this condition evaluates to `true` in JavaScript and all other conditions are also met. +type ActionQueryCondition struct { + Bool *bool + String *string + + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} +} + +// BoolAsActionQueryCondition is a convenience function that returns bool wrapped in ActionQueryCondition. +func BoolAsActionQueryCondition(v *bool) ActionQueryCondition { + return ActionQueryCondition{Bool: v} +} + +// StringAsActionQueryCondition is a convenience function that returns string wrapped in ActionQueryCondition. +func StringAsActionQueryCondition(v *string) ActionQueryCondition { + return ActionQueryCondition{String: v} +} + +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *ActionQueryCondition) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Bool + err = datadog.Unmarshal(data, &obj.Bool) + if err == nil { + if obj.Bool != nil { + jsonBool, _ := datadog.Marshal(obj.Bool) + if string(jsonBool) == "{}" { // empty struct + obj.Bool = nil + } else { + match++ + } + } else { + obj.Bool = nil + } + } else { + obj.Bool = nil + } + + // try to unmarshal data into String + err = datadog.Unmarshal(data, &obj.String) + if err == nil { + if obj.String != nil { + jsonString, _ := datadog.Marshal(obj.String) + if string(jsonString) == "{}" { // empty struct + obj.String = nil + } else { + match++ + } + } else { + obj.String = nil + } + } else { + obj.String = nil + } + + if match != 1 { // more than 1 match + // reset to nil + obj.Bool = nil + obj.String = nil + return datadog.Unmarshal(data, &obj.UnparsedObject) + } + return nil // exactly one match +} + +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj ActionQueryCondition) MarshalJSON() ([]byte, error) { + if obj.Bool != nil { + return datadog.Marshal(&obj.Bool) + } + + if obj.String != nil { + return datadog.Marshal(&obj.String) + } + + if obj.UnparsedObject != nil { + return datadog.Marshal(obj.UnparsedObject) + } + return nil, nil // no data in oneOf schemas +} + +// GetActualInstance returns the actual instance. +func (obj *ActionQueryCondition) GetActualInstance() interface{} { + if obj.Bool != nil { + return obj.Bool + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} diff --git a/api/datadogV2/model_action_query_debounce_in_ms.go b/api/datadogV2/model_action_query_debounce_in_ms.go new file mode 100644 index 00000000000..9f2b22d2ba7 --- /dev/null +++ b/api/datadogV2/model_action_query_debounce_in_ms.go @@ -0,0 +1,105 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ActionQueryDebounceInMs - The minimum time in milliseconds that must pass before the query can be triggered again. This is useful for preventing accidental double-clicks from triggering the query multiple times. +type ActionQueryDebounceInMs struct { + Float64 *float64 + String *string + + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} +} + +// Float64AsActionQueryDebounceInMs is a convenience function that returns float64 wrapped in ActionQueryDebounceInMs. +func Float64AsActionQueryDebounceInMs(v *float64) ActionQueryDebounceInMs { + return ActionQueryDebounceInMs{Float64: v} +} + +// StringAsActionQueryDebounceInMs is a convenience function that returns string wrapped in ActionQueryDebounceInMs. +func StringAsActionQueryDebounceInMs(v *string) ActionQueryDebounceInMs { + return ActionQueryDebounceInMs{String: v} +} + +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *ActionQueryDebounceInMs) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Float64 + err = datadog.Unmarshal(data, &obj.Float64) + if err == nil { + if obj.Float64 != nil { + jsonFloat64, _ := datadog.Marshal(obj.Float64) + if string(jsonFloat64) == "{}" { // empty struct + obj.Float64 = nil + } else { + match++ + } + } else { + obj.Float64 = nil + } + } else { + obj.Float64 = nil + } + + // try to unmarshal data into String + err = datadog.Unmarshal(data, &obj.String) + if err == nil { + if obj.String != nil { + jsonString, _ := datadog.Marshal(obj.String) + if string(jsonString) == "{}" { // empty struct + obj.String = nil + } else { + match++ + } + } else { + obj.String = nil + } + } else { + obj.String = nil + } + + if match != 1 { // more than 1 match + // reset to nil + obj.Float64 = nil + obj.String = nil + return datadog.Unmarshal(data, &obj.UnparsedObject) + } + return nil // exactly one match +} + +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj ActionQueryDebounceInMs) MarshalJSON() ([]byte, error) { + if obj.Float64 != nil { + return datadog.Marshal(&obj.Float64) + } + + if obj.String != nil { + return datadog.Marshal(&obj.String) + } + + if obj.UnparsedObject != nil { + return datadog.Marshal(obj.UnparsedObject) + } + return nil, nil // no data in oneOf schemas +} + +// GetActualInstance returns the actual instance. +func (obj *ActionQueryDebounceInMs) GetActualInstance() interface{} { + if obj.Float64 != nil { + return obj.Float64 + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} diff --git a/api/datadogV2/model_action_query_mocked_outputs.go b/api/datadogV2/model_action_query_mocked_outputs.go new file mode 100644 index 00000000000..23bf59a2195 --- /dev/null +++ b/api/datadogV2/model_action_query_mocked_outputs.go @@ -0,0 +1,105 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ActionQueryMockedOutputs - The mocked outputs of the action query. This is useful for testing the app without actually running the action. +type ActionQueryMockedOutputs struct { + String *string + ActionQueryMockedOutputsObject *ActionQueryMockedOutputsObject + + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} +} + +// StringAsActionQueryMockedOutputs is a convenience function that returns string wrapped in ActionQueryMockedOutputs. +func StringAsActionQueryMockedOutputs(v *string) ActionQueryMockedOutputs { + return ActionQueryMockedOutputs{String: v} +} + +// ActionQueryMockedOutputsObjectAsActionQueryMockedOutputs is a convenience function that returns ActionQueryMockedOutputsObject wrapped in ActionQueryMockedOutputs. +func ActionQueryMockedOutputsObjectAsActionQueryMockedOutputs(v *ActionQueryMockedOutputsObject) ActionQueryMockedOutputs { + return ActionQueryMockedOutputs{ActionQueryMockedOutputsObject: v} +} + +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *ActionQueryMockedOutputs) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into String + err = datadog.Unmarshal(data, &obj.String) + if err == nil { + if obj.String != nil { + jsonString, _ := datadog.Marshal(obj.String) + if string(jsonString) == "{}" { // empty struct + obj.String = nil + } else { + match++ + } + } else { + obj.String = nil + } + } else { + obj.String = nil + } + + // try to unmarshal data into ActionQueryMockedOutputsObject + err = datadog.Unmarshal(data, &obj.ActionQueryMockedOutputsObject) + if err == nil { + if obj.ActionQueryMockedOutputsObject != nil && obj.ActionQueryMockedOutputsObject.UnparsedObject == nil { + jsonActionQueryMockedOutputsObject, _ := datadog.Marshal(obj.ActionQueryMockedOutputsObject) + if string(jsonActionQueryMockedOutputsObject) == "{}" { // empty struct + obj.ActionQueryMockedOutputsObject = nil + } else { + match++ + } + } else { + obj.ActionQueryMockedOutputsObject = nil + } + } else { + obj.ActionQueryMockedOutputsObject = nil + } + + if match != 1 { // more than 1 match + // reset to nil + obj.String = nil + obj.ActionQueryMockedOutputsObject = nil + return datadog.Unmarshal(data, &obj.UnparsedObject) + } + return nil // exactly one match +} + +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj ActionQueryMockedOutputs) MarshalJSON() ([]byte, error) { + if obj.String != nil { + return datadog.Marshal(&obj.String) + } + + if obj.ActionQueryMockedOutputsObject != nil { + return datadog.Marshal(&obj.ActionQueryMockedOutputsObject) + } + + if obj.UnparsedObject != nil { + return datadog.Marshal(obj.UnparsedObject) + } + return nil, nil // no data in oneOf schemas +} + +// GetActualInstance returns the actual instance. +func (obj *ActionQueryMockedOutputs) GetActualInstance() interface{} { + if obj.String != nil { + return obj.String + } + + if obj.ActionQueryMockedOutputsObject != nil { + return obj.ActionQueryMockedOutputsObject + } + + // all schemas are nil + return nil +} diff --git a/api/datadogV2/model_action_query_mocked_outputs_enabled.go b/api/datadogV2/model_action_query_mocked_outputs_enabled.go new file mode 100644 index 00000000000..d5c70c19019 --- /dev/null +++ b/api/datadogV2/model_action_query_mocked_outputs_enabled.go @@ -0,0 +1,105 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ActionQueryMockedOutputsEnabled - Whether to enable the mocked outputs for testing. +type ActionQueryMockedOutputsEnabled struct { + Bool *bool + String *string + + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} +} + +// BoolAsActionQueryMockedOutputsEnabled is a convenience function that returns bool wrapped in ActionQueryMockedOutputsEnabled. +func BoolAsActionQueryMockedOutputsEnabled(v *bool) ActionQueryMockedOutputsEnabled { + return ActionQueryMockedOutputsEnabled{Bool: v} +} + +// StringAsActionQueryMockedOutputsEnabled is a convenience function that returns string wrapped in ActionQueryMockedOutputsEnabled. +func StringAsActionQueryMockedOutputsEnabled(v *string) ActionQueryMockedOutputsEnabled { + return ActionQueryMockedOutputsEnabled{String: v} +} + +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *ActionQueryMockedOutputsEnabled) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Bool + err = datadog.Unmarshal(data, &obj.Bool) + if err == nil { + if obj.Bool != nil { + jsonBool, _ := datadog.Marshal(obj.Bool) + if string(jsonBool) == "{}" { // empty struct + obj.Bool = nil + } else { + match++ + } + } else { + obj.Bool = nil + } + } else { + obj.Bool = nil + } + + // try to unmarshal data into String + err = datadog.Unmarshal(data, &obj.String) + if err == nil { + if obj.String != nil { + jsonString, _ := datadog.Marshal(obj.String) + if string(jsonString) == "{}" { // empty struct + obj.String = nil + } else { + match++ + } + } else { + obj.String = nil + } + } else { + obj.String = nil + } + + if match != 1 { // more than 1 match + // reset to nil + obj.Bool = nil + obj.String = nil + return datadog.Unmarshal(data, &obj.UnparsedObject) + } + return nil // exactly one match +} + +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj ActionQueryMockedOutputsEnabled) MarshalJSON() ([]byte, error) { + if obj.Bool != nil { + return datadog.Marshal(&obj.Bool) + } + + if obj.String != nil { + return datadog.Marshal(&obj.String) + } + + if obj.UnparsedObject != nil { + return datadog.Marshal(obj.UnparsedObject) + } + return nil, nil // no data in oneOf schemas +} + +// GetActualInstance returns the actual instance. +func (obj *ActionQueryMockedOutputsEnabled) GetActualInstance() interface{} { + if obj.Bool != nil { + return obj.Bool + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} diff --git a/api/datadogV2/model_action_query_mocked_outputs_object.go b/api/datadogV2/model_action_query_mocked_outputs_object.go new file mode 100644 index 00000000000..d91f6d294c4 --- /dev/null +++ b/api/datadogV2/model_action_query_mocked_outputs_object.go @@ -0,0 +1,136 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ActionQueryMockedOutputsObject The mocked outputs of the action query. +type ActionQueryMockedOutputsObject struct { + // Whether to enable the mocked outputs for testing. + Enabled ActionQueryMockedOutputsEnabled `json:"enabled"` + // The mocked outputs of the action query, serialized as JSON. + Outputs *string `json:"outputs,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewActionQueryMockedOutputsObject instantiates a new ActionQueryMockedOutputsObject object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewActionQueryMockedOutputsObject(enabled ActionQueryMockedOutputsEnabled) *ActionQueryMockedOutputsObject { + this := ActionQueryMockedOutputsObject{} + this.Enabled = enabled + return &this +} + +// NewActionQueryMockedOutputsObjectWithDefaults instantiates a new ActionQueryMockedOutputsObject object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewActionQueryMockedOutputsObjectWithDefaults() *ActionQueryMockedOutputsObject { + this := ActionQueryMockedOutputsObject{} + return &this +} + +// GetEnabled returns the Enabled field value. +func (o *ActionQueryMockedOutputsObject) GetEnabled() ActionQueryMockedOutputsEnabled { + if o == nil { + var ret ActionQueryMockedOutputsEnabled + return ret + } + return o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value +// and a boolean to check if the value has been set. +func (o *ActionQueryMockedOutputsObject) GetEnabledOk() (*ActionQueryMockedOutputsEnabled, bool) { + if o == nil { + return nil, false + } + return &o.Enabled, true +} + +// SetEnabled sets field value. +func (o *ActionQueryMockedOutputsObject) SetEnabled(v ActionQueryMockedOutputsEnabled) { + o.Enabled = v +} + +// GetOutputs returns the Outputs field value if set, zero value otherwise. +func (o *ActionQueryMockedOutputsObject) GetOutputs() string { + if o == nil || o.Outputs == nil { + var ret string + return ret + } + return *o.Outputs +} + +// GetOutputsOk returns a tuple with the Outputs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionQueryMockedOutputsObject) GetOutputsOk() (*string, bool) { + if o == nil || o.Outputs == nil { + return nil, false + } + return o.Outputs, true +} + +// HasOutputs returns a boolean if a field has been set. +func (o *ActionQueryMockedOutputsObject) HasOutputs() bool { + return o != nil && o.Outputs != nil +} + +// SetOutputs gets a reference to the given string and assigns it to the Outputs field. +func (o *ActionQueryMockedOutputsObject) SetOutputs(v string) { + o.Outputs = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ActionQueryMockedOutputsObject) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["enabled"] = o.Enabled + if o.Outputs != nil { + toSerialize["outputs"] = o.Outputs + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ActionQueryMockedOutputsObject) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Enabled *ActionQueryMockedOutputsEnabled `json:"enabled"` + Outputs *string `json:"outputs,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Enabled == nil { + return fmt.Errorf("required field enabled missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"enabled", "outputs"}) + } else { + return err + } + o.Enabled = *all.Enabled + o.Outputs = all.Outputs + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_action_query_only_trigger_manually.go b/api/datadogV2/model_action_query_only_trigger_manually.go new file mode 100644 index 00000000000..3979f32c6b3 --- /dev/null +++ b/api/datadogV2/model_action_query_only_trigger_manually.go @@ -0,0 +1,105 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ActionQueryOnlyTriggerManually - Determines when this query is executed. If set to `false`, the query will run when the app loads and whenever any query arguments change. If set to `true`, the query will only run when manually triggered from elsewhere in the app. +type ActionQueryOnlyTriggerManually struct { + Bool *bool + String *string + + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} +} + +// BoolAsActionQueryOnlyTriggerManually is a convenience function that returns bool wrapped in ActionQueryOnlyTriggerManually. +func BoolAsActionQueryOnlyTriggerManually(v *bool) ActionQueryOnlyTriggerManually { + return ActionQueryOnlyTriggerManually{Bool: v} +} + +// StringAsActionQueryOnlyTriggerManually is a convenience function that returns string wrapped in ActionQueryOnlyTriggerManually. +func StringAsActionQueryOnlyTriggerManually(v *string) ActionQueryOnlyTriggerManually { + return ActionQueryOnlyTriggerManually{String: v} +} + +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *ActionQueryOnlyTriggerManually) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Bool + err = datadog.Unmarshal(data, &obj.Bool) + if err == nil { + if obj.Bool != nil { + jsonBool, _ := datadog.Marshal(obj.Bool) + if string(jsonBool) == "{}" { // empty struct + obj.Bool = nil + } else { + match++ + } + } else { + obj.Bool = nil + } + } else { + obj.Bool = nil + } + + // try to unmarshal data into String + err = datadog.Unmarshal(data, &obj.String) + if err == nil { + if obj.String != nil { + jsonString, _ := datadog.Marshal(obj.String) + if string(jsonString) == "{}" { // empty struct + obj.String = nil + } else { + match++ + } + } else { + obj.String = nil + } + } else { + obj.String = nil + } + + if match != 1 { // more than 1 match + // reset to nil + obj.Bool = nil + obj.String = nil + return datadog.Unmarshal(data, &obj.UnparsedObject) + } + return nil // exactly one match +} + +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj ActionQueryOnlyTriggerManually) MarshalJSON() ([]byte, error) { + if obj.Bool != nil { + return datadog.Marshal(&obj.Bool) + } + + if obj.String != nil { + return datadog.Marshal(&obj.String) + } + + if obj.UnparsedObject != nil { + return datadog.Marshal(obj.UnparsedObject) + } + return nil, nil // no data in oneOf schemas +} + +// GetActualInstance returns the actual instance. +func (obj *ActionQueryOnlyTriggerManually) GetActualInstance() interface{} { + if obj.Bool != nil { + return obj.Bool + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} diff --git a/api/datadogV2/model_action_query_polling_interval_in_ms.go b/api/datadogV2/model_action_query_polling_interval_in_ms.go new file mode 100644 index 00000000000..05e925beb03 --- /dev/null +++ b/api/datadogV2/model_action_query_polling_interval_in_ms.go @@ -0,0 +1,105 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ActionQueryPollingIntervalInMs - If specified, the app will poll the query at the specified interval in milliseconds. The minimum polling interval is 15 seconds. The query will only poll when the app's browser tab is active. +type ActionQueryPollingIntervalInMs struct { + Float64 *float64 + String *string + + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} +} + +// Float64AsActionQueryPollingIntervalInMs is a convenience function that returns float64 wrapped in ActionQueryPollingIntervalInMs. +func Float64AsActionQueryPollingIntervalInMs(v *float64) ActionQueryPollingIntervalInMs { + return ActionQueryPollingIntervalInMs{Float64: v} +} + +// StringAsActionQueryPollingIntervalInMs is a convenience function that returns string wrapped in ActionQueryPollingIntervalInMs. +func StringAsActionQueryPollingIntervalInMs(v *string) ActionQueryPollingIntervalInMs { + return ActionQueryPollingIntervalInMs{String: v} +} + +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *ActionQueryPollingIntervalInMs) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Float64 + err = datadog.Unmarshal(data, &obj.Float64) + if err == nil { + if obj.Float64 != nil { + jsonFloat64, _ := datadog.Marshal(obj.Float64) + if string(jsonFloat64) == "{}" { // empty struct + obj.Float64 = nil + } else { + match++ + } + } else { + obj.Float64 = nil + } + } else { + obj.Float64 = nil + } + + // try to unmarshal data into String + err = datadog.Unmarshal(data, &obj.String) + if err == nil { + if obj.String != nil { + jsonString, _ := datadog.Marshal(obj.String) + if string(jsonString) == "{}" { // empty struct + obj.String = nil + } else { + match++ + } + } else { + obj.String = nil + } + } else { + obj.String = nil + } + + if match != 1 { // more than 1 match + // reset to nil + obj.Float64 = nil + obj.String = nil + return datadog.Unmarshal(data, &obj.UnparsedObject) + } + return nil // exactly one match +} + +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj ActionQueryPollingIntervalInMs) MarshalJSON() ([]byte, error) { + if obj.Float64 != nil { + return datadog.Marshal(&obj.Float64) + } + + if obj.String != nil { + return datadog.Marshal(&obj.String) + } + + if obj.UnparsedObject != nil { + return datadog.Marshal(obj.UnparsedObject) + } + return nil, nil // no data in oneOf schemas +} + +// GetActualInstance returns the actual instance. +func (obj *ActionQueryPollingIntervalInMs) GetActualInstance() interface{} { + if obj.Float64 != nil { + return obj.Float64 + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} diff --git a/api/datadogV2/model_action_query_properties.go b/api/datadogV2/model_action_query_properties.go new file mode 100644 index 00000000000..b311f3d3b23 --- /dev/null +++ b/api/datadogV2/model_action_query_properties.go @@ -0,0 +1,381 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ActionQueryProperties The properties of the action query. +type ActionQueryProperties struct { + // Whether to run this query. If specified, the query will only run if this condition evaluates to `true` in JavaScript and all other conditions are also met. + Condition *ActionQueryCondition `json:"condition,omitempty"` + // The minimum time in milliseconds that must pass before the query can be triggered again. This is useful for preventing accidental double-clicks from triggering the query multiple times. + DebounceInMs *ActionQueryDebounceInMs `json:"debounceInMs,omitempty"` + // The mocked outputs of the action query. This is useful for testing the app without actually running the action. + MockedOutputs *ActionQueryMockedOutputs `json:"mockedOutputs,omitempty"` + // Determines when this query is executed. If set to `false`, the query will run when the app loads and whenever any query arguments change. If set to `true`, the query will only run when manually triggered from elsewhere in the app. + OnlyTriggerManually *ActionQueryOnlyTriggerManually `json:"onlyTriggerManually,omitempty"` + // The post-query transformation function, which is a JavaScript function that changes the query's `.outputs` property after the query's execution. + Outputs *string `json:"outputs,omitempty"` + // If specified, the app will poll the query at the specified interval in milliseconds. The minimum polling interval is 15 seconds. The query will only poll when the app's browser tab is active. + PollingIntervalInMs *ActionQueryPollingIntervalInMs `json:"pollingIntervalInMs,omitempty"` + // Whether to prompt the user to confirm this query before it runs. + RequiresConfirmation *ActionQueryRequiresConfirmation `json:"requiresConfirmation,omitempty"` + // Whether to display a toast to the user when the query returns an error. + ShowToastOnError *ActionQueryShowToastOnError `json:"showToastOnError,omitempty"` + // The definition of the action query. + Spec ActionQuerySpec `json:"spec"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewActionQueryProperties instantiates a new ActionQueryProperties object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewActionQueryProperties(spec ActionQuerySpec) *ActionQueryProperties { + this := ActionQueryProperties{} + this.Spec = spec + return &this +} + +// NewActionQueryPropertiesWithDefaults instantiates a new ActionQueryProperties object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewActionQueryPropertiesWithDefaults() *ActionQueryProperties { + this := ActionQueryProperties{} + return &this +} + +// GetCondition returns the Condition field value if set, zero value otherwise. +func (o *ActionQueryProperties) GetCondition() ActionQueryCondition { + if o == nil || o.Condition == nil { + var ret ActionQueryCondition + return ret + } + return *o.Condition +} + +// GetConditionOk returns a tuple with the Condition field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionQueryProperties) GetConditionOk() (*ActionQueryCondition, bool) { + if o == nil || o.Condition == nil { + return nil, false + } + return o.Condition, true +} + +// HasCondition returns a boolean if a field has been set. +func (o *ActionQueryProperties) HasCondition() bool { + return o != nil && o.Condition != nil +} + +// SetCondition gets a reference to the given ActionQueryCondition and assigns it to the Condition field. +func (o *ActionQueryProperties) SetCondition(v ActionQueryCondition) { + o.Condition = &v +} + +// GetDebounceInMs returns the DebounceInMs field value if set, zero value otherwise. +func (o *ActionQueryProperties) GetDebounceInMs() ActionQueryDebounceInMs { + if o == nil || o.DebounceInMs == nil { + var ret ActionQueryDebounceInMs + return ret + } + return *o.DebounceInMs +} + +// GetDebounceInMsOk returns a tuple with the DebounceInMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionQueryProperties) GetDebounceInMsOk() (*ActionQueryDebounceInMs, bool) { + if o == nil || o.DebounceInMs == nil { + return nil, false + } + return o.DebounceInMs, true +} + +// HasDebounceInMs returns a boolean if a field has been set. +func (o *ActionQueryProperties) HasDebounceInMs() bool { + return o != nil && o.DebounceInMs != nil +} + +// SetDebounceInMs gets a reference to the given ActionQueryDebounceInMs and assigns it to the DebounceInMs field. +func (o *ActionQueryProperties) SetDebounceInMs(v ActionQueryDebounceInMs) { + o.DebounceInMs = &v +} + +// GetMockedOutputs returns the MockedOutputs field value if set, zero value otherwise. +func (o *ActionQueryProperties) GetMockedOutputs() ActionQueryMockedOutputs { + if o == nil || o.MockedOutputs == nil { + var ret ActionQueryMockedOutputs + return ret + } + return *o.MockedOutputs +} + +// GetMockedOutputsOk returns a tuple with the MockedOutputs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionQueryProperties) GetMockedOutputsOk() (*ActionQueryMockedOutputs, bool) { + if o == nil || o.MockedOutputs == nil { + return nil, false + } + return o.MockedOutputs, true +} + +// HasMockedOutputs returns a boolean if a field has been set. +func (o *ActionQueryProperties) HasMockedOutputs() bool { + return o != nil && o.MockedOutputs != nil +} + +// SetMockedOutputs gets a reference to the given ActionQueryMockedOutputs and assigns it to the MockedOutputs field. +func (o *ActionQueryProperties) SetMockedOutputs(v ActionQueryMockedOutputs) { + o.MockedOutputs = &v +} + +// GetOnlyTriggerManually returns the OnlyTriggerManually field value if set, zero value otherwise. +func (o *ActionQueryProperties) GetOnlyTriggerManually() ActionQueryOnlyTriggerManually { + if o == nil || o.OnlyTriggerManually == nil { + var ret ActionQueryOnlyTriggerManually + return ret + } + return *o.OnlyTriggerManually +} + +// GetOnlyTriggerManuallyOk returns a tuple with the OnlyTriggerManually field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionQueryProperties) GetOnlyTriggerManuallyOk() (*ActionQueryOnlyTriggerManually, bool) { + if o == nil || o.OnlyTriggerManually == nil { + return nil, false + } + return o.OnlyTriggerManually, true +} + +// HasOnlyTriggerManually returns a boolean if a field has been set. +func (o *ActionQueryProperties) HasOnlyTriggerManually() bool { + return o != nil && o.OnlyTriggerManually != nil +} + +// SetOnlyTriggerManually gets a reference to the given ActionQueryOnlyTriggerManually and assigns it to the OnlyTriggerManually field. +func (o *ActionQueryProperties) SetOnlyTriggerManually(v ActionQueryOnlyTriggerManually) { + o.OnlyTriggerManually = &v +} + +// GetOutputs returns the Outputs field value if set, zero value otherwise. +func (o *ActionQueryProperties) GetOutputs() string { + if o == nil || o.Outputs == nil { + var ret string + return ret + } + return *o.Outputs +} + +// GetOutputsOk returns a tuple with the Outputs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionQueryProperties) GetOutputsOk() (*string, bool) { + if o == nil || o.Outputs == nil { + return nil, false + } + return o.Outputs, true +} + +// HasOutputs returns a boolean if a field has been set. +func (o *ActionQueryProperties) HasOutputs() bool { + return o != nil && o.Outputs != nil +} + +// SetOutputs gets a reference to the given string and assigns it to the Outputs field. +func (o *ActionQueryProperties) SetOutputs(v string) { + o.Outputs = &v +} + +// GetPollingIntervalInMs returns the PollingIntervalInMs field value if set, zero value otherwise. +func (o *ActionQueryProperties) GetPollingIntervalInMs() ActionQueryPollingIntervalInMs { + if o == nil || o.PollingIntervalInMs == nil { + var ret ActionQueryPollingIntervalInMs + return ret + } + return *o.PollingIntervalInMs +} + +// GetPollingIntervalInMsOk returns a tuple with the PollingIntervalInMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionQueryProperties) GetPollingIntervalInMsOk() (*ActionQueryPollingIntervalInMs, bool) { + if o == nil || o.PollingIntervalInMs == nil { + return nil, false + } + return o.PollingIntervalInMs, true +} + +// HasPollingIntervalInMs returns a boolean if a field has been set. +func (o *ActionQueryProperties) HasPollingIntervalInMs() bool { + return o != nil && o.PollingIntervalInMs != nil +} + +// SetPollingIntervalInMs gets a reference to the given ActionQueryPollingIntervalInMs and assigns it to the PollingIntervalInMs field. +func (o *ActionQueryProperties) SetPollingIntervalInMs(v ActionQueryPollingIntervalInMs) { + o.PollingIntervalInMs = &v +} + +// GetRequiresConfirmation returns the RequiresConfirmation field value if set, zero value otherwise. +func (o *ActionQueryProperties) GetRequiresConfirmation() ActionQueryRequiresConfirmation { + if o == nil || o.RequiresConfirmation == nil { + var ret ActionQueryRequiresConfirmation + return ret + } + return *o.RequiresConfirmation +} + +// GetRequiresConfirmationOk returns a tuple with the RequiresConfirmation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionQueryProperties) GetRequiresConfirmationOk() (*ActionQueryRequiresConfirmation, bool) { + if o == nil || o.RequiresConfirmation == nil { + return nil, false + } + return o.RequiresConfirmation, true +} + +// HasRequiresConfirmation returns a boolean if a field has been set. +func (o *ActionQueryProperties) HasRequiresConfirmation() bool { + return o != nil && o.RequiresConfirmation != nil +} + +// SetRequiresConfirmation gets a reference to the given ActionQueryRequiresConfirmation and assigns it to the RequiresConfirmation field. +func (o *ActionQueryProperties) SetRequiresConfirmation(v ActionQueryRequiresConfirmation) { + o.RequiresConfirmation = &v +} + +// GetShowToastOnError returns the ShowToastOnError field value if set, zero value otherwise. +func (o *ActionQueryProperties) GetShowToastOnError() ActionQueryShowToastOnError { + if o == nil || o.ShowToastOnError == nil { + var ret ActionQueryShowToastOnError + return ret + } + return *o.ShowToastOnError +} + +// GetShowToastOnErrorOk returns a tuple with the ShowToastOnError field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionQueryProperties) GetShowToastOnErrorOk() (*ActionQueryShowToastOnError, bool) { + if o == nil || o.ShowToastOnError == nil { + return nil, false + } + return o.ShowToastOnError, true +} + +// HasShowToastOnError returns a boolean if a field has been set. +func (o *ActionQueryProperties) HasShowToastOnError() bool { + return o != nil && o.ShowToastOnError != nil +} + +// SetShowToastOnError gets a reference to the given ActionQueryShowToastOnError and assigns it to the ShowToastOnError field. +func (o *ActionQueryProperties) SetShowToastOnError(v ActionQueryShowToastOnError) { + o.ShowToastOnError = &v +} + +// GetSpec returns the Spec field value. +func (o *ActionQueryProperties) GetSpec() ActionQuerySpec { + if o == nil { + var ret ActionQuerySpec + return ret + } + return o.Spec +} + +// GetSpecOk returns a tuple with the Spec field value +// and a boolean to check if the value has been set. +func (o *ActionQueryProperties) GetSpecOk() (*ActionQuerySpec, bool) { + if o == nil { + return nil, false + } + return &o.Spec, true +} + +// SetSpec sets field value. +func (o *ActionQueryProperties) SetSpec(v ActionQuerySpec) { + o.Spec = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ActionQueryProperties) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Condition != nil { + toSerialize["condition"] = o.Condition + } + if o.DebounceInMs != nil { + toSerialize["debounceInMs"] = o.DebounceInMs + } + if o.MockedOutputs != nil { + toSerialize["mockedOutputs"] = o.MockedOutputs + } + if o.OnlyTriggerManually != nil { + toSerialize["onlyTriggerManually"] = o.OnlyTriggerManually + } + if o.Outputs != nil { + toSerialize["outputs"] = o.Outputs + } + if o.PollingIntervalInMs != nil { + toSerialize["pollingIntervalInMs"] = o.PollingIntervalInMs + } + if o.RequiresConfirmation != nil { + toSerialize["requiresConfirmation"] = o.RequiresConfirmation + } + if o.ShowToastOnError != nil { + toSerialize["showToastOnError"] = o.ShowToastOnError + } + toSerialize["spec"] = o.Spec + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ActionQueryProperties) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Condition *ActionQueryCondition `json:"condition,omitempty"` + DebounceInMs *ActionQueryDebounceInMs `json:"debounceInMs,omitempty"` + MockedOutputs *ActionQueryMockedOutputs `json:"mockedOutputs,omitempty"` + OnlyTriggerManually *ActionQueryOnlyTriggerManually `json:"onlyTriggerManually,omitempty"` + Outputs *string `json:"outputs,omitempty"` + PollingIntervalInMs *ActionQueryPollingIntervalInMs `json:"pollingIntervalInMs,omitempty"` + RequiresConfirmation *ActionQueryRequiresConfirmation `json:"requiresConfirmation,omitempty"` + ShowToastOnError *ActionQueryShowToastOnError `json:"showToastOnError,omitempty"` + Spec *ActionQuerySpec `json:"spec"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Spec == nil { + return fmt.Errorf("required field spec missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"condition", "debounceInMs", "mockedOutputs", "onlyTriggerManually", "outputs", "pollingIntervalInMs", "requiresConfirmation", "showToastOnError", "spec"}) + } else { + return err + } + o.Condition = all.Condition + o.DebounceInMs = all.DebounceInMs + o.MockedOutputs = all.MockedOutputs + o.OnlyTriggerManually = all.OnlyTriggerManually + o.Outputs = all.Outputs + o.PollingIntervalInMs = all.PollingIntervalInMs + o.RequiresConfirmation = all.RequiresConfirmation + o.ShowToastOnError = all.ShowToastOnError + o.Spec = *all.Spec + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_action_query_requires_confirmation.go b/api/datadogV2/model_action_query_requires_confirmation.go new file mode 100644 index 00000000000..96e4244071e --- /dev/null +++ b/api/datadogV2/model_action_query_requires_confirmation.go @@ -0,0 +1,105 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ActionQueryRequiresConfirmation - Whether to prompt the user to confirm this query before it runs. +type ActionQueryRequiresConfirmation struct { + Bool *bool + String *string + + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} +} + +// BoolAsActionQueryRequiresConfirmation is a convenience function that returns bool wrapped in ActionQueryRequiresConfirmation. +func BoolAsActionQueryRequiresConfirmation(v *bool) ActionQueryRequiresConfirmation { + return ActionQueryRequiresConfirmation{Bool: v} +} + +// StringAsActionQueryRequiresConfirmation is a convenience function that returns string wrapped in ActionQueryRequiresConfirmation. +func StringAsActionQueryRequiresConfirmation(v *string) ActionQueryRequiresConfirmation { + return ActionQueryRequiresConfirmation{String: v} +} + +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *ActionQueryRequiresConfirmation) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Bool + err = datadog.Unmarshal(data, &obj.Bool) + if err == nil { + if obj.Bool != nil { + jsonBool, _ := datadog.Marshal(obj.Bool) + if string(jsonBool) == "{}" { // empty struct + obj.Bool = nil + } else { + match++ + } + } else { + obj.Bool = nil + } + } else { + obj.Bool = nil + } + + // try to unmarshal data into String + err = datadog.Unmarshal(data, &obj.String) + if err == nil { + if obj.String != nil { + jsonString, _ := datadog.Marshal(obj.String) + if string(jsonString) == "{}" { // empty struct + obj.String = nil + } else { + match++ + } + } else { + obj.String = nil + } + } else { + obj.String = nil + } + + if match != 1 { // more than 1 match + // reset to nil + obj.Bool = nil + obj.String = nil + return datadog.Unmarshal(data, &obj.UnparsedObject) + } + return nil // exactly one match +} + +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj ActionQueryRequiresConfirmation) MarshalJSON() ([]byte, error) { + if obj.Bool != nil { + return datadog.Marshal(&obj.Bool) + } + + if obj.String != nil { + return datadog.Marshal(&obj.String) + } + + if obj.UnparsedObject != nil { + return datadog.Marshal(obj.UnparsedObject) + } + return nil, nil // no data in oneOf schemas +} + +// GetActualInstance returns the actual instance. +func (obj *ActionQueryRequiresConfirmation) GetActualInstance() interface{} { + if obj.Bool != nil { + return obj.Bool + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} diff --git a/api/datadogV2/model_action_query_show_toast_on_error.go b/api/datadogV2/model_action_query_show_toast_on_error.go new file mode 100644 index 00000000000..ba964935cf8 --- /dev/null +++ b/api/datadogV2/model_action_query_show_toast_on_error.go @@ -0,0 +1,105 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ActionQueryShowToastOnError - Whether to display a toast to the user when the query returns an error. +type ActionQueryShowToastOnError struct { + Bool *bool + String *string + + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} +} + +// BoolAsActionQueryShowToastOnError is a convenience function that returns bool wrapped in ActionQueryShowToastOnError. +func BoolAsActionQueryShowToastOnError(v *bool) ActionQueryShowToastOnError { + return ActionQueryShowToastOnError{Bool: v} +} + +// StringAsActionQueryShowToastOnError is a convenience function that returns string wrapped in ActionQueryShowToastOnError. +func StringAsActionQueryShowToastOnError(v *string) ActionQueryShowToastOnError { + return ActionQueryShowToastOnError{String: v} +} + +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *ActionQueryShowToastOnError) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Bool + err = datadog.Unmarshal(data, &obj.Bool) + if err == nil { + if obj.Bool != nil { + jsonBool, _ := datadog.Marshal(obj.Bool) + if string(jsonBool) == "{}" { // empty struct + obj.Bool = nil + } else { + match++ + } + } else { + obj.Bool = nil + } + } else { + obj.Bool = nil + } + + // try to unmarshal data into String + err = datadog.Unmarshal(data, &obj.String) + if err == nil { + if obj.String != nil { + jsonString, _ := datadog.Marshal(obj.String) + if string(jsonString) == "{}" { // empty struct + obj.String = nil + } else { + match++ + } + } else { + obj.String = nil + } + } else { + obj.String = nil + } + + if match != 1 { // more than 1 match + // reset to nil + obj.Bool = nil + obj.String = nil + return datadog.Unmarshal(data, &obj.UnparsedObject) + } + return nil // exactly one match +} + +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj ActionQueryShowToastOnError) MarshalJSON() ([]byte, error) { + if obj.Bool != nil { + return datadog.Marshal(&obj.Bool) + } + + if obj.String != nil { + return datadog.Marshal(&obj.String) + } + + if obj.UnparsedObject != nil { + return datadog.Marshal(obj.UnparsedObject) + } + return nil, nil // no data in oneOf schemas +} + +// GetActualInstance returns the actual instance. +func (obj *ActionQueryShowToastOnError) GetActualInstance() interface{} { + if obj.Bool != nil { + return obj.Bool + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} diff --git a/api/datadogV2/model_action_query_spec.go b/api/datadogV2/model_action_query_spec.go new file mode 100644 index 00000000000..c3c174d78e1 --- /dev/null +++ b/api/datadogV2/model_action_query_spec.go @@ -0,0 +1,105 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ActionQuerySpec - The definition of the action query. +type ActionQuerySpec struct { + String *string + ActionQuerySpecObject *ActionQuerySpecObject + + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} +} + +// StringAsActionQuerySpec is a convenience function that returns string wrapped in ActionQuerySpec. +func StringAsActionQuerySpec(v *string) ActionQuerySpec { + return ActionQuerySpec{String: v} +} + +// ActionQuerySpecObjectAsActionQuerySpec is a convenience function that returns ActionQuerySpecObject wrapped in ActionQuerySpec. +func ActionQuerySpecObjectAsActionQuerySpec(v *ActionQuerySpecObject) ActionQuerySpec { + return ActionQuerySpec{ActionQuerySpecObject: v} +} + +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *ActionQuerySpec) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into String + err = datadog.Unmarshal(data, &obj.String) + if err == nil { + if obj.String != nil { + jsonString, _ := datadog.Marshal(obj.String) + if string(jsonString) == "{}" { // empty struct + obj.String = nil + } else { + match++ + } + } else { + obj.String = nil + } + } else { + obj.String = nil + } + + // try to unmarshal data into ActionQuerySpecObject + err = datadog.Unmarshal(data, &obj.ActionQuerySpecObject) + if err == nil { + if obj.ActionQuerySpecObject != nil && obj.ActionQuerySpecObject.UnparsedObject == nil { + jsonActionQuerySpecObject, _ := datadog.Marshal(obj.ActionQuerySpecObject) + if string(jsonActionQuerySpecObject) == "{}" { // empty struct + obj.ActionQuerySpecObject = nil + } else { + match++ + } + } else { + obj.ActionQuerySpecObject = nil + } + } else { + obj.ActionQuerySpecObject = nil + } + + if match != 1 { // more than 1 match + // reset to nil + obj.String = nil + obj.ActionQuerySpecObject = nil + return datadog.Unmarshal(data, &obj.UnparsedObject) + } + return nil // exactly one match +} + +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj ActionQuerySpec) MarshalJSON() ([]byte, error) { + if obj.String != nil { + return datadog.Marshal(&obj.String) + } + + if obj.ActionQuerySpecObject != nil { + return datadog.Marshal(&obj.ActionQuerySpecObject) + } + + if obj.UnparsedObject != nil { + return datadog.Marshal(obj.UnparsedObject) + } + return nil, nil // no data in oneOf schemas +} + +// GetActualInstance returns the actual instance. +func (obj *ActionQuerySpec) GetActualInstance() interface{} { + if obj.String != nil { + return obj.String + } + + if obj.ActionQuerySpecObject != nil { + return obj.ActionQuerySpecObject + } + + // all schemas are nil + return nil +} diff --git a/api/datadogV2/model_action_query_spec_connection_group.go b/api/datadogV2/model_action_query_spec_connection_group.go new file mode 100644 index 00000000000..91385a4afb8 --- /dev/null +++ b/api/datadogV2/model_action_query_spec_connection_group.go @@ -0,0 +1,139 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/google/uuid" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ActionQuerySpecConnectionGroup The connection group to use for an action query. +type ActionQuerySpecConnectionGroup struct { + // The ID of the connection group. + Id *uuid.UUID `json:"id,omitempty"` + // The tags of the connection group. + Tags []string `json:"tags,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewActionQuerySpecConnectionGroup instantiates a new ActionQuerySpecConnectionGroup object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewActionQuerySpecConnectionGroup() *ActionQuerySpecConnectionGroup { + this := ActionQuerySpecConnectionGroup{} + return &this +} + +// NewActionQuerySpecConnectionGroupWithDefaults instantiates a new ActionQuerySpecConnectionGroup object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewActionQuerySpecConnectionGroupWithDefaults() *ActionQuerySpecConnectionGroup { + this := ActionQuerySpecConnectionGroup{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *ActionQuerySpecConnectionGroup) GetId() uuid.UUID { + if o == nil || o.Id == nil { + var ret uuid.UUID + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionQuerySpecConnectionGroup) GetIdOk() (*uuid.UUID, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *ActionQuerySpecConnectionGroup) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given uuid.UUID and assigns it to the Id field. +func (o *ActionQuerySpecConnectionGroup) SetId(v uuid.UUID) { + o.Id = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ActionQuerySpecConnectionGroup) GetTags() []string { + if o == nil || o.Tags == nil { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionQuerySpecConnectionGroup) GetTagsOk() (*[]string, bool) { + if o == nil || o.Tags == nil { + return nil, false + } + return &o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ActionQuerySpecConnectionGroup) HasTags() bool { + return o != nil && o.Tags != nil +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *ActionQuerySpecConnectionGroup) SetTags(v []string) { + o.Tags = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ActionQuerySpecConnectionGroup) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ActionQuerySpecConnectionGroup) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Id *uuid.UUID `json:"id,omitempty"` + Tags []string `json:"tags,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"id", "tags"}) + } else { + return err + } + o.Id = all.Id + o.Tags = all.Tags + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_action_query_spec_inputs.go b/api/datadogV2/model_action_query_spec_inputs.go new file mode 100644 index 00000000000..e13da848f94 --- /dev/null +++ b/api/datadogV2/model_action_query_spec_inputs.go @@ -0,0 +1,105 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ActionQuerySpecInputs - The inputs to the action query. These are the values that are passed to the action when it is triggered. +type ActionQuerySpecInputs struct { + String *string + ActionQuerySpecInput *map[string]interface{} + + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} +} + +// StringAsActionQuerySpecInputs is a convenience function that returns string wrapped in ActionQuerySpecInputs. +func StringAsActionQuerySpecInputs(v *string) ActionQuerySpecInputs { + return ActionQuerySpecInputs{String: v} +} + +// ActionQuerySpecInputAsActionQuerySpecInputs is a convenience function that returns map[string]interface{} wrapped in ActionQuerySpecInputs. +func ActionQuerySpecInputAsActionQuerySpecInputs(v *map[string]interface{}) ActionQuerySpecInputs { + return ActionQuerySpecInputs{ActionQuerySpecInput: v} +} + +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *ActionQuerySpecInputs) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into String + err = datadog.Unmarshal(data, &obj.String) + if err == nil { + if obj.String != nil { + jsonString, _ := datadog.Marshal(obj.String) + if string(jsonString) == "{}" { // empty struct + obj.String = nil + } else { + match++ + } + } else { + obj.String = nil + } + } else { + obj.String = nil + } + + // try to unmarshal data into ActionQuerySpecInput + err = datadog.Unmarshal(data, &obj.ActionQuerySpecInput) + if err == nil { + if obj.ActionQuerySpecInput != nil { + jsonActionQuerySpecInput, _ := datadog.Marshal(obj.ActionQuerySpecInput) + if string(jsonActionQuerySpecInput) == "{}" && string(data) != "{}" { // empty struct + obj.ActionQuerySpecInput = nil + } else { + match++ + } + } else { + obj.ActionQuerySpecInput = nil + } + } else { + obj.ActionQuerySpecInput = nil + } + + if match != 1 { // more than 1 match + // reset to nil + obj.String = nil + obj.ActionQuerySpecInput = nil + return datadog.Unmarshal(data, &obj.UnparsedObject) + } + return nil // exactly one match +} + +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj ActionQuerySpecInputs) MarshalJSON() ([]byte, error) { + if obj.String != nil { + return datadog.Marshal(&obj.String) + } + + if obj.ActionQuerySpecInput != nil { + return datadog.Marshal(&obj.ActionQuerySpecInput) + } + + if obj.UnparsedObject != nil { + return datadog.Marshal(obj.UnparsedObject) + } + return nil, nil // no data in oneOf schemas +} + +// GetActualInstance returns the actual instance. +func (obj *ActionQuerySpecInputs) GetActualInstance() interface{} { + if obj.String != nil { + return obj.String + } + + if obj.ActionQuerySpecInput != nil { + return obj.ActionQuerySpecInput + } + + // all schemas are nil + return nil +} diff --git a/api/datadogV2/model_action_query_spec_object.go b/api/datadogV2/model_action_query_spec_object.go new file mode 100644 index 00000000000..e806d0b2634 --- /dev/null +++ b/api/datadogV2/model_action_query_spec_object.go @@ -0,0 +1,217 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/google/uuid" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ActionQuerySpecObject The action query spec object. +type ActionQuerySpecObject struct { + // The connection group to use for an action query. + ConnectionGroup *ActionQuerySpecConnectionGroup `json:"connectionGroup,omitempty"` + // The ID of the custom connection to use for this action query. + ConnectionId *uuid.UUID `json:"connectionId,omitempty"` + // The fully qualified name of the action type. + Fqn string `json:"fqn"` + // The inputs to the action query. These are the values that are passed to the action when it is triggered. + Inputs *ActionQuerySpecInputs `json:"inputs,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewActionQuerySpecObject instantiates a new ActionQuerySpecObject object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewActionQuerySpecObject(fqn string) *ActionQuerySpecObject { + this := ActionQuerySpecObject{} + this.Fqn = fqn + return &this +} + +// NewActionQuerySpecObjectWithDefaults instantiates a new ActionQuerySpecObject object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewActionQuerySpecObjectWithDefaults() *ActionQuerySpecObject { + this := ActionQuerySpecObject{} + return &this +} + +// GetConnectionGroup returns the ConnectionGroup field value if set, zero value otherwise. +func (o *ActionQuerySpecObject) GetConnectionGroup() ActionQuerySpecConnectionGroup { + if o == nil || o.ConnectionGroup == nil { + var ret ActionQuerySpecConnectionGroup + return ret + } + return *o.ConnectionGroup +} + +// GetConnectionGroupOk returns a tuple with the ConnectionGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionQuerySpecObject) GetConnectionGroupOk() (*ActionQuerySpecConnectionGroup, bool) { + if o == nil || o.ConnectionGroup == nil { + return nil, false + } + return o.ConnectionGroup, true +} + +// HasConnectionGroup returns a boolean if a field has been set. +func (o *ActionQuerySpecObject) HasConnectionGroup() bool { + return o != nil && o.ConnectionGroup != nil +} + +// SetConnectionGroup gets a reference to the given ActionQuerySpecConnectionGroup and assigns it to the ConnectionGroup field. +func (o *ActionQuerySpecObject) SetConnectionGroup(v ActionQuerySpecConnectionGroup) { + o.ConnectionGroup = &v +} + +// GetConnectionId returns the ConnectionId field value if set, zero value otherwise. +func (o *ActionQuerySpecObject) GetConnectionId() uuid.UUID { + if o == nil || o.ConnectionId == nil { + var ret uuid.UUID + return ret + } + return *o.ConnectionId +} + +// GetConnectionIdOk returns a tuple with the ConnectionId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionQuerySpecObject) GetConnectionIdOk() (*uuid.UUID, bool) { + if o == nil || o.ConnectionId == nil { + return nil, false + } + return o.ConnectionId, true +} + +// HasConnectionId returns a boolean if a field has been set. +func (o *ActionQuerySpecObject) HasConnectionId() bool { + return o != nil && o.ConnectionId != nil +} + +// SetConnectionId gets a reference to the given uuid.UUID and assigns it to the ConnectionId field. +func (o *ActionQuerySpecObject) SetConnectionId(v uuid.UUID) { + o.ConnectionId = &v +} + +// GetFqn returns the Fqn field value. +func (o *ActionQuerySpecObject) GetFqn() string { + if o == nil { + var ret string + return ret + } + return o.Fqn +} + +// GetFqnOk returns a tuple with the Fqn field value +// and a boolean to check if the value has been set. +func (o *ActionQuerySpecObject) GetFqnOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Fqn, true +} + +// SetFqn sets field value. +func (o *ActionQuerySpecObject) SetFqn(v string) { + o.Fqn = v +} + +// GetInputs returns the Inputs field value if set, zero value otherwise. +func (o *ActionQuerySpecObject) GetInputs() ActionQuerySpecInputs { + if o == nil || o.Inputs == nil { + var ret ActionQuerySpecInputs + return ret + } + return *o.Inputs +} + +// GetInputsOk returns a tuple with the Inputs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionQuerySpecObject) GetInputsOk() (*ActionQuerySpecInputs, bool) { + if o == nil || o.Inputs == nil { + return nil, false + } + return o.Inputs, true +} + +// HasInputs returns a boolean if a field has been set. +func (o *ActionQuerySpecObject) HasInputs() bool { + return o != nil && o.Inputs != nil +} + +// SetInputs gets a reference to the given ActionQuerySpecInputs and assigns it to the Inputs field. +func (o *ActionQuerySpecObject) SetInputs(v ActionQuerySpecInputs) { + o.Inputs = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ActionQuerySpecObject) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.ConnectionGroup != nil { + toSerialize["connectionGroup"] = o.ConnectionGroup + } + if o.ConnectionId != nil { + toSerialize["connectionId"] = o.ConnectionId + } + toSerialize["fqn"] = o.Fqn + if o.Inputs != nil { + toSerialize["inputs"] = o.Inputs + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ActionQuerySpecObject) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + ConnectionGroup *ActionQuerySpecConnectionGroup `json:"connectionGroup,omitempty"` + ConnectionId *uuid.UUID `json:"connectionId,omitempty"` + Fqn *string `json:"fqn"` + Inputs *ActionQuerySpecInputs `json:"inputs,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Fqn == nil { + return fmt.Errorf("required field fqn missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"connectionGroup", "connectionId", "fqn", "inputs"}) + } else { + return err + } + + hasInvalidField := false + if all.ConnectionGroup != nil && all.ConnectionGroup.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.ConnectionGroup = all.ConnectionGroup + o.ConnectionId = all.ConnectionId + o.Fqn = *all.Fqn + o.Inputs = all.Inputs + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_action_query_type.go b/api/datadogV2/model_action_query_type.go new file mode 100644 index 00000000000..82d6688688f --- /dev/null +++ b/api/datadogV2/model_action_query_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ActionQueryType The action query type. +type ActionQueryType string + +// List of ActionQueryType. +const ( + ACTIONQUERYTYPE_ACTION ActionQueryType = "action" +) + +var allowedActionQueryTypeEnumValues = []ActionQueryType{ + ACTIONQUERYTYPE_ACTION, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ActionQueryType) GetAllowedValues() []ActionQueryType { + return allowedActionQueryTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ActionQueryType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ActionQueryType(value) + return nil +} + +// NewActionQueryTypeFromValue returns a pointer to a valid ActionQueryType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewActionQueryTypeFromValue(v string) (*ActionQueryType, error) { + ev := ActionQueryType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ActionQueryType: valid values are %v", v, allowedActionQueryTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ActionQueryType) IsValid() bool { + for _, existing := range allowedActionQueryTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ActionQueryType value. +func (v ActionQueryType) Ptr() *ActionQueryType { + return &v +} diff --git a/api/datadogV2/model_data_transform.go b/api/datadogV2/model_data_transform.go new file mode 100644 index 00000000000..49a78cb5a31 --- /dev/null +++ b/api/datadogV2/model_data_transform.go @@ -0,0 +1,214 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/google/uuid" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DataTransform A data transformer, which is custom JavaScript code that executes and transforms data when its inputs change. +type DataTransform struct { + // The ID of the data transformer. + Id uuid.UUID `json:"id"` + // A unique identifier for this data transformer. This name is also used to access the transformer's result throughout the app. + Name string `json:"name"` + // The properties of the data transformer. + Properties DataTransformProperties `json:"properties"` + // The data transform type. + Type DataTransformType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDataTransform instantiates a new DataTransform object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDataTransform(id uuid.UUID, name string, properties DataTransformProperties, typeVar DataTransformType) *DataTransform { + this := DataTransform{} + this.Id = id + this.Name = name + this.Properties = properties + this.Type = typeVar + return &this +} + +// NewDataTransformWithDefaults instantiates a new DataTransform object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDataTransformWithDefaults() *DataTransform { + this := DataTransform{} + var typeVar DataTransformType = DATATRANSFORMTYPE_DATATRANSFORM + this.Type = typeVar + return &this +} + +// GetId returns the Id field value. +func (o *DataTransform) GetId() uuid.UUID { + if o == nil { + var ret uuid.UUID + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *DataTransform) GetIdOk() (*uuid.UUID, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *DataTransform) SetId(v uuid.UUID) { + o.Id = v +} + +// GetName returns the Name field value. +func (o *DataTransform) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DataTransform) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *DataTransform) SetName(v string) { + o.Name = v +} + +// GetProperties returns the Properties field value. +func (o *DataTransform) GetProperties() DataTransformProperties { + if o == nil { + var ret DataTransformProperties + return ret + } + return o.Properties +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +func (o *DataTransform) GetPropertiesOk() (*DataTransformProperties, bool) { + if o == nil { + return nil, false + } + return &o.Properties, true +} + +// SetProperties sets field value. +func (o *DataTransform) SetProperties(v DataTransformProperties) { + o.Properties = v +} + +// GetType returns the Type field value. +func (o *DataTransform) GetType() DataTransformType { + if o == nil { + var ret DataTransformType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *DataTransform) GetTypeOk() (*DataTransformType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *DataTransform) SetType(v DataTransformType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DataTransform) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["properties"] = o.Properties + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DataTransform) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Id *uuid.UUID `json:"id"` + Name *string `json:"name"` + Properties *DataTransformProperties `json:"properties"` + Type *DataTransformType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.Properties == nil { + return fmt.Errorf("required field properties missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"id", "name", "properties", "type"}) + } else { + return err + } + + hasInvalidField := false + o.Id = *all.Id + o.Name = *all.Name + if all.Properties.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Properties = *all.Properties + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_data_transform_properties.go b/api/datadogV2/model_data_transform_properties.go new file mode 100644 index 00000000000..5ac0ef76d97 --- /dev/null +++ b/api/datadogV2/model_data_transform_properties.go @@ -0,0 +1,102 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DataTransformProperties The properties of the data transformer. +type DataTransformProperties struct { + // A JavaScript function that returns the transformed data. + Outputs *string `json:"outputs,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDataTransformProperties instantiates a new DataTransformProperties object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDataTransformProperties() *DataTransformProperties { + this := DataTransformProperties{} + return &this +} + +// NewDataTransformPropertiesWithDefaults instantiates a new DataTransformProperties object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDataTransformPropertiesWithDefaults() *DataTransformProperties { + this := DataTransformProperties{} + return &this +} + +// GetOutputs returns the Outputs field value if set, zero value otherwise. +func (o *DataTransformProperties) GetOutputs() string { + if o == nil || o.Outputs == nil { + var ret string + return ret + } + return *o.Outputs +} + +// GetOutputsOk returns a tuple with the Outputs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DataTransformProperties) GetOutputsOk() (*string, bool) { + if o == nil || o.Outputs == nil { + return nil, false + } + return o.Outputs, true +} + +// HasOutputs returns a boolean if a field has been set. +func (o *DataTransformProperties) HasOutputs() bool { + return o != nil && o.Outputs != nil +} + +// SetOutputs gets a reference to the given string and assigns it to the Outputs field. +func (o *DataTransformProperties) SetOutputs(v string) { + o.Outputs = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DataTransformProperties) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Outputs != nil { + toSerialize["outputs"] = o.Outputs + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DataTransformProperties) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Outputs *string `json:"outputs,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"outputs"}) + } else { + return err + } + o.Outputs = all.Outputs + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_data_transform_type.go b/api/datadogV2/model_data_transform_type.go new file mode 100644 index 00000000000..135e7f2bf96 --- /dev/null +++ b/api/datadogV2/model_data_transform_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DataTransformType The data transform type. +type DataTransformType string + +// List of DataTransformType. +const ( + DATATRANSFORMTYPE_DATATRANSFORM DataTransformType = "dataTransform" +) + +var allowedDataTransformTypeEnumValues = []DataTransformType{ + DATATRANSFORMTYPE_DATATRANSFORM, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *DataTransformType) GetAllowedValues() []DataTransformType { + return allowedDataTransformTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *DataTransformType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = DataTransformType(value) + return nil +} + +// NewDataTransformTypeFromValue returns a pointer to a valid DataTransformType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewDataTransformTypeFromValue(v string) (*DataTransformType, error) { + ev := DataTransformType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for DataTransformType: valid values are %v", v, allowedDataTransformTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v DataTransformType) IsValid() bool { + for _, existing := range allowedDataTransformTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DataTransformType value. +func (v DataTransformType) Ptr() *DataTransformType { + return &v +} diff --git a/api/datadogV2/model_query.go b/api/datadogV2/model_query.go index 4ffb63810a6..7c843ec549f 100644 --- a/api/datadogV2/model_query.go +++ b/api/datadogV2/model_query.go @@ -5,243 +5,133 @@ package datadogV2 import ( - "fmt" - - "github.com/google/uuid" - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// Query A query used by an app. This can take the form of an external action, a data transformation, or a state variable change. +// Query - A data query used by an app. This can take the form of an external action, a data transformation, or a state variable. type Query struct { - // Events to listen for downstream of the query. - Events []AppBuilderEvent `json:"events,omitempty"` - // The ID of the query. - Id uuid.UUID `json:"id"` - // The name of the query. The name must be unique within the app and is visible in the app editor. - Name string `json:"name"` - // The properties of the query. The properties vary depending on the query type. - Properties interface{} `json:"properties,omitempty"` - // The query type. - Type QueryType `json:"type"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} + ActionQuery *ActionQuery + DataTransform *DataTransform + StateVariable *StateVariable -// NewQuery instantiates a new Query object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewQuery(id uuid.UUID, name string, typeVar QueryType) *Query { - this := Query{} - this.Id = id - this.Name = name - this.Type = typeVar - return &this -} - -// NewQueryWithDefaults instantiates a new Query object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewQueryWithDefaults() *Query { - this := Query{} - return &this -} - -// GetEvents returns the Events field value if set, zero value otherwise. -func (o *Query) GetEvents() []AppBuilderEvent { - if o == nil || o.Events == nil { - var ret []AppBuilderEvent - return ret - } - return o.Events -} - -// GetEventsOk returns a tuple with the Events field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Query) GetEventsOk() (*[]AppBuilderEvent, bool) { - if o == nil || o.Events == nil { - return nil, false - } - return &o.Events, true -} - -// HasEvents returns a boolean if a field has been set. -func (o *Query) HasEvents() bool { - return o != nil && o.Events != nil -} - -// SetEvents gets a reference to the given []AppBuilderEvent and assigns it to the Events field. -func (o *Query) SetEvents(v []AppBuilderEvent) { - o.Events = v -} - -// GetId returns the Id field value. -func (o *Query) GetId() uuid.UUID { - if o == nil { - var ret uuid.UUID - return ret - } - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *Query) GetIdOk() (*uuid.UUID, bool) { - if o == nil { - return nil, false - } - return &o.Id, true + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} } -// SetId sets field value. -func (o *Query) SetId(v uuid.UUID) { - o.Id = v +// ActionQueryAsQuery is a convenience function that returns ActionQuery wrapped in Query. +func ActionQueryAsQuery(v *ActionQuery) Query { + return Query{ActionQuery: v} } -// GetName returns the Name field value. -func (o *Query) GetName() string { - if o == nil { - var ret string - return ret - } - return o.Name +// DataTransformAsQuery is a convenience function that returns DataTransform wrapped in Query. +func DataTransformAsQuery(v *DataTransform) Query { + return Query{DataTransform: v} } -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *Query) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true +// StateVariableAsQuery is a convenience function that returns StateVariable wrapped in Query. +func StateVariableAsQuery(v *StateVariable) Query { + return Query{StateVariable: v} } -// SetName sets field value. -func (o *Query) SetName(v string) { - o.Name = v -} - -// GetProperties returns the Properties field value if set, zero value otherwise. -func (o *Query) GetProperties() interface{} { - if o == nil || o.Properties == nil { - var ret interface{} - return ret +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *Query) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into ActionQuery + err = datadog.Unmarshal(data, &obj.ActionQuery) + if err == nil { + if obj.ActionQuery != nil && obj.ActionQuery.UnparsedObject == nil { + jsonActionQuery, _ := datadog.Marshal(obj.ActionQuery) + if string(jsonActionQuery) == "{}" { // empty struct + obj.ActionQuery = nil + } else { + match++ + } + } else { + obj.ActionQuery = nil + } + } else { + obj.ActionQuery = nil + } + + // try to unmarshal data into DataTransform + err = datadog.Unmarshal(data, &obj.DataTransform) + if err == nil { + if obj.DataTransform != nil && obj.DataTransform.UnparsedObject == nil { + jsonDataTransform, _ := datadog.Marshal(obj.DataTransform) + if string(jsonDataTransform) == "{}" { // empty struct + obj.DataTransform = nil + } else { + match++ + } + } else { + obj.DataTransform = nil + } + } else { + obj.DataTransform = nil + } + + // try to unmarshal data into StateVariable + err = datadog.Unmarshal(data, &obj.StateVariable) + if err == nil { + if obj.StateVariable != nil && obj.StateVariable.UnparsedObject == nil { + jsonStateVariable, _ := datadog.Marshal(obj.StateVariable) + if string(jsonStateVariable) == "{}" { // empty struct + obj.StateVariable = nil + } else { + match++ + } + } else { + obj.StateVariable = nil + } + } else { + obj.StateVariable = nil } - return o.Properties -} -// GetPropertiesOk returns a tuple with the Properties field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Query) GetPropertiesOk() (*interface{}, bool) { - if o == nil || o.Properties == nil { - return nil, false + if match != 1 { // more than 1 match + // reset to nil + obj.ActionQuery = nil + obj.DataTransform = nil + obj.StateVariable = nil + return datadog.Unmarshal(data, &obj.UnparsedObject) } - return &o.Properties, true + return nil // exactly one match } -// HasProperties returns a boolean if a field has been set. -func (o *Query) HasProperties() bool { - return o != nil && o.Properties != nil -} - -// SetProperties gets a reference to the given interface{} and assigns it to the Properties field. -func (o *Query) SetProperties(v interface{}) { - o.Properties = v -} - -// GetType returns the Type field value. -func (o *Query) GetType() QueryType { - if o == nil { - var ret QueryType - return ret +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj Query) MarshalJSON() ([]byte, error) { + if obj.ActionQuery != nil { + return datadog.Marshal(&obj.ActionQuery) } - return o.Type -} -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *Query) GetTypeOk() (*QueryType, bool) { - if o == nil { - return nil, false + if obj.DataTransform != nil { + return datadog.Marshal(&obj.DataTransform) } - return &o.Type, true -} -// SetType sets field value. -func (o *Query) SetType(v QueryType) { - o.Type = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o Query) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Events != nil { - toSerialize["events"] = o.Events + if obj.StateVariable != nil { + return datadog.Marshal(&obj.StateVariable) } - toSerialize["id"] = o.Id - toSerialize["name"] = o.Name - if o.Properties != nil { - toSerialize["properties"] = o.Properties - } - toSerialize["type"] = o.Type - for key, value := range o.AdditionalProperties { - toSerialize[key] = value + if obj.UnparsedObject != nil { + return datadog.Marshal(obj.UnparsedObject) } - return datadog.Marshal(toSerialize) + return nil, nil // no data in oneOf schemas } -// UnmarshalJSON deserializes the given payload. -func (o *Query) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Events []AppBuilderEvent `json:"events,omitempty"` - Id *uuid.UUID `json:"id"` - Name *string `json:"name"` - Properties interface{} `json:"properties,omitempty"` - Type *QueryType `json:"type"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - if all.Id == nil { - return fmt.Errorf("required field id missing") - } - if all.Name == nil { - return fmt.Errorf("required field name missing") - } - if all.Type == nil { - return fmt.Errorf("required field type missing") - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"events", "id", "name", "properties", "type"}) - } else { - return err - } - - hasInvalidField := false - o.Events = all.Events - o.Id = *all.Id - o.Name = *all.Name - o.Properties = all.Properties - if !all.Type.IsValid() { - hasInvalidField = true - } else { - o.Type = *all.Type +// GetActualInstance returns the actual instance. +func (obj *Query) GetActualInstance() interface{} { + if obj.ActionQuery != nil { + return obj.ActionQuery } - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties + if obj.DataTransform != nil { + return obj.DataTransform } - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) + if obj.StateVariable != nil { + return obj.StateVariable } + // all schemas are nil return nil } diff --git a/api/datadogV2/model_query_type.go b/api/datadogV2/model_query_type.go deleted file mode 100644 index d6bf702a9eb..00000000000 --- a/api/datadogV2/model_query_type.go +++ /dev/null @@ -1,68 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// QueryType The query type. -type QueryType string - -// List of QueryType. -const ( - QUERYTYPE_ACTION QueryType = "action" - QUERYTYPE_STATEVARIABLE QueryType = "stateVariable" - QUERYTYPE_DATATRANSFORM QueryType = "dataTransform" -) - -var allowedQueryTypeEnumValues = []QueryType{ - QUERYTYPE_ACTION, - QUERYTYPE_STATEVARIABLE, - QUERYTYPE_DATATRANSFORM, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *QueryType) GetAllowedValues() []QueryType { - return allowedQueryTypeEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *QueryType) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = QueryType(value) - return nil -} - -// NewQueryTypeFromValue returns a pointer to a valid QueryType -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewQueryTypeFromValue(v string) (*QueryType, error) { - ev := QueryType(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for QueryType: valid values are %v", v, allowedQueryTypeEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v QueryType) IsValid() bool { - for _, existing := range allowedQueryTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to QueryType value. -func (v QueryType) Ptr() *QueryType { - return &v -} diff --git a/api/datadogV2/model_state_variable.go b/api/datadogV2/model_state_variable.go new file mode 100644 index 00000000000..3e91c4f8f6e --- /dev/null +++ b/api/datadogV2/model_state_variable.go @@ -0,0 +1,214 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/google/uuid" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// StateVariable A variable, which can be set and read by other components in the app. +type StateVariable struct { + // The ID of the state variable. + Id uuid.UUID `json:"id"` + // A unique identifier for this state variable. This name is also used to access the variable's value throughout the app. + Name string `json:"name"` + // The properties of the state variable. + Properties StateVariableProperties `json:"properties"` + // The state variable type. + Type StateVariableType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewStateVariable instantiates a new StateVariable object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewStateVariable(id uuid.UUID, name string, properties StateVariableProperties, typeVar StateVariableType) *StateVariable { + this := StateVariable{} + this.Id = id + this.Name = name + this.Properties = properties + this.Type = typeVar + return &this +} + +// NewStateVariableWithDefaults instantiates a new StateVariable object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewStateVariableWithDefaults() *StateVariable { + this := StateVariable{} + var typeVar StateVariableType = STATEVARIABLETYPE_STATEVARIABLE + this.Type = typeVar + return &this +} + +// GetId returns the Id field value. +func (o *StateVariable) GetId() uuid.UUID { + if o == nil { + var ret uuid.UUID + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *StateVariable) GetIdOk() (*uuid.UUID, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *StateVariable) SetId(v uuid.UUID) { + o.Id = v +} + +// GetName returns the Name field value. +func (o *StateVariable) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *StateVariable) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *StateVariable) SetName(v string) { + o.Name = v +} + +// GetProperties returns the Properties field value. +func (o *StateVariable) GetProperties() StateVariableProperties { + if o == nil { + var ret StateVariableProperties + return ret + } + return o.Properties +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +func (o *StateVariable) GetPropertiesOk() (*StateVariableProperties, bool) { + if o == nil { + return nil, false + } + return &o.Properties, true +} + +// SetProperties sets field value. +func (o *StateVariable) SetProperties(v StateVariableProperties) { + o.Properties = v +} + +// GetType returns the Type field value. +func (o *StateVariable) GetType() StateVariableType { + if o == nil { + var ret StateVariableType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *StateVariable) GetTypeOk() (*StateVariableType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *StateVariable) SetType(v StateVariableType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o StateVariable) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["properties"] = o.Properties + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *StateVariable) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Id *uuid.UUID `json:"id"` + Name *string `json:"name"` + Properties *StateVariableProperties `json:"properties"` + Type *StateVariableType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.Properties == nil { + return fmt.Errorf("required field properties missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"id", "name", "properties", "type"}) + } else { + return err + } + + hasInvalidField := false + o.Id = *all.Id + o.Name = *all.Name + if all.Properties.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Properties = *all.Properties + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_state_variable_properties.go b/api/datadogV2/model_state_variable_properties.go new file mode 100644 index 00000000000..eee02427927 --- /dev/null +++ b/api/datadogV2/model_state_variable_properties.go @@ -0,0 +1,102 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// StateVariableProperties The properties of the state variable. +type StateVariableProperties struct { + // The default value of the state variable. + DefaultValue interface{} `json:"defaultValue,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewStateVariableProperties instantiates a new StateVariableProperties object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewStateVariableProperties() *StateVariableProperties { + this := StateVariableProperties{} + return &this +} + +// NewStateVariablePropertiesWithDefaults instantiates a new StateVariableProperties object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewStateVariablePropertiesWithDefaults() *StateVariableProperties { + this := StateVariableProperties{} + return &this +} + +// GetDefaultValue returns the DefaultValue field value if set, zero value otherwise. +func (o *StateVariableProperties) GetDefaultValue() interface{} { + if o == nil || o.DefaultValue == nil { + var ret interface{} + return ret + } + return o.DefaultValue +} + +// GetDefaultValueOk returns a tuple with the DefaultValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StateVariableProperties) GetDefaultValueOk() (*interface{}, bool) { + if o == nil || o.DefaultValue == nil { + return nil, false + } + return &o.DefaultValue, true +} + +// HasDefaultValue returns a boolean if a field has been set. +func (o *StateVariableProperties) HasDefaultValue() bool { + return o != nil && o.DefaultValue != nil +} + +// SetDefaultValue gets a reference to the given interface{} and assigns it to the DefaultValue field. +func (o *StateVariableProperties) SetDefaultValue(v interface{}) { + o.DefaultValue = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o StateVariableProperties) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.DefaultValue != nil { + toSerialize["defaultValue"] = o.DefaultValue + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *StateVariableProperties) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + DefaultValue interface{} `json:"defaultValue,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"defaultValue"}) + } else { + return err + } + o.DefaultValue = all.DefaultValue + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_state_variable_type.go b/api/datadogV2/model_state_variable_type.go new file mode 100644 index 00000000000..f71881e429a --- /dev/null +++ b/api/datadogV2/model_state_variable_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// StateVariableType The state variable type. +type StateVariableType string + +// List of StateVariableType. +const ( + STATEVARIABLETYPE_STATEVARIABLE StateVariableType = "stateVariable" +) + +var allowedStateVariableTypeEnumValues = []StateVariableType{ + STATEVARIABLETYPE_STATEVARIABLE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *StateVariableType) GetAllowedValues() []StateVariableType { + return allowedStateVariableTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *StateVariableType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = StateVariableType(value) + return nil +} + +// NewStateVariableTypeFromValue returns a pointer to a valid StateVariableType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewStateVariableTypeFromValue(v string) (*StateVariableType, error) { + ev := StateVariableType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for StateVariableType: valid values are %v", v, allowedStateVariableTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v StateVariableType) IsValid() bool { + for _, existing := range allowedStateVariableTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to StateVariableType value. +func (v StateVariableType) Ptr() *StateVariableType { + return &v +} diff --git a/examples/v2/app-builder/CreateApp.go b/examples/v2/app-builder/CreateApp.go index 2ddc7250ab7..17b02b7128c 100644 --- a/examples/v2/app-builder/CreateApp.go +++ b/examples/v2/app-builder/CreateApp.go @@ -10,54 +10,186 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" + "github.com/google/uuid" ) func main() { body := datadogV2.CreateAppRequest{ Data: &datadogV2.CreateAppRequestData{ + Type: datadogV2.APPDEFINITIONTYPE_APPDEFINITIONS, Attributes: &datadogV2.CreateAppRequestDataAttributes{ + RootInstanceName: datadog.PtrString("grid0"), Components: []datadogV2.ComponentGrid{ { - Events: []datadogV2.AppBuilderEvent{}, - Name: "grid0", + Name: "grid0", + Type: datadogV2.COMPONENTGRIDTYPE_GRID, Properties: datadogV2.ComponentGridProperties{ Children: []datadogV2.Component{ { + Type: datadogV2.COMPONENTTYPE_GRIDCELL, + Name: "gridCell0", + Properties: datadogV2.ComponentProperties{ + Children: []datadogV2.Component{ + { + Name: "text0", + Type: datadogV2.COMPONENTTYPE_TEXT, + Properties: datadogV2.ComponentProperties{ + IsVisible: &datadogV2.ComponentPropertiesIsVisible{ + Bool: datadog.PtrBool(true)}, + }, + Events: []datadogV2.AppBuilderEvent{}, + }, + }, + IsVisible: &datadogV2.ComponentPropertiesIsVisible{ + String: datadog.PtrString("true")}, + }, + Events: []datadogV2.AppBuilderEvent{}, + }, + { + Type: datadogV2.COMPONENTTYPE_GRIDCELL, + Name: "gridCell2", + Properties: datadogV2.ComponentProperties{ + Children: []datadogV2.Component{ + { + Name: "table0", + Type: datadogV2.COMPONENTTYPE_TABLE, + Properties: datadogV2.ComponentProperties{ + IsVisible: &datadogV2.ComponentPropertiesIsVisible{ + Bool: datadog.PtrBool(true)}, + }, + Events: []datadogV2.AppBuilderEvent{}, + }, + }, + IsVisible: &datadogV2.ComponentPropertiesIsVisible{ + String: datadog.PtrString("true")}, + }, Events: []datadogV2.AppBuilderEvent{}, - Name: "gridCell0", + }, + { + Type: datadogV2.COMPONENTTYPE_GRIDCELL, + Name: "gridCell1", Properties: datadogV2.ComponentProperties{ Children: []datadogV2.Component{ { + Name: "text1", + Type: datadogV2.COMPONENTTYPE_TEXT, + Properties: datadogV2.ComponentProperties{ + IsVisible: &datadogV2.ComponentPropertiesIsVisible{ + Bool: datadog.PtrBool(true)}, + }, Events: []datadogV2.AppBuilderEvent{}, - Name: "calloutValue0", + }, + }, + IsVisible: &datadogV2.ComponentPropertiesIsVisible{ + String: datadog.PtrString("true")}, + }, + Events: []datadogV2.AppBuilderEvent{}, + }, + { + Type: datadogV2.COMPONENTTYPE_GRIDCELL, + Name: "gridCell3", + Properties: datadogV2.ComponentProperties{ + Children: []datadogV2.Component{ + { + Name: "button0", + Type: datadogV2.COMPONENTTYPE_BUTTON, Properties: datadogV2.ComponentProperties{ IsVisible: &datadogV2.ComponentPropertiesIsVisible{ Bool: datadog.PtrBool(true)}, }, - Type: datadogV2.COMPONENTTYPE_CALLOUTVALUE, + Events: []datadogV2.AppBuilderEvent{ + { + Name: datadogV2.APPBUILDEREVENTNAME_CLICK.Ptr(), + Type: datadogV2.APPBUILDEREVENTTYPE_SETSTATEVARIABLEVALUE.Ptr(), + }, + }, }, }, IsVisible: &datadogV2.ComponentPropertiesIsVisible{ String: datadog.PtrString("true")}, }, + Events: []datadogV2.AppBuilderEvent{}, + }, + { Type: datadogV2.COMPONENTTYPE_GRIDCELL, + Name: "gridCell4", + Properties: datadogV2.ComponentProperties{ + Children: []datadogV2.Component{ + { + Name: "button1", + Type: datadogV2.COMPONENTTYPE_BUTTON, + Properties: datadogV2.ComponentProperties{ + IsVisible: &datadogV2.ComponentPropertiesIsVisible{ + Bool: datadog.PtrBool(true)}, + }, + Events: []datadogV2.AppBuilderEvent{ + { + Name: datadogV2.APPBUILDEREVENTNAME_CLICK.Ptr(), + Type: datadogV2.APPBUILDEREVENTTYPE_SETSTATEVARIABLEVALUE.Ptr(), + }, + }, + }, + }, + IsVisible: &datadogV2.ComponentPropertiesIsVisible{ + String: datadog.PtrString("true")}, + }, + Events: []datadogV2.AppBuilderEvent{}, }, }, + BackgroundColor: datadog.PtrString("default"), }, - Type: datadogV2.COMPONENTGRIDTYPE_GRID, + Events: []datadogV2.AppBuilderEvent{}, }, }, - Description: datadog.PtrString("This is a simple example app"), - Queries: []datadogV2.Query{}, - Name: datadog.PtrString("Example App"), - RootInstanceName: datadog.PtrString("grid0"), + Queries: []datadogV2.Query{ + datadogV2.Query{ + ActionQuery: &datadogV2.ActionQuery{ + Id: uuid.MustParse("92ff0bb8-553b-4f31-87c7-ef5bd16d47d5"), + Type: datadogV2.ACTIONQUERYTYPE_ACTION, + Name: "fetchFacts", + Events: []datadogV2.AppBuilderEvent{}, + Properties: datadogV2.ActionQueryProperties{ + Spec: datadogV2.ActionQuerySpec{ + ActionQuerySpecObject: &datadogV2.ActionQuerySpecObject{ + Fqn: "com.datadoghq.http.request", + ConnectionId: &uuid.MustParse("5e63f4a8-4ce6-47de-ba11-f6617c1d54f3"), + Inputs: &datadogV2.ActionQuerySpecInputs{ + ActionQuerySpecInput: map[string]interface{}{ + "verb": "GET", + "url": "https://catfact.ninja/facts", + "urlParams": "[{'key': 'limit', 'value': '${pageSize.value.toString()}'}, {'key': 'page', 'value': '${(table0.pageIndex + 1).toString()}'}]", + }}, + }}, + }, + }}, + datadogV2.Query{ + StateVariable: &datadogV2.StateVariable{ + Type: datadogV2.STATEVARIABLETYPE_STATEVARIABLE, + Name: "pageSize", + Properties: datadogV2.StateVariableProperties{ + DefaultValue: "${20}", + }, + Id: uuid.MustParse("afd03c81-4075-4432-8618-ba09d52d2f2d"), + }}, + datadogV2.Query{ + DataTransform: &datadogV2.DataTransform{ + Type: datadogV2.DATATRANSFORMTYPE_DATATRANSFORM, + Name: "randomFact", + Properties: datadogV2.DataTransformProperties{ + Outputs: datadog.PtrString(`${(() => {const facts = fetchFacts.outputs.body.data +return facts[Math.floor(Math.random()*facts.length)] +})()}`), + }, + Id: uuid.MustParse("0fb22859-47dc-4137-9e41-7b67d04c525c"), + }}, + }, + Name: datadog.PtrString("Example Cat Facts Viewer"), + Description: datadog.PtrString("This is a slightly complicated example app that fetches and displays cat facts"), }, - Type: datadogV2.APPDEFINITIONTYPE_APPDEFINITIONS, }, } ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() - configuration.SetUnstableOperationEnabled("v2.CreateApp", true) apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewAppBuilderApi(apiClient) resp, r, err := api.CreateApp(ctx, body) diff --git a/examples/v2/app-builder/DeleteApp.go b/examples/v2/app-builder/DeleteApp.go index bb73f630513..28435de352e 100644 --- a/examples/v2/app-builder/DeleteApp.go +++ b/examples/v2/app-builder/DeleteApp.go @@ -19,7 +19,6 @@ func main() { ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() - configuration.SetUnstableOperationEnabled("v2.DeleteApp", true) apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewAppBuilderApi(apiClient) resp, r, err := api.DeleteApp(ctx, AppDataID) diff --git a/examples/v2/app-builder/DeleteApps.go b/examples/v2/app-builder/DeleteApps.go index b2b7d0a257a..1dd2c14aa2a 100644 --- a/examples/v2/app-builder/DeleteApps.go +++ b/examples/v2/app-builder/DeleteApps.go @@ -27,7 +27,6 @@ func main() { } ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() - configuration.SetUnstableOperationEnabled("v2.DeleteApps", true) apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewAppBuilderApi(apiClient) resp, r, err := api.DeleteApps(ctx, body) diff --git a/examples/v2/app-builder/GetApp.go b/examples/v2/app-builder/GetApp.go index b952f86350a..b21a91f0faa 100644 --- a/examples/v2/app-builder/GetApp.go +++ b/examples/v2/app-builder/GetApp.go @@ -19,7 +19,6 @@ func main() { ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() - configuration.SetUnstableOperationEnabled("v2.GetApp", true) apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewAppBuilderApi(apiClient) resp, r, err := api.GetApp(ctx, AppDataID, *datadogV2.NewGetAppOptionalParameters()) diff --git a/examples/v2/app-builder/ListApps.go b/examples/v2/app-builder/ListApps.go index e4ff2b7cfa3..fe571eb7d48 100644 --- a/examples/v2/app-builder/ListApps.go +++ b/examples/v2/app-builder/ListApps.go @@ -15,7 +15,6 @@ import ( func main() { ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() - configuration.SetUnstableOperationEnabled("v2.ListApps", true) apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewAppBuilderApi(apiClient) resp, r, err := api.ListApps(ctx, *datadogV2.NewListAppsOptionalParameters()) diff --git a/examples/v2/app-builder/PublishApp.go b/examples/v2/app-builder/PublishApp.go index d47e66f3388..1bb6243069d 100644 --- a/examples/v2/app-builder/PublishApp.go +++ b/examples/v2/app-builder/PublishApp.go @@ -19,7 +19,6 @@ func main() { ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() - configuration.SetUnstableOperationEnabled("v2.PublishApp", true) apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewAppBuilderApi(apiClient) resp, r, err := api.PublishApp(ctx, AppDataID) diff --git a/examples/v2/app-builder/UnpublishApp.go b/examples/v2/app-builder/UnpublishApp.go index 490e7f3d04e..23faca94dc2 100644 --- a/examples/v2/app-builder/UnpublishApp.go +++ b/examples/v2/app-builder/UnpublishApp.go @@ -19,7 +19,6 @@ func main() { ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() - configuration.SetUnstableOperationEnabled("v2.UnpublishApp", true) apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewAppBuilderApi(apiClient) resp, r, err := api.UnpublishApp(ctx, AppDataID) diff --git a/examples/v2/app-builder/UpdateApp.go b/examples/v2/app-builder/UpdateApp.go index 12a952b346a..4bcb6d255ca 100644 --- a/examples/v2/app-builder/UpdateApp.go +++ b/examples/v2/app-builder/UpdateApp.go @@ -29,7 +29,6 @@ func main() { } ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() - configuration.SetUnstableOperationEnabled("v2.UpdateApp", true) apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewAppBuilderApi(apiClient) resp, r, err := api.UpdateApp(ctx, AppDataID, body) diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Bad_Request_response.freeze index f4fed19b332..2e31f9d19ca 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Bad_Request_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Bad_Request_response.freeze @@ -1 +1 @@ -2025-01-30T22:30:41.653Z \ No newline at end of file +2025-02-14T16:45:00.619Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Created_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Created_response.freeze index e194fa4dff0..95773bb7105 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Created_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Created_response.freeze @@ -1 +1 @@ -2025-01-30T22:30:41.765Z \ No newline at end of file +2025-02-14T16:45:00.807Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Created_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Created_response.yaml index 0c7f8a0c4e5..2314995d69d 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Created_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Create_App_returns_Created_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isLoading":false,"isUnpublishd":false,"isVisible":true,"label":"CPU Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a simple example app","name":"Example App","queries":[],"rootInstanceName":"grid0"},"type":"appDefinitions"}} + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"backgroundColor":"default","children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"text0","properties":{"content":"# Cat Facts","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":5,"width":4,"x":0,"y":0}}},"type":"gridCell"},{"events":[],"name":"gridCell2","properties":{"children":[{"events":[],"name":"table0","properties":{"columns":[{"dataPath":"fact","header":"fact","id":"0ae2ae9e-0280-4389-83c6-1c5949f7e674","isHidden":false},{"dataPath":"length","header":"length","id":"c9048611-0196-4a00-9366-1ef9e3ec0408","isHidden":true},{"dataPath":"Due Date","disableSortBy":false,"formatter":{"format":"LARGE_WITHOUT_TIME","type":"formatted_time"},"header":"Unused Old Column","id":"8fa9284b-7a58-4f13-9959-57b7d8a7fe8f","isDeleted":true}],"data":"${fetchFacts?.outputs?.body?.data}","globalFilter":false,"isLoading":"${fetchFacts?.isLoading}","isScrollable":"vertical","isSubRowsEnabled":false,"isVisible":true,"isWrappable":false,"pageSize":"${pageSize?.value}","paginationType":"server_side","rowButtons":[],"summary":true,"totalCount":"${fetchFacts?.outputs?.body?.total}"},"type":"table"}],"isVisible":"true","layout":{"default":{"height":96,"width":12,"x":0,"y":5}}},"type":"gridCell"},{"events":[],"name":"gridCell1","properties":{"children":[{"events":[],"name":"text1","properties":{"content":"## Random Fact\n\n${randomFact?.outputs?.fact}","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":16,"width":12,"x":0,"y":101}}},"type":"gridCell"},{"events":[],"name":"gridCell3","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value + 1}","variableName":"pageSize"}],"name":"button0","properties":{"iconLeft":"angleUp","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Increase Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":134}}},"type":"gridCell"},{"events":[],"name":"gridCell4","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value - 1}","variableName":"pageSize"}],"name":"button1","properties":{"iconLeft":"angleDown","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Decrease Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":138}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a slightly complicated example app that fetches and displays cat facts","name":"Example Cat Facts Viewer","queries":[{"events":[],"id":"92ff0bb8-553b-4f31-87c7-ef5bd16d47d5","name":"fetchFacts","properties":{"spec":{"connectionId":"5e63f4a8-4ce6-47de-ba11-f6617c1d54f3","fqn":"com.datadoghq.http.request","inputs":{"url":"https://catfact.ninja/facts","urlParams":[{"key":"limit","value":"${pageSize.value.toString()}"},{"key":"page","value":"${(table0.pageIndex + 1).toString()}"}],"verb":"GET"}}},"type":"action"},{"id":"afd03c81-4075-4432-8618-ba09d52d2f2d","name":"pageSize","properties":{"defaultValue":"${20}"},"type":"stateVariable"},{"id":"0fb22859-47dc-4137-9e41-7b67d04c525c","name":"randomFact","properties":{"outputs":"${(() =\u003e {const facts = fetchFacts.outputs.body.data\nreturn facts[Math.floor(Math.random()*facts.length)]\n})()}"},"type":"dataTransform"}],"rootInstanceName":"grid0"},"type":"appDefinitions"}} form: {} headers: Accept: @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"data":{"id":"444afc7d-6572-42eb-b655-b8763ba2d032","type":"appDefinitions"}}' + body: '{"data":{"id":"b6becff0-4703-4724-b92a-1445df194b75","type":"appDefinitions"}}' code: 201 duration: 0ms headers: @@ -27,9 +27,9 @@ interactions: - application/json id: 1 method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/444afc7d-6572-42eb-b655-b8763ba2d032 + url: https://api.datadoghq.com/api/v2/app-builder/apps/b6becff0-4703-4724-b92a-1445df194b75 response: - body: '{"data":{"id":"444afc7d-6572-42eb-b655-b8763ba2d032","type":"appDefinitions"}}' + body: '{"data":{"id":"b6becff0-4703-4724-b92a-1445df194b75","type":"appDefinitions"}}' code: 200 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_Not_Found_response.freeze index d59753b20fa..cc2b30020a0 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_Not_Found_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_Not_Found_response.freeze @@ -1 +1 @@ -2025-01-30T22:30:42.199Z \ No newline at end of file +2025-02-14T16:45:01.264Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_OK_response.freeze index 8d71c0bb47c..5b85436cbc7 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_OK_response.freeze @@ -1 +1 @@ -2025-01-30T22:30:42.276Z \ No newline at end of file +2025-02-14T16:45:01.358Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_OK_response.yaml index a75c87271b5..7b572e0dbfd 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_App_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a simple example app","name":"Example App","queries":[],"rootInstanceName":"grid0"},"type":"appDefinitions"}} + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"backgroundColor":"default","children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"text0","properties":{"content":"# Cat Facts","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":5,"width":4,"x":0,"y":0}}},"type":"gridCell"},{"events":[],"name":"gridCell2","properties":{"children":[{"events":[],"name":"table0","properties":{"columns":[{"dataPath":"fact","header":"fact","id":"0ae2ae9e-0280-4389-83c6-1c5949f7e674","isHidden":false},{"dataPath":"length","header":"length","id":"c9048611-0196-4a00-9366-1ef9e3ec0408","isHidden":true},{"dataPath":"Due Date","disableSortBy":false,"formatter":{"format":"LARGE_WITHOUT_TIME","type":"formatted_time"},"header":"Unused Old Column","id":"8fa9284b-7a58-4f13-9959-57b7d8a7fe8f","isDeleted":true}],"data":"${fetchFacts?.outputs?.body?.data}","globalFilter":false,"isLoading":"${fetchFacts?.isLoading}","isScrollable":"vertical","isSubRowsEnabled":false,"isVisible":true,"isWrappable":false,"pageSize":"${pageSize?.value}","paginationType":"server_side","rowButtons":[],"summary":true,"totalCount":"${fetchFacts?.outputs?.body?.total}"},"type":"table"}],"isVisible":"true","layout":{"default":{"height":96,"width":12,"x":0,"y":5}}},"type":"gridCell"},{"events":[],"name":"gridCell1","properties":{"children":[{"events":[],"name":"text1","properties":{"content":"## Random Fact\n\n${randomFact?.outputs?.fact}","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":16,"width":12,"x":0,"y":101}}},"type":"gridCell"},{"events":[],"name":"gridCell3","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value + 1}","variableName":"pageSize"}],"name":"button0","properties":{"iconLeft":"angleUp","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Increase Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":134}}},"type":"gridCell"},{"events":[],"name":"gridCell4","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value - 1}","variableName":"pageSize"}],"name":"button1","properties":{"iconLeft":"angleDown","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Decrease Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":138}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a slightly complicated example app that fetches and displays cat facts","name":"Example Cat Facts Viewer","queries":[{"events":[],"id":"92ff0bb8-553b-4f31-87c7-ef5bd16d47d5","name":"fetchFacts","properties":{"spec":{"connectionId":"5e63f4a8-4ce6-47de-ba11-f6617c1d54f3","fqn":"com.datadoghq.http.request","inputs":{"url":"https://catfact.ninja/facts","urlParams":[{"key":"limit","value":"${pageSize.value.toString()}"},{"key":"page","value":"${(table0.pageIndex + 1).toString()}"}],"verb":"GET"}}},"type":"action"},{"id":"afd03c81-4075-4432-8618-ba09d52d2f2d","name":"pageSize","properties":{"defaultValue":"${20}"},"type":"stateVariable"},{"id":"0fb22859-47dc-4137-9e41-7b67d04c525c","name":"randomFact","properties":{"outputs":"${(() =\u003e {const facts = fetchFacts.outputs.body.data\nreturn facts[Math.floor(Math.random()*facts.length)]\n})()}"},"type":"dataTransform"}],"rootInstanceName":"grid0"},"type":"appDefinitions"}} form: {} headers: Accept: @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"data":{"id":"6d05b89a-db5e-4f7d-aa03-26ccd05be44e","type":"appDefinitions"}}' + body: '{"data":{"id":"de4f1fa8-bd84-4d67-a245-507a500f12e1","type":"appDefinitions"}}' code: 201 duration: 0ms headers: @@ -27,9 +27,9 @@ interactions: - application/json id: 1 method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/6d05b89a-db5e-4f7d-aa03-26ccd05be44e + url: https://api.datadoghq.com/api/v2/app-builder/apps/de4f1fa8-bd84-4d67-a245-507a500f12e1 response: - body: '{"data":{"id":"6d05b89a-db5e-4f7d-aa03-26ccd05be44e","type":"appDefinitions"}}' + body: '{"data":{"id":"de4f1fa8-bd84-4d67-a245-507a500f12e1","type":"appDefinitions"}}' code: 200 duration: 0ms headers: @@ -44,7 +44,7 @@ interactions: - application/json id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/6d05b89a-db5e-4f7d-aa03-26ccd05be44e + url: https://api.datadoghq.com/api/v2/app-builder/apps/de4f1fa8-bd84-4d67-a245-507a500f12e1 response: body: '{"errors":[{"title":"app not found"}]}' code: 404 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.freeze index 1e20d6bc1e2..76f15202ead 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.freeze @@ -1 +1 @@ -2025-01-30T22:30:42.693Z \ No newline at end of file +2025-02-14T16:45:01.993Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_OK_response.freeze index d5d8aa92f4b..54cb3a20fe0 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_OK_response.freeze @@ -1 +1 @@ -2025-01-30T22:30:42.770Z \ No newline at end of file +2025-02-14T16:45:02.105Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_OK_response.yaml index 0b9d3421e66..4b1e27a6c44 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Delete_Multiple_Apps_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a simple example app","name":"Example App","queries":[],"rootInstanceName":"grid0"},"type":"appDefinitions"}} + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"backgroundColor":"default","children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"text0","properties":{"content":"# Cat Facts","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":5,"width":4,"x":0,"y":0}}},"type":"gridCell"},{"events":[],"name":"gridCell2","properties":{"children":[{"events":[],"name":"table0","properties":{"columns":[{"dataPath":"fact","header":"fact","id":"0ae2ae9e-0280-4389-83c6-1c5949f7e674","isHidden":false},{"dataPath":"length","header":"length","id":"c9048611-0196-4a00-9366-1ef9e3ec0408","isHidden":true},{"dataPath":"Due Date","disableSortBy":false,"formatter":{"format":"LARGE_WITHOUT_TIME","type":"formatted_time"},"header":"Unused Old Column","id":"8fa9284b-7a58-4f13-9959-57b7d8a7fe8f","isDeleted":true}],"data":"${fetchFacts?.outputs?.body?.data}","globalFilter":false,"isLoading":"${fetchFacts?.isLoading}","isScrollable":"vertical","isSubRowsEnabled":false,"isVisible":true,"isWrappable":false,"pageSize":"${pageSize?.value}","paginationType":"server_side","rowButtons":[],"summary":true,"totalCount":"${fetchFacts?.outputs?.body?.total}"},"type":"table"}],"isVisible":"true","layout":{"default":{"height":96,"width":12,"x":0,"y":5}}},"type":"gridCell"},{"events":[],"name":"gridCell1","properties":{"children":[{"events":[],"name":"text1","properties":{"content":"## Random Fact\n\n${randomFact?.outputs?.fact}","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":16,"width":12,"x":0,"y":101}}},"type":"gridCell"},{"events":[],"name":"gridCell3","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value + 1}","variableName":"pageSize"}],"name":"button0","properties":{"iconLeft":"angleUp","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Increase Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":134}}},"type":"gridCell"},{"events":[],"name":"gridCell4","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value - 1}","variableName":"pageSize"}],"name":"button1","properties":{"iconLeft":"angleDown","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Decrease Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":138}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a slightly complicated example app that fetches and displays cat facts","name":"Example Cat Facts Viewer","queries":[{"events":[],"id":"92ff0bb8-553b-4f31-87c7-ef5bd16d47d5","name":"fetchFacts","properties":{"spec":{"connectionId":"5e63f4a8-4ce6-47de-ba11-f6617c1d54f3","fqn":"com.datadoghq.http.request","inputs":{"url":"https://catfact.ninja/facts","urlParams":[{"key":"limit","value":"${pageSize.value.toString()}"},{"key":"page","value":"${(table0.pageIndex + 1).toString()}"}],"verb":"GET"}}},"type":"action"},{"id":"afd03c81-4075-4432-8618-ba09d52d2f2d","name":"pageSize","properties":{"defaultValue":"${20}"},"type":"stateVariable"},{"id":"0fb22859-47dc-4137-9e41-7b67d04c525c","name":"randomFact","properties":{"outputs":"${(() =\u003e {const facts = fetchFacts.outputs.body.data\nreturn facts[Math.floor(Math.random()*facts.length)]\n})()}"},"type":"dataTransform"}],"rootInstanceName":"grid0"},"type":"appDefinitions"}} form: {} headers: Accept: @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"data":{"id":"91f80f89-33dc-4311-93fe-b4936275bc74","type":"appDefinitions"}}' + body: '{"data":{"id":"f33597bb-5c91-497c-ba26-68b7493905c0","type":"appDefinitions"}}' code: 201 duration: 0ms headers: @@ -21,7 +21,7 @@ interactions: status: 201 Created - request: body: | - {"data":[{"id":"91f80f89-33dc-4311-93fe-b4936275bc74","type":"appDefinitions"}]} + {"data":[{"id":"f33597bb-5c91-497c-ba26-68b7493905c0","type":"appDefinitions"}]} form: {} headers: Accept: @@ -32,7 +32,7 @@ interactions: method: DELETE url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"data":[{"id":"91f80f89-33dc-4311-93fe-b4936275bc74","type":"appDefinitions"}]}' + body: '{"data":[{"id":"f33597bb-5c91-497c-ba26-68b7493905c0","type":"appDefinitions"}]}' code: 200 duration: 0ms headers: @@ -47,7 +47,7 @@ interactions: - application/json id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/91f80f89-33dc-4311-93fe-b4936275bc74 + url: https://api.datadoghq.com/api/v2/app-builder/apps/f33597bb-5c91-497c-ba26-68b7493905c0 response: body: '{"errors":[{"title":"app not found"}]}' code: 404 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_Gone_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_Gone_response.freeze new file mode 100644 index 00000000000..d2e79599e8a --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_Gone_response.freeze @@ -0,0 +1 @@ +2025-02-14T16:45:02.544Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_Gone_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_Gone_response.yaml new file mode 100644 index 00000000000..9ebb0c569f0 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_Gone_response.yaml @@ -0,0 +1,56 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"backgroundColor":"default","children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"text0","properties":{"content":"# Cat Facts","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":5,"width":4,"x":0,"y":0}}},"type":"gridCell"},{"events":[],"name":"gridCell2","properties":{"children":[{"events":[],"name":"table0","properties":{"columns":[{"dataPath":"fact","header":"fact","id":"0ae2ae9e-0280-4389-83c6-1c5949f7e674","isHidden":false},{"dataPath":"length","header":"length","id":"c9048611-0196-4a00-9366-1ef9e3ec0408","isHidden":true},{"dataPath":"Due Date","disableSortBy":false,"formatter":{"format":"LARGE_WITHOUT_TIME","type":"formatted_time"},"header":"Unused Old Column","id":"8fa9284b-7a58-4f13-9959-57b7d8a7fe8f","isDeleted":true}],"data":"${fetchFacts?.outputs?.body?.data}","globalFilter":false,"isLoading":"${fetchFacts?.isLoading}","isScrollable":"vertical","isSubRowsEnabled":false,"isVisible":true,"isWrappable":false,"pageSize":"${pageSize?.value}","paginationType":"server_side","rowButtons":[],"summary":true,"totalCount":"${fetchFacts?.outputs?.body?.total}"},"type":"table"}],"isVisible":"true","layout":{"default":{"height":96,"width":12,"x":0,"y":5}}},"type":"gridCell"},{"events":[],"name":"gridCell1","properties":{"children":[{"events":[],"name":"text1","properties":{"content":"## Random Fact\n\n${randomFact?.outputs?.fact}","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":16,"width":12,"x":0,"y":101}}},"type":"gridCell"},{"events":[],"name":"gridCell3","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value + 1}","variableName":"pageSize"}],"name":"button0","properties":{"iconLeft":"angleUp","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Increase Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":134}}},"type":"gridCell"},{"events":[],"name":"gridCell4","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value - 1}","variableName":"pageSize"}],"name":"button1","properties":{"iconLeft":"angleDown","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Decrease Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":138}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a slightly complicated example app that fetches and displays cat facts","name":"Example Cat Facts Viewer","queries":[{"events":[],"id":"92ff0bb8-553b-4f31-87c7-ef5bd16d47d5","name":"fetchFacts","properties":{"spec":{"connectionId":"5e63f4a8-4ce6-47de-ba11-f6617c1d54f3","fqn":"com.datadoghq.http.request","inputs":{"url":"https://catfact.ninja/facts","urlParams":[{"key":"limit","value":"${pageSize.value.toString()}"},{"key":"page","value":"${(table0.pageIndex + 1).toString()}"}],"verb":"GET"}}},"type":"action"},{"id":"afd03c81-4075-4432-8618-ba09d52d2f2d","name":"pageSize","properties":{"defaultValue":"${20}"},"type":"stateVariable"},{"id":"0fb22859-47dc-4137-9e41-7b67d04c525c","name":"randomFact","properties":{"outputs":"${(() =\u003e {const facts = fetchFacts.outputs.body.data\nreturn facts[Math.floor(Math.random()*facts.length)]\n})()}"},"type":"dataTransform"}],"rootInstanceName":"grid0"},"type":"appDefinitions"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/app-builder/apps + response: + body: '{"data":{"id":"84b262f9-ae08-4be9-9050-93ff89ccd474","type":"appDefinitions"}}' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 201 Created +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 1 + method: GET + url: https://api.datadoghq.com/api/v2/app-builder/apps/84b262f9-ae08-4be9-9050-93ff89ccd474?version=31 + response: + body: '{"errors":[{"title":"app version not found"}]}' + code: 410 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 410 Gone +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 2 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps/84b262f9-ae08-4be9-9050-93ff89ccd474 + response: + body: '{"data":{"id":"84b262f9-ae08-4be9-9050-93ff89ccd474","type":"appDefinitions"}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_Not_Found_response.freeze index 6c7b9a9df98..f5cb3f69de0 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_Not_Found_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_Not_Found_response.freeze @@ -1 +1 @@ -2025-01-30T22:30:43.135Z \ No newline at end of file +2025-02-14T16:45:03.071Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_OK_response.freeze index bf7c9e277ef..485ec95c385 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_OK_response.freeze @@ -1 +1 @@ -2025-01-30T22:30:43.220Z \ No newline at end of file +2025-02-14T16:45:03.186Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_OK_response.yaml index 0236b4f4a1f..55d1d2ecb13 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Get_App_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a simple example app","name":"Example App","queries":[],"rootInstanceName":"grid0"},"type":"appDefinitions"}} + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"backgroundColor":"default","children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"text0","properties":{"content":"# Cat Facts","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":5,"width":4,"x":0,"y":0}}},"type":"gridCell"},{"events":[],"name":"gridCell2","properties":{"children":[{"events":[],"name":"table0","properties":{"columns":[{"dataPath":"fact","header":"fact","id":"0ae2ae9e-0280-4389-83c6-1c5949f7e674","isHidden":false},{"dataPath":"length","header":"length","id":"c9048611-0196-4a00-9366-1ef9e3ec0408","isHidden":true},{"dataPath":"Due Date","disableSortBy":false,"formatter":{"format":"LARGE_WITHOUT_TIME","type":"formatted_time"},"header":"Unused Old Column","id":"8fa9284b-7a58-4f13-9959-57b7d8a7fe8f","isDeleted":true}],"data":"${fetchFacts?.outputs?.body?.data}","globalFilter":false,"isLoading":"${fetchFacts?.isLoading}","isScrollable":"vertical","isSubRowsEnabled":false,"isVisible":true,"isWrappable":false,"pageSize":"${pageSize?.value}","paginationType":"server_side","rowButtons":[],"summary":true,"totalCount":"${fetchFacts?.outputs?.body?.total}"},"type":"table"}],"isVisible":"true","layout":{"default":{"height":96,"width":12,"x":0,"y":5}}},"type":"gridCell"},{"events":[],"name":"gridCell1","properties":{"children":[{"events":[],"name":"text1","properties":{"content":"## Random Fact\n\n${randomFact?.outputs?.fact}","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":16,"width":12,"x":0,"y":101}}},"type":"gridCell"},{"events":[],"name":"gridCell3","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value + 1}","variableName":"pageSize"}],"name":"button0","properties":{"iconLeft":"angleUp","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Increase Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":134}}},"type":"gridCell"},{"events":[],"name":"gridCell4","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value - 1}","variableName":"pageSize"}],"name":"button1","properties":{"iconLeft":"angleDown","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Decrease Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":138}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a slightly complicated example app that fetches and displays cat facts","name":"Example Cat Facts Viewer","queries":[{"events":[],"id":"92ff0bb8-553b-4f31-87c7-ef5bd16d47d5","name":"fetchFacts","properties":{"spec":{"connectionId":"5e63f4a8-4ce6-47de-ba11-f6617c1d54f3","fqn":"com.datadoghq.http.request","inputs":{"url":"https://catfact.ninja/facts","urlParams":[{"key":"limit","value":"${pageSize.value.toString()}"},{"key":"page","value":"${(table0.pageIndex + 1).toString()}"}],"verb":"GET"}}},"type":"action"},{"id":"afd03c81-4075-4432-8618-ba09d52d2f2d","name":"pageSize","properties":{"defaultValue":"${20}"},"type":"stateVariable"},{"id":"0fb22859-47dc-4137-9e41-7b67d04c525c","name":"randomFact","properties":{"outputs":"${(() =\u003e {const facts = fetchFacts.outputs.body.data\nreturn facts[Math.floor(Math.random()*facts.length)]\n})()}"},"type":"dataTransform"}],"rootInstanceName":"grid0"},"type":"appDefinitions"}} form: {} headers: Accept: @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"data":{"id":"25442f2c-fb75-4abe-b875-ed3497d2fc2c","type":"appDefinitions"}}' + body: '{"data":{"id":"55b4bd3f-a1e9-4595-95c8-ef3741481b97","type":"appDefinitions"}}' code: 201 duration: 0ms headers: @@ -27,11 +27,21 @@ interactions: - application/json id: 1 method: GET - url: https://api.datadoghq.com/api/v2/app-builder/apps/25442f2c-fb75-4abe-b875-ed3497d2fc2c + url: https://api.datadoghq.com/api/v2/app-builder/apps/55b4bd3f-a1e9-4595-95c8-ef3741481b97 response: - body: '{"data":{"id":"25442f2c-fb75-4abe-b875-ed3497d2fc2c","type":"appDefinitions","attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU - Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This - is a simple example app","favorite":false,"name":"Example App","queries":[],"rootInstanceName":"grid0","selfService":false,"tags":[]},"meta":{"org_id":1107852,"user_id":15479137,"user_uuid":"b3f98453-b289-11ef-a4e9-d6d283f92d91","user_name":"oliver.li@datadoghq.com","version":1,"updated_since_deployment":false,"created_at":"2025-01-30T22:30:43.296595Z","updated_at":"2025-01-30T22:30:43.296595Z","deleted_at":"0001-01-01T00:00:00Z"}}}' + body: '{"data":{"id":"55b4bd3f-a1e9-4595-95c8-ef3741481b97","type":"appDefinitions","attributes":{"components":[{"events":[],"name":"grid0","properties":{"backgroundColor":"default","children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"text0","properties":{"content":"# + Cat Facts","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":5,"width":4,"x":0,"y":0}}},"type":"gridCell"},{"events":[],"name":"gridCell2","properties":{"children":[{"events":[],"name":"table0","properties":{"columns":[{"dataPath":"fact","header":"fact","id":"0ae2ae9e-0280-4389-83c6-1c5949f7e674","isHidden":false},{"dataPath":"length","header":"length","id":"c9048611-0196-4a00-9366-1ef9e3ec0408","isHidden":true},{"dataPath":"Due + Date","disableSortBy":false,"formatter":{"format":"LARGE_WITHOUT_TIME","type":"formatted_time"},"header":"Unused + Old Column","id":"8fa9284b-7a58-4f13-9959-57b7d8a7fe8f","isDeleted":true}],"data":"${fetchFacts?.outputs?.body?.data}","globalFilter":false,"isLoading":"${fetchFacts?.isLoading}","isScrollable":"vertical","isSubRowsEnabled":false,"isVisible":true,"isWrappable":false,"pageSize":"${pageSize?.value}","paginationType":"server_side","rowButtons":[],"summary":true,"totalCount":"${fetchFacts?.outputs?.body?.total}"},"type":"table"}],"isVisible":"true","layout":{"default":{"height":96,"width":12,"x":0,"y":5}}},"type":"gridCell"},{"events":[],"name":"gridCell1","properties":{"children":[{"events":[],"name":"text1","properties":{"content":"## + Random Fact\n\n${randomFact?.outputs?.fact}","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":16,"width":12,"x":0,"y":101}}},"type":"gridCell"},{"events":[],"name":"gridCell3","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value + + 1}","variableName":"pageSize"}],"name":"button0","properties":{"iconLeft":"angleUp","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Increase + Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":134}}},"type":"gridCell"},{"events":[],"name":"gridCell4","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value + - 1}","variableName":"pageSize"}],"name":"button1","properties":{"iconLeft":"angleDown","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Decrease + Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":138}}},"type":"gridCell"}]},"type":"grid"}],"description":"This + is a slightly complicated example app that fetches and displays cat facts","favorite":false,"name":"Example + Cat Facts Viewer","queries":[{"id":"92ff0bb8-553b-4f31-87c7-ef5bd16d47d5","name":"fetchFacts","type":"action","properties":{"spec":{"connectionId":"5e63f4a8-4ce6-47de-ba11-f6617c1d54f3","fqn":"com.datadoghq.http.request","inputs":{"url":"https://catfact.ninja/facts","urlParams":[{"key":"limit","value":"${pageSize.value.toString()}"},{"key":"page","value":"${(table0.pageIndex + + 1).toString()}"}],"verb":"GET"}}}},{"id":"afd03c81-4075-4432-8618-ba09d52d2f2d","name":"pageSize","type":"stateVariable","properties":{"defaultValue":"${20}"}},{"id":"0fb22859-47dc-4137-9e41-7b67d04c525c","name":"randomFact","type":"dataTransform","properties":{"outputs":"${(() + =\u003e {const facts = fetchFacts.outputs.body.data\nreturn facts[Math.floor(Math.random()*facts.length)]\n})()}"}}],"rootInstanceName":"grid0","selfService":false,"tags":[]},"meta":{"org_id":1107852,"user_id":15479137,"user_uuid":"b3f98453-b289-11ef-a4e9-d6d283f92d91","user_name":"oliver.li@datadoghq.com","version":1,"updated_since_deployment":false,"created_at":"2025-02-14T16:45:03.266046Z","updated_at":"2025-02-14T16:45:03.266046Z","deleted_at":"0001-01-01T00:00:00Z"}}}' code: 200 duration: 0ms headers: @@ -46,9 +56,9 @@ interactions: - application/json id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/25442f2c-fb75-4abe-b875-ed3497d2fc2c + url: https://api.datadoghq.com/api/v2/app-builder/apps/55b4bd3f-a1e9-4595-95c8-ef3741481b97 response: - body: '{"data":{"id":"25442f2c-fb75-4abe-b875-ed3497d2fc2c","type":"appDefinitions"}}' + body: '{"data":{"id":"55b4bd3f-a1e9-4595-95c8-ef3741481b97","type":"appDefinitions"}}' code: 200 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Apps_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Apps_returns_OK_response.freeze index c70176b29cc..f68dc360fe0 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Apps_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Apps_returns_OK_response.freeze @@ -1 +1 @@ -2025-01-30T22:30:43.707Z \ No newline at end of file +2025-02-14T16:45:03.738Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Apps_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Apps_returns_OK_response.yaml index 8c5746ec808..f50fba66e0a 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Apps_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_List_Apps_returns_OK_response.yaml @@ -9,7 +9,8 @@ interactions: method: GET url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"data":[{"id":"31bfe961-ba29-4c43-85d8-f7d02afdb9a3","type":"appDefinitions","attributes":{"description":"","favorite":false,"name":"[synthetics] + body: '{"data":[{"id":"b1c2bf4d-f987-4306-8dcd-a48bedecf19e","type":"appDefinitions","attributes":{"description":"","favorite":false,"name":"[synthetics] + app name 0123456789","selfService":false,"tags":[]},"meta":{"org_id":1107852,"user_id":7571471,"user_uuid":"01347f51-3fcd-11ef-95dd-a65df5ee2843","user_name":"01347f51-3fcd-11ef-95dd-a65df5ee2843","version":0,"updated_since_deployment":false,"created_at":"2025-02-14T16:44:58.965378Z","updated_at":"2025-02-14T16:44:58.965378Z","deleted_at":"0001-01-01T00:00:00Z"}},{"id":"31bfe961-ba29-4c43-85d8-f7d02afdb9a3","type":"appDefinitions","attributes":{"description":"","favorite":false,"name":"[synthetics] app name 0123456789","selfService":false,"tags":[]},"meta":{"org_id":1107852,"user_id":7571471,"user_uuid":"01347f51-3fcd-11ef-95dd-a65df5ee2843","user_name":"01347f51-3fcd-11ef-95dd-a65df5ee2843","version":0,"updated_since_deployment":false,"created_at":"2025-01-29T15:53:32.324305Z","updated_at":"2025-01-29T15:53:32.324305Z","deleted_at":"0001-01-01T00:00:00Z"}},{"id":"2363c6a3-9077-4c58-a7e2-39f27ca42e02","type":"appDefinitions","attributes":{"description":"","favorite":false,"name":"[synthetics] app name 0123456789","selfService":false,"tags":[]},"meta":{"org_id":1107852,"user_id":7571471,"user_uuid":"01347f51-3fcd-11ef-95dd-a65df5ee2843","user_name":"01347f51-3fcd-11ef-95dd-a65df5ee2843","version":0,"updated_since_deployment":false,"created_at":"2025-01-23T00:18:13.328203Z","updated_at":"2025-01-23T00:18:13.328203Z","deleted_at":"0001-01-01T00:00:00Z"}},{"id":"a5557ecf-17c6-43dc-b20f-6c77869777c1","type":"appDefinitions","attributes":{"description":"","favorite":false,"name":"[synthetics] app name 0123456789","selfService":false,"tags":[]},"meta":{"org_id":1107852,"user_id":7571471,"user_uuid":"01347f51-3fcd-11ef-95dd-a65df5ee2843","user_name":"01347f51-3fcd-11ef-95dd-a65df5ee2843","version":0,"updated_since_deployment":false,"created_at":"2025-01-22T17:17:39.807236Z","updated_at":"2025-01-22T17:17:39.807236Z","deleted_at":"0001-01-01T00:00:00Z"}},{"id":"83ca3945-3c9f-4eb9-b46a-992a97f1acf3","type":"appDefinitions","attributes":{"description":"","favorite":false,"name":"[synthetics] @@ -18,8 +19,7 @@ interactions: app name 0123456789","selfService":false,"tags":[]},"meta":{"org_id":1107852,"user_id":7571471,"user_uuid":"01347f51-3fcd-11ef-95dd-a65df5ee2843","user_name":"01347f51-3fcd-11ef-95dd-a65df5ee2843","version":0,"updated_since_deployment":false,"created_at":"2025-01-21T23:30:39.902639Z","updated_at":"2025-01-21T23:30:40.166756Z","deleted_at":"0001-01-01T00:00:00Z"}},{"id":"d21c6da5-cb04-4ee6-aa7d-3fe6b2fd0be3","type":"appDefinitions","attributes":{"description":"","favorite":false,"name":"[synthetics] app name 0123456789","selfService":false,"tags":[]},"meta":{"org_id":1107852,"user_id":7571471,"user_uuid":"01347f51-3fcd-11ef-95dd-a65df5ee2843","user_name":"01347f51-3fcd-11ef-95dd-a65df5ee2843","version":0,"updated_since_deployment":false,"created_at":"2025-01-21T22:36:50.399181Z","updated_at":"2025-01-21T22:36:50.399181Z","deleted_at":"0001-01-01T00:00:00Z"}},{"id":"02343a47-9092-40a7-9464-aade9d617050","type":"appDefinitions","attributes":{"description":"","favorite":false,"name":"[synthetics] app name 0123456789","selfService":false,"tags":[]},"meta":{"org_id":1107852,"user_id":7571471,"user_uuid":"01347f51-3fcd-11ef-95dd-a65df5ee2843","user_name":"01347f51-3fcd-11ef-95dd-a65df5ee2843","version":0,"updated_since_deployment":false,"created_at":"2025-01-20T23:17:39.895098Z","updated_at":"2025-01-20T23:17:40.19356Z","deleted_at":"0001-01-01T00:00:00Z"}},{"id":"be847238-5f04-4e50-9cce-facc0b8fbb09","type":"appDefinitions","attributes":{"description":"","favorite":false,"name":"[synthetics] - app name 0123456789","selfService":false,"tags":[]},"meta":{"org_id":1107852,"user_id":7571471,"user_uuid":"01347f51-3fcd-11ef-95dd-a65df5ee2843","user_name":"01347f51-3fcd-11ef-95dd-a65df5ee2843","version":0,"updated_since_deployment":false,"created_at":"2025-01-20T01:48:05.39422Z","updated_at":"2025-01-20T01:48:05.39422Z","deleted_at":"0001-01-01T00:00:00Z"}},{"id":"4b562f9c-3fe4-49dc-9e08-4a704db958a8","type":"appDefinitions","attributes":{"description":"","favorite":false,"name":"Kelly''s - App Thu, Jan 16, 1:13:37 pm","selfService":false,"tags":[]},"meta":{"org_id":1107852,"user_id":20776465,"user_uuid":"8820640c-cdf5-11ef-b473-76727e778fd9","user_name":"kelly.sun@datadoghq.com","version":0,"updated_since_deployment":false,"created_at":"2025-01-16T18:14:00.896371Z","updated_at":"2025-01-16T18:14:00.896371Z","deleted_at":"0001-01-01T00:00:00Z"}}],"meta":{"page":{"totalCount":29,"totalFilteredCount":29}}}' + app name 0123456789","selfService":false,"tags":[]},"meta":{"org_id":1107852,"user_id":7571471,"user_uuid":"01347f51-3fcd-11ef-95dd-a65df5ee2843","user_name":"01347f51-3fcd-11ef-95dd-a65df5ee2843","version":0,"updated_since_deployment":false,"created_at":"2025-01-20T01:48:05.39422Z","updated_at":"2025-01-20T01:48:05.39422Z","deleted_at":"0001-01-01T00:00:00Z"}}],"meta":{"page":{"totalCount":30,"totalFilteredCount":30}}}' code: 200 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Created_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Created_response.freeze index c28deba1baa..12979433e7b 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Created_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Created_response.freeze @@ -1 +1 @@ -2025-01-30T22:30:43.820Z \ No newline at end of file +2025-02-14T16:45:03.857Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Created_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Created_response.yaml index b5c919812d4..5963b5f1ba1 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Created_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Created_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a simple example app","name":"Example App","queries":[],"rootInstanceName":"grid0"},"type":"appDefinitions"}} + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"backgroundColor":"default","children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"text0","properties":{"content":"# Cat Facts","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":5,"width":4,"x":0,"y":0}}},"type":"gridCell"},{"events":[],"name":"gridCell2","properties":{"children":[{"events":[],"name":"table0","properties":{"columns":[{"dataPath":"fact","header":"fact","id":"0ae2ae9e-0280-4389-83c6-1c5949f7e674","isHidden":false},{"dataPath":"length","header":"length","id":"c9048611-0196-4a00-9366-1ef9e3ec0408","isHidden":true},{"dataPath":"Due Date","disableSortBy":false,"formatter":{"format":"LARGE_WITHOUT_TIME","type":"formatted_time"},"header":"Unused Old Column","id":"8fa9284b-7a58-4f13-9959-57b7d8a7fe8f","isDeleted":true}],"data":"${fetchFacts?.outputs?.body?.data}","globalFilter":false,"isLoading":"${fetchFacts?.isLoading}","isScrollable":"vertical","isSubRowsEnabled":false,"isVisible":true,"isWrappable":false,"pageSize":"${pageSize?.value}","paginationType":"server_side","rowButtons":[],"summary":true,"totalCount":"${fetchFacts?.outputs?.body?.total}"},"type":"table"}],"isVisible":"true","layout":{"default":{"height":96,"width":12,"x":0,"y":5}}},"type":"gridCell"},{"events":[],"name":"gridCell1","properties":{"children":[{"events":[],"name":"text1","properties":{"content":"## Random Fact\n\n${randomFact?.outputs?.fact}","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":16,"width":12,"x":0,"y":101}}},"type":"gridCell"},{"events":[],"name":"gridCell3","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value + 1}","variableName":"pageSize"}],"name":"button0","properties":{"iconLeft":"angleUp","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Increase Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":134}}},"type":"gridCell"},{"events":[],"name":"gridCell4","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value - 1}","variableName":"pageSize"}],"name":"button1","properties":{"iconLeft":"angleDown","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Decrease Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":138}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a slightly complicated example app that fetches and displays cat facts","name":"Example Cat Facts Viewer","queries":[{"events":[],"id":"92ff0bb8-553b-4f31-87c7-ef5bd16d47d5","name":"fetchFacts","properties":{"spec":{"connectionId":"5e63f4a8-4ce6-47de-ba11-f6617c1d54f3","fqn":"com.datadoghq.http.request","inputs":{"url":"https://catfact.ninja/facts","urlParams":[{"key":"limit","value":"${pageSize.value.toString()}"},{"key":"page","value":"${(table0.pageIndex + 1).toString()}"}],"verb":"GET"}}},"type":"action"},{"id":"afd03c81-4075-4432-8618-ba09d52d2f2d","name":"pageSize","properties":{"defaultValue":"${20}"},"type":"stateVariable"},{"id":"0fb22859-47dc-4137-9e41-7b67d04c525c","name":"randomFact","properties":{"outputs":"${(() =\u003e {const facts = fetchFacts.outputs.body.data\nreturn facts[Math.floor(Math.random()*facts.length)]\n})()}"},"type":"dataTransform"}],"rootInstanceName":"grid0"},"type":"appDefinitions"}} form: {} headers: Accept: @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"data":{"id":"4e22b013-8758-49b7-98ea-0b2508c97bbf","type":"appDefinitions"}}' + body: '{"data":{"id":"5677160c-03ea-41cf-b9cb-1dabc7904656","type":"appDefinitions"}}' code: 201 duration: 0ms headers: @@ -27,9 +27,9 @@ interactions: - application/json id: 1 method: POST - url: https://api.datadoghq.com/api/v2/app-builder/apps/4e22b013-8758-49b7-98ea-0b2508c97bbf/deployment + url: https://api.datadoghq.com/api/v2/app-builder/apps/5677160c-03ea-41cf-b9cb-1dabc7904656/deployment response: - body: '{"data":{"id":"62438b66-95eb-47d3-b540-a5d4b0b0a791","type":"deployment","attributes":{"app_version_id":"178fbd22-f8b5-4841-92eb-f8c1c03d44c1"},"meta":{"created_at":"2025-01-30T22:30:44.12194Z","user_id":15479137,"user_uuid":"b3f98453-b289-11ef-a4e9-d6d283f92d91","user_name":"oliver.li@datadoghq.com"}}}' + body: '{"data":{"id":"9f189b09-3c00-4922-9e01-66c76bf81519","type":"deployment","attributes":{"app_version_id":"8038b7ec-533a-4bb3-b6dd-4ac11cb45ff9"},"meta":{"created_at":"2025-02-14T16:45:04.203717Z","user_id":15479137,"user_uuid":"b3f98453-b289-11ef-a4e9-d6d283f92d91","user_name":"oliver.li@datadoghq.com"}}}' code: 201 duration: 0ms headers: @@ -44,9 +44,9 @@ interactions: - application/json id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/4e22b013-8758-49b7-98ea-0b2508c97bbf + url: https://api.datadoghq.com/api/v2/app-builder/apps/5677160c-03ea-41cf-b9cb-1dabc7904656 response: - body: '{"data":{"id":"4e22b013-8758-49b7-98ea-0b2508c97bbf","type":"appDefinitions"}}' + body: '{"data":{"id":"5677160c-03ea-41cf-b9cb-1dabc7904656","type":"appDefinitions"}}' code: 200 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Not_Found_response.freeze index 3a29d90cff8..ec6b85f75bd 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Not_Found_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Publish_App_returns_Not_Found_response.freeze @@ -1 +1 @@ -2025-01-30T22:30:44.372Z \ No newline at end of file +2025-02-14T16:45:04.549Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_Not_Found_response.freeze index 4e09395f987..b23f40e08bf 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_Not_Found_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_Not_Found_response.freeze @@ -1 +1 @@ -2025-01-30T22:30:44.457Z \ No newline at end of file +2025-02-14T16:45:04.715Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_OK_response.freeze index fbc38a5c7cf..09346df6699 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_OK_response.freeze @@ -1 +1 @@ -2025-01-30T22:30:44.533Z \ No newline at end of file +2025-02-14T16:45:04.816Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_OK_response.yaml index 2ebed6fc888..237e305ca99 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Unpublish_App_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a simple example app","name":"Example App","queries":[],"rootInstanceName":"grid0"},"type":"appDefinitions"}} + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"backgroundColor":"default","children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"text0","properties":{"content":"# Cat Facts","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":5,"width":4,"x":0,"y":0}}},"type":"gridCell"},{"events":[],"name":"gridCell2","properties":{"children":[{"events":[],"name":"table0","properties":{"columns":[{"dataPath":"fact","header":"fact","id":"0ae2ae9e-0280-4389-83c6-1c5949f7e674","isHidden":false},{"dataPath":"length","header":"length","id":"c9048611-0196-4a00-9366-1ef9e3ec0408","isHidden":true},{"dataPath":"Due Date","disableSortBy":false,"formatter":{"format":"LARGE_WITHOUT_TIME","type":"formatted_time"},"header":"Unused Old Column","id":"8fa9284b-7a58-4f13-9959-57b7d8a7fe8f","isDeleted":true}],"data":"${fetchFacts?.outputs?.body?.data}","globalFilter":false,"isLoading":"${fetchFacts?.isLoading}","isScrollable":"vertical","isSubRowsEnabled":false,"isVisible":true,"isWrappable":false,"pageSize":"${pageSize?.value}","paginationType":"server_side","rowButtons":[],"summary":true,"totalCount":"${fetchFacts?.outputs?.body?.total}"},"type":"table"}],"isVisible":"true","layout":{"default":{"height":96,"width":12,"x":0,"y":5}}},"type":"gridCell"},{"events":[],"name":"gridCell1","properties":{"children":[{"events":[],"name":"text1","properties":{"content":"## Random Fact\n\n${randomFact?.outputs?.fact}","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":16,"width":12,"x":0,"y":101}}},"type":"gridCell"},{"events":[],"name":"gridCell3","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value + 1}","variableName":"pageSize"}],"name":"button0","properties":{"iconLeft":"angleUp","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Increase Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":134}}},"type":"gridCell"},{"events":[],"name":"gridCell4","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value - 1}","variableName":"pageSize"}],"name":"button1","properties":{"iconLeft":"angleDown","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Decrease Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":138}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a slightly complicated example app that fetches and displays cat facts","name":"Example Cat Facts Viewer","queries":[{"events":[],"id":"92ff0bb8-553b-4f31-87c7-ef5bd16d47d5","name":"fetchFacts","properties":{"spec":{"connectionId":"5e63f4a8-4ce6-47de-ba11-f6617c1d54f3","fqn":"com.datadoghq.http.request","inputs":{"url":"https://catfact.ninja/facts","urlParams":[{"key":"limit","value":"${pageSize.value.toString()}"},{"key":"page","value":"${(table0.pageIndex + 1).toString()}"}],"verb":"GET"}}},"type":"action"},{"id":"afd03c81-4075-4432-8618-ba09d52d2f2d","name":"pageSize","properties":{"defaultValue":"${20}"},"type":"stateVariable"},{"id":"0fb22859-47dc-4137-9e41-7b67d04c525c","name":"randomFact","properties":{"outputs":"${(() =\u003e {const facts = fetchFacts.outputs.body.data\nreturn facts[Math.floor(Math.random()*facts.length)]\n})()}"},"type":"dataTransform"}],"rootInstanceName":"grid0"},"type":"appDefinitions"}} form: {} headers: Accept: @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"data":{"id":"74865138-3856-43bf-b309-e6c5f5599e36","type":"appDefinitions"}}' + body: '{"data":{"id":"24628726-cdf1-45e6-9e05-6e73d7612d3f","type":"appDefinitions"}}' code: 201 duration: 0ms headers: @@ -27,9 +27,9 @@ interactions: - application/json id: 1 method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/74865138-3856-43bf-b309-e6c5f5599e36/deployment + url: https://api.datadoghq.com/api/v2/app-builder/apps/24628726-cdf1-45e6-9e05-6e73d7612d3f/deployment response: - body: '{"data":{"id":"b8434408-826f-4fea-bd27-786526d74e30","type":"deployment","attributes":{"app_version_id":"00000000-0000-0000-0000-000000000000"},"meta":{"created_at":"2025-01-30T22:30:44.827748Z","user_id":15479137,"user_uuid":"b3f98453-b289-11ef-a4e9-d6d283f92d91","user_name":"oliver.li@datadoghq.com"}}}' + body: '{"data":{"id":"892fa942-bd01-4e75-9582-e1a5c7736b46","type":"deployment","attributes":{"app_version_id":"00000000-0000-0000-0000-000000000000"},"meta":{"created_at":"2025-02-14T16:45:05.155785Z","user_id":15479137,"user_uuid":"b3f98453-b289-11ef-a4e9-d6d283f92d91","user_name":"oliver.li@datadoghq.com"}}}' code: 200 duration: 0ms headers: @@ -44,9 +44,9 @@ interactions: - application/json id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/74865138-3856-43bf-b309-e6c5f5599e36 + url: https://api.datadoghq.com/api/v2/app-builder/apps/24628726-cdf1-45e6-9e05-6e73d7612d3f response: - body: '{"data":{"id":"74865138-3856-43bf-b309-e6c5f5599e36","type":"appDefinitions"}}' + body: '{"data":{"id":"24628726-cdf1-45e6-9e05-6e73d7612d3f","type":"appDefinitions"}}' code: 200 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_Bad_Request_response.freeze index 84b4273039a..e826a902123 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_Bad_Request_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_Bad_Request_response.freeze @@ -1 +1 @@ -2025-01-30T22:30:45.101Z \ No newline at end of file +2025-02-14T16:45:05.461Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_Bad_Request_response.yaml index d57a34139b2..2c33b9ca8b7 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_Bad_Request_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_Bad_Request_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a simple example app","name":"Example App","queries":[],"rootInstanceName":"grid0"},"type":"appDefinitions"}} + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"backgroundColor":"default","children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"text0","properties":{"content":"# Cat Facts","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":5,"width":4,"x":0,"y":0}}},"type":"gridCell"},{"events":[],"name":"gridCell2","properties":{"children":[{"events":[],"name":"table0","properties":{"columns":[{"dataPath":"fact","header":"fact","id":"0ae2ae9e-0280-4389-83c6-1c5949f7e674","isHidden":false},{"dataPath":"length","header":"length","id":"c9048611-0196-4a00-9366-1ef9e3ec0408","isHidden":true},{"dataPath":"Due Date","disableSortBy":false,"formatter":{"format":"LARGE_WITHOUT_TIME","type":"formatted_time"},"header":"Unused Old Column","id":"8fa9284b-7a58-4f13-9959-57b7d8a7fe8f","isDeleted":true}],"data":"${fetchFacts?.outputs?.body?.data}","globalFilter":false,"isLoading":"${fetchFacts?.isLoading}","isScrollable":"vertical","isSubRowsEnabled":false,"isVisible":true,"isWrappable":false,"pageSize":"${pageSize?.value}","paginationType":"server_side","rowButtons":[],"summary":true,"totalCount":"${fetchFacts?.outputs?.body?.total}"},"type":"table"}],"isVisible":"true","layout":{"default":{"height":96,"width":12,"x":0,"y":5}}},"type":"gridCell"},{"events":[],"name":"gridCell1","properties":{"children":[{"events":[],"name":"text1","properties":{"content":"## Random Fact\n\n${randomFact?.outputs?.fact}","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":16,"width":12,"x":0,"y":101}}},"type":"gridCell"},{"events":[],"name":"gridCell3","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value + 1}","variableName":"pageSize"}],"name":"button0","properties":{"iconLeft":"angleUp","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Increase Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":134}}},"type":"gridCell"},{"events":[],"name":"gridCell4","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value - 1}","variableName":"pageSize"}],"name":"button1","properties":{"iconLeft":"angleDown","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Decrease Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":138}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a slightly complicated example app that fetches and displays cat facts","name":"Example Cat Facts Viewer","queries":[{"events":[],"id":"92ff0bb8-553b-4f31-87c7-ef5bd16d47d5","name":"fetchFacts","properties":{"spec":{"connectionId":"5e63f4a8-4ce6-47de-ba11-f6617c1d54f3","fqn":"com.datadoghq.http.request","inputs":{"url":"https://catfact.ninja/facts","urlParams":[{"key":"limit","value":"${pageSize.value.toString()}"},{"key":"page","value":"${(table0.pageIndex + 1).toString()}"}],"verb":"GET"}}},"type":"action"},{"id":"afd03c81-4075-4432-8618-ba09d52d2f2d","name":"pageSize","properties":{"defaultValue":"${20}"},"type":"stateVariable"},{"id":"0fb22859-47dc-4137-9e41-7b67d04c525c","name":"randomFact","properties":{"outputs":"${(() =\u003e {const facts = fetchFacts.outputs.body.data\nreturn facts[Math.floor(Math.random()*facts.length)]\n})()}"},"type":"dataTransform"}],"rootInstanceName":"grid0"},"type":"appDefinitions"}} form: {} headers: Accept: @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"data":{"id":"3800673b-840c-4c3a-8815-058b4a8ce38e","type":"appDefinitions"}}' + body: '{"data":{"id":"28f5b1d6-f416-46b5-8cc4-94ae094c97f4","type":"appDefinitions"}}' code: 201 duration: 0ms headers: @@ -21,7 +21,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"rootInstanceName":""},"id":"3800673b-840c-4c3a-8815-058b4a8ce38e","type":"appDefinitions"}} + {"data":{"attributes":{"rootInstanceName":""},"id":"28f5b1d6-f416-46b5-8cc4-94ae094c97f4","type":"appDefinitions"}} form: {} headers: Accept: @@ -30,7 +30,7 @@ interactions: - application/json id: 1 method: PATCH - url: https://api.datadoghq.com/api/v2/app-builder/apps/3800673b-840c-4c3a-8815-058b4a8ce38e + url: https://api.datadoghq.com/api/v2/app-builder/apps/28f5b1d6-f416-46b5-8cc4-94ae094c97f4 response: body: '{"errors":[{"title":"missing required field","source":{"pointer":"/data/attributes/rootInstanceName"}}]}' code: 400 @@ -47,9 +47,9 @@ interactions: - application/json id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/3800673b-840c-4c3a-8815-058b4a8ce38e + url: https://api.datadoghq.com/api/v2/app-builder/apps/28f5b1d6-f416-46b5-8cc4-94ae094c97f4 response: - body: '{"data":{"id":"3800673b-840c-4c3a-8815-058b4a8ce38e","type":"appDefinitions"}}' + body: '{"data":{"id":"28f5b1d6-f416-46b5-8cc4-94ae094c97f4","type":"appDefinitions"}}' code: 200 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_OK_response.freeze index 0c72a214a00..47098e9adb5 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_OK_response.freeze @@ -1 +1 @@ -2025-01-30T22:30:45.511Z \ No newline at end of file +2025-02-14T16:45:05.966Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_OK_response.yaml index 7b07634cb29..6268ad9d7f0 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Builder/Scenario_Update_App_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a simple example app","name":"Example App","queries":[],"rootInstanceName":"grid0"},"type":"appDefinitions"}} + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"backgroundColor":"default","children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"text0","properties":{"content":"# Cat Facts","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":5,"width":4,"x":0,"y":0}}},"type":"gridCell"},{"events":[],"name":"gridCell2","properties":{"children":[{"events":[],"name":"table0","properties":{"columns":[{"dataPath":"fact","header":"fact","id":"0ae2ae9e-0280-4389-83c6-1c5949f7e674","isHidden":false},{"dataPath":"length","header":"length","id":"c9048611-0196-4a00-9366-1ef9e3ec0408","isHidden":true},{"dataPath":"Due Date","disableSortBy":false,"formatter":{"format":"LARGE_WITHOUT_TIME","type":"formatted_time"},"header":"Unused Old Column","id":"8fa9284b-7a58-4f13-9959-57b7d8a7fe8f","isDeleted":true}],"data":"${fetchFacts?.outputs?.body?.data}","globalFilter":false,"isLoading":"${fetchFacts?.isLoading}","isScrollable":"vertical","isSubRowsEnabled":false,"isVisible":true,"isWrappable":false,"pageSize":"${pageSize?.value}","paginationType":"server_side","rowButtons":[],"summary":true,"totalCount":"${fetchFacts?.outputs?.body?.total}"},"type":"table"}],"isVisible":"true","layout":{"default":{"height":96,"width":12,"x":0,"y":5}}},"type":"gridCell"},{"events":[],"name":"gridCell1","properties":{"children":[{"events":[],"name":"text1","properties":{"content":"## Random Fact\n\n${randomFact?.outputs?.fact}","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":16,"width":12,"x":0,"y":101}}},"type":"gridCell"},{"events":[],"name":"gridCell3","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value + 1}","variableName":"pageSize"}],"name":"button0","properties":{"iconLeft":"angleUp","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Increase Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":134}}},"type":"gridCell"},{"events":[],"name":"gridCell4","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value - 1}","variableName":"pageSize"}],"name":"button1","properties":{"iconLeft":"angleDown","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Decrease Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":138}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a slightly complicated example app that fetches and displays cat facts","name":"Example Cat Facts Viewer","queries":[{"events":[],"id":"92ff0bb8-553b-4f31-87c7-ef5bd16d47d5","name":"fetchFacts","properties":{"spec":{"connectionId":"5e63f4a8-4ce6-47de-ba11-f6617c1d54f3","fqn":"com.datadoghq.http.request","inputs":{"url":"https://catfact.ninja/facts","urlParams":[{"key":"limit","value":"${pageSize.value.toString()}"},{"key":"page","value":"${(table0.pageIndex + 1).toString()}"}],"verb":"GET"}}},"type":"action"},{"id":"afd03c81-4075-4432-8618-ba09d52d2f2d","name":"pageSize","properties":{"defaultValue":"${20}"},"type":"stateVariable"},{"id":"0fb22859-47dc-4137-9e41-7b67d04c525c","name":"randomFact","properties":{"outputs":"${(() =\u003e {const facts = fetchFacts.outputs.body.data\nreturn facts[Math.floor(Math.random()*facts.length)]\n})()}"},"type":"dataTransform"}],"rootInstanceName":"grid0"},"type":"appDefinitions"}} form: {} headers: Accept: @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/app-builder/apps response: - body: '{"data":{"id":"892d9225-fd31-4237-b218-e964ac33fc71","type":"appDefinitions"}}' + body: '{"data":{"id":"9f9a2053-6156-471b-aca8-2fa6ec87f797","type":"appDefinitions"}}' code: 201 duration: 0ms headers: @@ -21,7 +21,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"name":"Updated Name","rootInstanceName":"grid0"},"id":"892d9225-fd31-4237-b218-e964ac33fc71","type":"appDefinitions"}} + {"data":{"attributes":{"name":"Updated Name","rootInstanceName":"grid0"},"id":"9f9a2053-6156-471b-aca8-2fa6ec87f797","type":"appDefinitions"}} form: {} headers: Accept: @@ -30,11 +30,21 @@ interactions: - application/json id: 1 method: PATCH - url: https://api.datadoghq.com/api/v2/app-builder/apps/892d9225-fd31-4237-b218-e964ac33fc71 + url: https://api.datadoghq.com/api/v2/app-builder/apps/9f9a2053-6156-471b-aca8-2fa6ec87f797 response: - body: '{"data":{"id":"892d9225-fd31-4237-b218-e964ac33fc71","type":"appDefinitions","attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU - Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This - is a simple example app","favorite":false,"name":"Updated Name","queries":[],"rootInstanceName":"grid0","selfService":false,"tags":[]},"meta":{"org_id":1107852,"user_id":15479137,"user_uuid":"b3f98453-b289-11ef-a4e9-d6d283f92d91","user_name":"oliver.li@datadoghq.com","version":2,"updated_since_deployment":false,"created_at":"2025-01-30T22:30:45.584607Z","updated_at":"2025-01-30T22:30:45.785438Z","deleted_at":"0001-01-01T00:00:00Z"}}}' + body: '{"data":{"id":"9f9a2053-6156-471b-aca8-2fa6ec87f797","type":"appDefinitions","attributes":{"components":[{"events":[],"name":"grid0","properties":{"backgroundColor":"default","children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"text0","properties":{"content":"# + Cat Facts","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":5,"width":4,"x":0,"y":0}}},"type":"gridCell"},{"events":[],"name":"gridCell2","properties":{"children":[{"events":[],"name":"table0","properties":{"columns":[{"dataPath":"fact","header":"fact","id":"0ae2ae9e-0280-4389-83c6-1c5949f7e674","isHidden":false},{"dataPath":"length","header":"length","id":"c9048611-0196-4a00-9366-1ef9e3ec0408","isHidden":true},{"dataPath":"Due + Date","disableSortBy":false,"formatter":{"format":"LARGE_WITHOUT_TIME","type":"formatted_time"},"header":"Unused + Old Column","id":"8fa9284b-7a58-4f13-9959-57b7d8a7fe8f","isDeleted":true}],"data":"${fetchFacts?.outputs?.body?.data}","globalFilter":false,"isLoading":"${fetchFacts?.isLoading}","isScrollable":"vertical","isSubRowsEnabled":false,"isVisible":true,"isWrappable":false,"pageSize":"${pageSize?.value}","paginationType":"server_side","rowButtons":[],"summary":true,"totalCount":"${fetchFacts?.outputs?.body?.total}"},"type":"table"}],"isVisible":"true","layout":{"default":{"height":96,"width":12,"x":0,"y":5}}},"type":"gridCell"},{"events":[],"name":"gridCell1","properties":{"children":[{"events":[],"name":"text1","properties":{"content":"## + Random Fact\n\n${randomFact?.outputs?.fact}","contentType":"markdown","isVisible":true,"textAlign":"left","verticalAlign":"top"},"type":"text"}],"isVisible":"true","layout":{"default":{"height":16,"width":12,"x":0,"y":101}}},"type":"gridCell"},{"events":[],"name":"gridCell3","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value + + 1}","variableName":"pageSize"}],"name":"button0","properties":{"iconLeft":"angleUp","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Increase + Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":134}}},"type":"gridCell"},{"events":[],"name":"gridCell4","properties":{"children":[{"events":[{"name":"click","type":"setStateVariableValue","value":"${pageSize?.value + - 1}","variableName":"pageSize"}],"name":"button1","properties":{"iconLeft":"angleDown","iconRight":"","isBorderless":false,"isDisabled":false,"isLoading":false,"isPrimary":true,"isVisible":true,"label":"Decrease + Page Size","level":"default"},"type":"button"}],"isVisible":"true","layout":{"default":{"height":4,"width":2,"x":10,"y":138}}},"type":"gridCell"}]},"type":"grid"}],"description":"This + is a slightly complicated example app that fetches and displays cat facts","favorite":false,"name":"Updated + Name","queries":[{"id":"92ff0bb8-553b-4f31-87c7-ef5bd16d47d5","name":"fetchFacts","type":"action","properties":{"spec":{"connectionId":"5e63f4a8-4ce6-47de-ba11-f6617c1d54f3","fqn":"com.datadoghq.http.request","inputs":{"url":"https://catfact.ninja/facts","urlParams":[{"key":"limit","value":"${pageSize.value.toString()}"},{"key":"page","value":"${(table0.pageIndex + + 1).toString()}"}],"verb":"GET"}}}},{"id":"afd03c81-4075-4432-8618-ba09d52d2f2d","name":"pageSize","type":"stateVariable","properties":{"defaultValue":"${20}"}},{"id":"0fb22859-47dc-4137-9e41-7b67d04c525c","name":"randomFact","type":"dataTransform","properties":{"outputs":"${(() + =\u003e {const facts = fetchFacts.outputs.body.data\nreturn facts[Math.floor(Math.random()*facts.length)]\n})()}"}}],"rootInstanceName":"grid0","selfService":false,"tags":[]},"meta":{"org_id":1107852,"user_id":15479137,"user_uuid":"b3f98453-b289-11ef-a4e9-d6d283f92d91","user_name":"oliver.li@datadoghq.com","version":2,"updated_since_deployment":false,"created_at":"2025-02-14T16:45:06.054293Z","updated_at":"2025-02-14T16:45:06.268683Z","deleted_at":"0001-01-01T00:00:00Z"}}}' code: 200 duration: 0ms headers: @@ -49,9 +59,9 @@ interactions: - application/json id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/app-builder/apps/892d9225-fd31-4237-b218-e964ac33fc71 + url: https://api.datadoghq.com/api/v2/app-builder/apps/9f9a2053-6156-471b-aca8-2fa6ec87f797 response: - body: '{"data":{"id":"892d9225-fd31-4237-b218-e964ac33fc71","type":"appDefinitions"}}' + body: '{"data":{"id":"9f9a2053-6156-471b-aca8-2fa6ec87f797","type":"appDefinitions"}}' code: 200 duration: 0ms headers: diff --git a/tests/scenarios/features/v2/app_builder.feature b/tests/scenarios/features/v2/app_builder.feature index 1c8226e8970..1ef2502e807 100644 --- a/tests/scenarios/features/v2/app_builder.feature +++ b/tests/scenarios/features/v2/app_builder.feature @@ -12,8 +12,7 @@ Feature: App Builder @skip-typescript @team:DataDog/app-builder-backend Scenario: Create App returns "Bad Request" response - Given operation "CreateApp" enabled - And new "CreateApp" request + Given new "CreateApp" request And body with value {"data": {"attributes": {"description": "This is a bad example app", "queries": [], "rootInstanceName": "grid0"}, "type": "appDefinitions"}} When the request is sent Then the response status is 400 Bad Request @@ -22,41 +21,36 @@ Feature: App Builder @skip-typescript @team:DataDog/app-builder-backend Scenario: Create App returns "Created" response - Given operation "CreateApp" enabled - And new "CreateApp" request - And body with value {"data": {"attributes": {"components": [{"events": [], "name": "grid0", "properties": {"children": [{"events": [], "name": "gridCell0", "properties": {"children": [{"events": [], "name": "calloutValue0", "properties": {"isVisible": true, "isUnpublishd": false, "isLoading": false, "label": "CPU Usage", "size": "sm", "style": "vivid_yellow", "unit": "kB", "value": "42"}, "type": "calloutValue"}], "isVisible": "true", "layout": {"default": {"height": 8, "width": 2, "x": 0, "y": 0}}}, "type": "gridCell"}]}, "type": "grid"}], "description": "This is a simple example app", "queries": [], "name": "Example App", "rootInstanceName": "grid0"}, "type": "appDefinitions"}} + Given new "CreateApp" request + And body with value {"data":{"type":"appDefinitions","attributes":{"rootInstanceName":"grid0","components":[{"name":"grid0","type":"grid","properties":{"children":[{"type":"gridCell","name":"gridCell0","properties":{"children":[{"name":"text0","type":"text","properties":{"content":"# Cat Facts","contentType":"markdown","textAlign":"left","verticalAlign":"top","isVisible":true},"events":[]}],"isVisible":"true","layout":{"default":{"x":0,"y":0,"width":4,"height":5}}},"events":[]},{"type":"gridCell","name":"gridCell2","properties":{"children":[{"name":"table0","type":"table","properties":{"data":"${fetchFacts?.outputs?.body?.data}","columns":[{"dataPath":"fact","header":"fact","isHidden":false,"id":"0ae2ae9e-0280-4389-83c6-1c5949f7e674"},{"dataPath":"length","header":"length","isHidden":true,"id":"c9048611-0196-4a00-9366-1ef9e3ec0408"},{"id":"8fa9284b-7a58-4f13-9959-57b7d8a7fe8f","dataPath":"Due Date","header":"Unused Old Column","disableSortBy":false,"formatter":{"type":"formatted_time","format":"LARGE_WITHOUT_TIME"},"isDeleted":true}],"summary":true,"pageSize":"${pageSize?.value}","paginationType":"server_side","isLoading":"${fetchFacts?.isLoading}","rowButtons":[],"isWrappable":false,"isScrollable":"vertical","isSubRowsEnabled":false,"globalFilter":false,"isVisible":true,"totalCount":"${fetchFacts?.outputs?.body?.total}"},"events":[]}],"isVisible":"true","layout":{"default":{"x":0,"y":5,"width":12,"height":96}}},"events":[]},{"type":"gridCell","name":"gridCell1","properties":{"children":[{"name":"text1","type":"text","properties":{"content":"## Random Fact\n\n${randomFact?.outputs?.fact}","contentType":"markdown","textAlign":"left","verticalAlign":"top","isVisible":true},"events":[]}],"isVisible":"true","layout":{"default":{"x":0,"y":101,"width":12,"height":16}}},"events":[]},{"type":"gridCell","name":"gridCell3","properties":{"children":[{"name":"button0","type":"button","properties":{"label":"Increase Page Size","level":"default","isPrimary":true,"isBorderless":false,"isLoading":false,"isDisabled":false,"isVisible":true,"iconLeft":"angleUp","iconRight":""},"events":[{"variableName":"pageSize","value":"${pageSize?.value + 1}","name":"click","type":"setStateVariableValue"}]}],"isVisible":"true","layout":{"default":{"x":10,"y":134,"width":2,"height":4}}},"events":[]},{"type":"gridCell","name":"gridCell4","properties":{"children":[{"name":"button1","type":"button","properties":{"label":"Decrease Page Size","level":"default","isPrimary":true,"isBorderless":false,"isLoading":false,"isDisabled":false,"isVisible":true,"iconLeft":"angleDown","iconRight":""},"events":[{"variableName":"pageSize","value":"${pageSize?.value - 1}","name":"click","type":"setStateVariableValue"}]}],"isVisible":"true","layout":{"default":{"x":10,"y":138,"width":2,"height":4}}},"events":[]}],"backgroundColor":"default"},"events":[]}],"queries":[{"id":"92ff0bb8-553b-4f31-87c7-ef5bd16d47d5","type":"action","name":"fetchFacts","events":[],"properties":{"spec":{"fqn":"com.datadoghq.http.request","connectionId":"5e63f4a8-4ce6-47de-ba11-f6617c1d54f3","inputs":{"verb":"GET","url":"https://catfact.ninja/facts","urlParams":[{"key":"limit","value":"${pageSize.value.toString()}"},{"key":"page","value":"${(table0.pageIndex + 1).toString()}"}]}}}},{"type":"stateVariable","name":"pageSize","properties":{"defaultValue":"${20}"},"id":"afd03c81-4075-4432-8618-ba09d52d2f2d"},{"type":"dataTransform","name":"randomFact","properties":{"outputs":"${(() => {const facts = fetchFacts.outputs.body.data\nreturn facts[Math.floor(Math.random()*facts.length)]\n})()}"},"id":"0fb22859-47dc-4137-9e41-7b67d04c525c"}],"name":"Example Cat Facts Viewer","description":"This is a slightly complicated example app that fetches and displays cat facts"}}} When the request is sent Then the response status is 201 Created And the response "data.type" is equal to "appDefinitions" @skip @team:DataDog/app-builder-backend Scenario: Delete App returns "Bad Request" response - Given operation "DeleteApp" enabled - And new "DeleteApp" request + Given new "DeleteApp" request And request contains "app_id" parameter with value "bad-app-id" When the request is sent Then the response status is 400 Bad Request @skip @team:DataDog/app-builder-backend Scenario: Delete App returns "Gone" response - Given operation "DeleteApp" enabled - And new "DeleteApp" request + Given new "DeleteApp" request And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" When the request is sent Then the response status is 410 Gone @skip-typescript @team:DataDog/app-builder-backend Scenario: Delete App returns "Not Found" response - Given operation "DeleteApp" enabled - And new "DeleteApp" request + Given new "DeleteApp" request And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" When the request is sent Then the response status is 404 Not Found @skip-typescript @team:DataDog/app-builder-backend Scenario: Delete App returns "OK" response - Given operation "DeleteApp" enabled - And there is a valid "app" in the system + Given there is a valid "app" in the system And new "DeleteApp" request And request contains "app_id" parameter from "app.data.id" When the request is sent @@ -66,24 +60,21 @@ Feature: App Builder @generated @skip @team:DataDog/app-builder-backend Scenario: Delete Multiple Apps returns "Bad Request" response - Given operation "DeleteApps" enabled - And new "DeleteApps" request + Given new "DeleteApps" request And body with value {"data": [{"id": "aea2ed17-b45f-40d0-ba59-c86b7972c901", "type": "appDefinitions"}, {"id": "f69bb8be-6168-4fe7-a30d-370256b6504a", "type": "appDefinitions"}, {"id": "ab1ed73e-13ad-4426-b0df-a0ff8876a088", "type": "appDefinitions"}]} When the request is sent Then the response status is 400 Bad Request @skip-typescript @team:DataDog/app-builder-backend Scenario: Delete Multiple Apps returns "Not Found" response - Given operation "DeleteApps" enabled - And new "DeleteApps" request + Given new "DeleteApps" request And body with value {"data": [{"id": "aea2ed17-b45f-40d0-ba59-c86b7972c901", "type": "appDefinitions"}, {"id": "f69bb8be-6168-4fe7-a30d-370256b6504a", "type": "appDefinitions"}, {"id": "ab1ed73e-13ad-4426-b0df-a0ff8876a088", "type": "appDefinitions"}]} When the request is sent Then the response status is 404 Not Found @skip-typescript @team:DataDog/app-builder-backend Scenario: Delete Multiple Apps returns "OK" response - Given operation "DeleteApps" enabled - And new "DeleteApps" request + Given new "DeleteApps" request And there is a valid "app" in the system And body with value {"data": [{"id": "{{ app.data.id }}", "type": "appDefinitions"}]} When the request is sent @@ -93,24 +84,30 @@ Feature: App Builder @skip @team:DataDog/app-builder-backend Scenario: Get App returns "Bad Request" response - Given operation "GetApp" enabled - And new "GetApp" request + Given new "GetApp" request And request contains "app_id" parameter with value "invalid-uuid" When the request is sent Then the response status is 400 Bad Request + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Get App returns "Gone" response + Given new "GetApp" request + And there is a valid "app" in the system + And request contains "app_id" parameter from "app.data.id" + And request contains "version" parameter with value "31" + When the request is sent + Then the response status is 410 Gone + @skip-typescript @team:DataDog/app-builder-backend Scenario: Get App returns "Not Found" response - Given operation "GetApp" enabled - And new "GetApp" request + Given new "GetApp" request And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" When the request is sent Then the response status is 404 Not Found @skip-typescript @team:DataDog/app-builder-backend Scenario: Get App returns "OK" response - Given operation "GetApp" enabled - And new "GetApp" request + Given new "GetApp" request And there is a valid "app" in the system And request contains "app_id" parameter from "app.data.id" When the request is sent @@ -120,30 +117,26 @@ Feature: App Builder @generated @skip @team:DataDog/app-builder-backend Scenario: List Apps returns "Bad Request" response - Given operation "ListApps" enabled - And new "ListApps" request + Given new "ListApps" request When the request is sent Then the response status is 400 Bad Request @skip-typescript @team:DataDog/app-builder-backend Scenario: List Apps returns "OK" response - Given operation "ListApps" enabled - And new "ListApps" request + Given new "ListApps" request When the request is sent Then the response status is 200 OK @skip @team:DataDog/app-builder-backend Scenario: Publish App returns "Bad Request" response - Given operation "PublishApp" enabled - And new "PublishApp" request + Given new "PublishApp" request And request contains "app_id" parameter with value "invalid-uuid" When the request is sent Then the response status is 400 Bad Request @skip-typescript @team:DataDog/app-builder-backend Scenario: Publish App returns "Created" response - Given operation "PublishApp" enabled - And new "PublishApp" request + Given new "PublishApp" request And there is a valid "app" in the system And request contains "app_id" parameter from "app.data.id" When the request is sent @@ -151,32 +144,28 @@ Feature: App Builder @skip-typescript @team:DataDog/app-builder-backend Scenario: Publish App returns "Not Found" response - Given operation "PublishApp" enabled - And new "PublishApp" request + Given new "PublishApp" request And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" When the request is sent Then the response status is 404 Not Found @skip @team:DataDog/app-builder-backend Scenario: Unpublish App returns "Bad Request" response - Given operation "UnpublishApp" enabled - And new "UnpublishApp" request + Given new "UnpublishApp" request And request contains "app_id" parameter with value "invalid-uuid" When the request is sent Then the response status is 400 Bad Request @skip-typescript @team:DataDog/app-builder-backend Scenario: Unpublish App returns "Not Found" response - Given operation "UnpublishApp" enabled - And new "UnpublishApp" request + Given new "UnpublishApp" request And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" When the request is sent Then the response status is 404 Not Found @skip-typescript @team:DataDog/app-builder-backend Scenario: Unpublish App returns "OK" response - Given operation "UnpublishApp" enabled - And new "UnpublishApp" request + Given new "UnpublishApp" request And there is a valid "app" in the system And request contains "app_id" parameter from "app.data.id" When the request is sent @@ -184,8 +173,7 @@ Feature: App Builder @skip-typescript @team:DataDog/app-builder-backend Scenario: Update App returns "Bad Request" response - Given operation "UpdateApp" enabled - And new "UpdateApp" request + Given new "UpdateApp" request And there is a valid "app" in the system And request contains "app_id" parameter from "app.data.id" And body with value {"data": {"attributes": {"rootInstanceName": ""}, "id": "{{ app.data.id }}", "type": "appDefinitions"}} @@ -196,8 +184,7 @@ Feature: App Builder @skip-typescript @team:DataDog/app-builder-backend Scenario: Update App returns "OK" response - Given operation "UpdateApp" enabled - And new "UpdateApp" request + Given new "UpdateApp" request And there is a valid "app" in the system And request contains "app_id" parameter from "app.data.id" And body with value {"data": {"attributes": {"name": "Updated Name", "rootInstanceName": "grid0"}, "id": "{{ app.data.id }}", "type": "appDefinitions"}} diff --git a/tests/scenarios/features/v2/given.json b/tests/scenarios/features/v2/given.json index 57348eb2af3..b3c27699e52 100644 --- a/tests/scenarios/features/v2/given.json +++ b/tests/scenarios/features/v2/given.json @@ -63,7 +63,7 @@ "parameters": [ { "name": "body", - "value": "{\"data\": {\"attributes\": {\"components\": [{\"events\": [], \"name\": \"grid0\", \"properties\": {\"children\": [{\"events\": [], \"name\": \"gridCell0\", \"properties\": {\"children\": [{\"events\": [], \"name\": \"calloutValue0\", \"properties\": {\"isDisabled\": false, \"isLoading\": false, \"isVisible\": true, \"label\": \"CPU Usage\", \"size\": \"sm\", \"style\": \"vivid_yellow\", \"unit\": \"kB\", \"value\": \"42\"}, \"type\": \"calloutValue\"}], \"isVisible\": \"true\", \"layout\": {\"default\": {\"height\": 8, \"width\": 2, \"x\": 0, \"y\": 0}}}, \"type\": \"gridCell\"}]}, \"type\": \"grid\"}], \"description\": \"This is a simple example app\", \"queries\": [], \"name\": \"Example App\", \"rootInstanceName\": \"grid0\"}, \"type\": \"appDefinitions\"}}" + "value": "{\"data\":{\"type\":\"appDefinitions\",\"attributes\":{\"rootInstanceName\":\"grid0\",\"components\":[{\"name\":\"grid0\",\"type\":\"grid\",\"properties\":{\"children\":[{\"type\":\"gridCell\",\"name\":\"gridCell0\",\"properties\":{\"children\":[{\"name\":\"text0\",\"type\":\"text\",\"properties\":{\"content\":\"# Cat Facts\",\"contentType\":\"markdown\",\"textAlign\":\"left\",\"verticalAlign\":\"top\",\"isVisible\":true},\"events\":[]}],\"isVisible\":\"true\",\"layout\":{\"default\":{\"x\":0,\"y\":0,\"width\":4,\"height\":5}}},\"events\":[]},{\"type\":\"gridCell\",\"name\":\"gridCell2\",\"properties\":{\"children\":[{\"name\":\"table0\",\"type\":\"table\",\"properties\":{\"data\":\"${fetchFacts?.outputs?.body?.data}\",\"columns\":[{\"dataPath\":\"fact\",\"header\":\"fact\",\"isHidden\":false,\"id\":\"0ae2ae9e-0280-4389-83c6-1c5949f7e674\"},{\"dataPath\":\"length\",\"header\":\"length\",\"isHidden\":true,\"id\":\"c9048611-0196-4a00-9366-1ef9e3ec0408\"},{\"id\":\"8fa9284b-7a58-4f13-9959-57b7d8a7fe8f\",\"dataPath\":\"Due Date\",\"header\":\"Unused Old Column\",\"disableSortBy\":false,\"formatter\":{\"type\":\"formatted_time\",\"format\":\"LARGE_WITHOUT_TIME\"},\"isDeleted\":true}],\"summary\":true,\"pageSize\":\"${pageSize?.value}\",\"paginationType\":\"server_side\",\"isLoading\":\"${fetchFacts?.isLoading}\",\"rowButtons\":[],\"isWrappable\":false,\"isScrollable\":\"vertical\",\"isSubRowsEnabled\":false,\"globalFilter\":false,\"isVisible\":true,\"totalCount\":\"${fetchFacts?.outputs?.body?.total}\"},\"events\":[]}],\"isVisible\":\"true\",\"layout\":{\"default\":{\"x\":0,\"y\":5,\"width\":12,\"height\":96}}},\"events\":[]},{\"type\":\"gridCell\",\"name\":\"gridCell1\",\"properties\":{\"children\":[{\"name\":\"text1\",\"type\":\"text\",\"properties\":{\"content\":\"## Random Fact\\n\\n${randomFact?.outputs?.fact}\",\"contentType\":\"markdown\",\"textAlign\":\"left\",\"verticalAlign\":\"top\",\"isVisible\":true},\"events\":[]}],\"isVisible\":\"true\",\"layout\":{\"default\":{\"x\":0,\"y\":101,\"width\":12,\"height\":16}}},\"events\":[]},{\"type\":\"gridCell\",\"name\":\"gridCell3\",\"properties\":{\"children\":[{\"name\":\"button0\",\"type\":\"button\",\"properties\":{\"label\":\"Increase Page Size\",\"level\":\"default\",\"isPrimary\":true,\"isBorderless\":false,\"isLoading\":false,\"isDisabled\":false,\"isVisible\":true,\"iconLeft\":\"angleUp\",\"iconRight\":\"\"},\"events\":[{\"variableName\":\"pageSize\",\"value\":\"${pageSize?.value + 1}\",\"name\":\"click\",\"type\":\"setStateVariableValue\"}]}],\"isVisible\":\"true\",\"layout\":{\"default\":{\"x\":10,\"y\":134,\"width\":2,\"height\":4}}},\"events\":[]},{\"type\":\"gridCell\",\"name\":\"gridCell4\",\"properties\":{\"children\":[{\"name\":\"button1\",\"type\":\"button\",\"properties\":{\"label\":\"Decrease Page Size\",\"level\":\"default\",\"isPrimary\":true,\"isBorderless\":false,\"isLoading\":false,\"isDisabled\":false,\"isVisible\":true,\"iconLeft\":\"angleDown\",\"iconRight\":\"\"},\"events\":[{\"variableName\":\"pageSize\",\"value\":\"${pageSize?.value - 1}\",\"name\":\"click\",\"type\":\"setStateVariableValue\"}]}],\"isVisible\":\"true\",\"layout\":{\"default\":{\"x\":10,\"y\":138,\"width\":2,\"height\":4}}},\"events\":[]}],\"backgroundColor\":\"default\"},\"events\":[]}],\"queries\":[{\"id\":\"92ff0bb8-553b-4f31-87c7-ef5bd16d47d5\",\"type\":\"action\",\"name\":\"fetchFacts\",\"events\":[],\"properties\":{\"spec\":{\"fqn\":\"com.datadoghq.http.request\",\"connectionId\":\"5e63f4a8-4ce6-47de-ba11-f6617c1d54f3\",\"inputs\":{\"verb\":\"GET\",\"url\":\"https://catfact.ninja/facts\",\"urlParams\":[{\"key\":\"limit\",\"value\":\"${pageSize.value.toString()}\"},{\"key\":\"page\",\"value\":\"${(table0.pageIndex + 1).toString()}\"}]}}}},{\"type\":\"stateVariable\",\"name\":\"pageSize\",\"properties\":{\"defaultValue\":\"${20}\"},\"id\":\"afd03c81-4075-4432-8618-ba09d52d2f2d\"},{\"type\":\"dataTransform\",\"name\":\"randomFact\",\"properties\":{\"outputs\":\"${(() => {const facts = fetchFacts.outputs.body.data\\nreturn facts[Math.floor(Math.random()*facts.length)]\\n})()}\"},\"id\":\"0fb22859-47dc-4137-9e41-7b67d04c525c\"}],\"name\":\"Example Cat Facts Viewer\",\"description\":\"This is a slightly complicated example app that fetches and displays cat facts\"}}}" } ], "step": "there is a valid \"app\" in the system",