diff --git a/.generated-info b/.generated-info index 3bdd0a80530..88e0363cc37 100644 --- a/.generated-info +++ b/.generated-info @@ -1,4 +1,4 @@ { - "spec_repo_commit": "62a19e4", - "generated": "2025-08-27 15:01:20.504" + "spec_repo_commit": "6d9663b", + "generated": "2025-08-27 16:37:46.678" } diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 2e3684fae4b..65023140126 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -24164,6 +24164,9 @@ components: additionalProperties: false description: Wrapper for live span properties: + hide_incomplete_cost_data: + description: Whether to hide incomplete cost data in the widget. + type: boolean live_span: $ref: '#/components/schemas/WidgetLiveSpan' type: object @@ -24364,6 +24367,9 @@ components: format: int64 minimum: 0 type: integer + hide_incomplete_cost_data: + description: Whether to hide incomplete cost data in the widget. + type: boolean to: description: End time in seconds since epoch. example: 1712083128 @@ -24388,6 +24394,9 @@ components: WidgetNewLiveSpan: description: Used for arbitrary live span times, such as 17 minutes or 6 hours. properties: + hide_incomplete_cost_data: + description: Whether to hide incomplete cost data in the widget. + type: boolean type: $ref: '#/components/schemas/WidgetNewLiveSpanType' unit: diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e09c9480479..19e228a115b 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -14485,6 +14485,10 @@ components: description: Entity definition in raw JSON or YAML representation. example: "apiVersion: v3\nkind: service\nmetadata:\n name: myservice\n" type: string + EntityReference: + description: The unique reference for an IDP entity. + example: service:my-service + type: string EntityRelationships: description: Entity relationships. properties: @@ -34444,6 +34448,8 @@ components: description: If enabled, the rule is calculated as part of the score. example: true type: boolean + level: + $ref: '#/components/schemas/RuleLevel' modified_at: description: Time of the last rule outcome modification. format: date-time @@ -34464,6 +34470,13 @@ components: description: The unique ID for a scorecard rule. example: q8MQxk8TCqrHnWkx type: string + RuleLevel: + description: The maturity level of the rule (1, 2, or 3). + example: 2 + format: int32 + maximum: 3 + minimum: 1 + type: integer RuleName: description: Name of the notification rule. example: Rule 1 @@ -43835,6 +43848,57 @@ components: id: $ref: '#/components/schemas/ApiID' type: object + UpdateOutcomesAsyncAttributes: + description: The JSON:API attributes for a batched set of scorecard outcomes. + properties: + results: + description: Set of scorecard outcomes to update asynchronously. + items: + $ref: '#/components/schemas/UpdateOutcomesAsyncRequestItem' + type: array + type: object + UpdateOutcomesAsyncRequest: + description: Scorecard outcomes batch request. + properties: + data: + $ref: '#/components/schemas/UpdateOutcomesAsyncRequestData' + type: object + UpdateOutcomesAsyncRequestData: + description: Scorecard outcomes batch request data. + properties: + attributes: + $ref: '#/components/schemas/UpdateOutcomesAsyncAttributes' + type: + $ref: '#/components/schemas/UpdateOutcomesAsyncType' + type: object + UpdateOutcomesAsyncRequestItem: + description: Scorecard outcome for a single entity and rule. + properties: + entity_reference: + $ref: '#/components/schemas/EntityReference' + remarks: + description: Any remarks regarding the scorecard rule's evaluation. Supports + HTML hyperlinks. + example: 'See: Services' + type: string + rule_id: + $ref: '#/components/schemas/RuleId' + state: + $ref: '#/components/schemas/State' + required: + - rule_id + - entity_reference + - state + type: object + UpdateOutcomesAsyncType: + default: batched-outcome + description: The JSON:API type for scorecard outcomes. + enum: + - batched-outcome + example: batched-outcome + type: string + x-enum-varnames: + - BATCHED_OUTCOME UpdateResourceEvaluationFiltersRequest: description: Request object to update a resource filter. properties: @@ -61882,6 +61946,39 @@ paths: resultsPath: data x-unstable: '**Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Updates multiple scorecard rule outcomes in a single batched request. + operationId: UpdateScorecardOutcomesAsync + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateOutcomesAsyncRequest' + description: Set of scorecard outcomes. + required: true + responses: + '202': + description: Accepted + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '409': + $ref: '#/components/responses/ConflictResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_write + summary: Update Scorecard outcomes asynchronously + tags: + - Service Scorecards + x-codegen-request-body-name: body + x-unstable: '**Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/scorecard/outcomes/batch: post: diff --git a/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-legacy-live-span-time-format.frozen b/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-legacy-live-span-time-format.frozen index c8e222ab205..6cbda14f174 100644 --- a/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-legacy-live-span-time-format.frozen +++ b/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-legacy-live-span-time-format.frozen @@ -1 +1 @@ -2024-11-15T19:33:02.539Z \ No newline at end of file +2025-08-26T19:47:58.449Z \ No newline at end of file diff --git a/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-legacy-live-span-time-format.yml b/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-legacy-live-span-time-format.yml index 232041e26f5..0d451b99878 100644 --- a/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-legacy-live-span-time-format.yml +++ b/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-legacy-live-span-time-format.yml @@ -1,10 +1,10 @@ http_interactions: -- recorded_at: Fri, 15 Nov 2024 19:33:02 GMT +- recorded_at: Tue, 26 Aug 2025 19:47:58 GMT request: body: encoding: UTF-8 - string: '{"layout_type":"ordered","reflow_type":"auto","title":"Test-Create_a_new_timeseries_widget_with_legacy_live_span_time_format-1731699182 - with legacy live span time","widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"live_span":"5m"},"title":"","type":"timeseries"}}]}' + string: '{"layout_type":"ordered","reflow_type":"auto","title":"Test-Create_a_new_timeseries_widget_with_legacy_live_span_time_format-1756237678 + with legacy live span time","widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"hide_incomplete_cost_data":true,"live_span":"5m"},"title":"","type":"timeseries"}}]}' headers: Accept: - application/json @@ -15,28 +15,27 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"id":"3zr-n9a-dfd","title":"Test-Create_a_new_timeseries_widget_with_legacy_live_span_time_format-1731699182 - with legacy live span time","description":null,"author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/3zr-n9a-dfd/test-createanewtimeserieswidgetwithlegacylivespantimeformat-1731699182-with-lega","is_read_only":false,"template_variables":null,"widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"live_span":"5m"},"title":"","type":"timeseries"},"id":5376392318113781}],"notify_list":null,"created_at":"2024-11-15T19:33:02.697929+00:00","modified_at":"2024-11-15T19:33:02.697929+00:00","reflow_type":"auto","restricted_roles":[]} - - ' + string: '{"id":"wek-eci-qnn","title":"Test-Create_a_new_timeseries_widget_with_legacy_live_span_time_format-1756237678 + with legacy live span time","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI + Account","layout_type":"ordered","url":"/dashboard/wek-eci-qnn/test-createanewtimeserieswidgetwithlegacylivespantimeformat-1756237678-with-lega","template_variables":null,"widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"hide_incomplete_cost_data":true,"live_span":"5m"},"title":"","type":"timeseries"},"id":3088384387119347}],"notify_list":null,"created_at":"2025-08-26T19:47:58.616519+00:00","modified_at":"2025-08-26T19:47:58.616519+00:00","reflow_type":"auto","restricted_roles":[]}' headers: Content-Type: - application/json status: code: 200 message: OK -- recorded_at: Fri, 15 Nov 2024 19:33:02 GMT +- recorded_at: Tue, 26 Aug 2025 19:47:58 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/dashboard/3zr-n9a-dfd + uri: https://api.datadoghq.com/api/v1/dashboard/wek-eci-qnn response: body: encoding: UTF-8 - string: '{"deleted_dashboard_id":"3zr-n9a-dfd"} + string: '{"deleted_dashboard_id":"wek-eci-qnn"} ' headers: diff --git a/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-new-fixed-span-time-format.frozen b/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-new-fixed-span-time-format.frozen index 740efedb273..954a9588437 100644 --- a/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-new-fixed-span-time-format.frozen +++ b/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-new-fixed-span-time-format.frozen @@ -1 +1 @@ -2024-11-15T19:33:02.942Z \ No newline at end of file +2025-08-26T19:47:58.908Z \ No newline at end of file diff --git a/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-new-fixed-span-time-format.yml b/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-new-fixed-span-time-format.yml index 86d2ff9b760..c481ff4072f 100644 --- a/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-new-fixed-span-time-format.yml +++ b/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-new-fixed-span-time-format.yml @@ -1,10 +1,10 @@ http_interactions: -- recorded_at: Fri, 15 Nov 2024 19:33:02 GMT +- recorded_at: Tue, 26 Aug 2025 19:47:58 GMT request: body: encoding: UTF-8 - string: '{"layout_type":"ordered","reflow_type":"auto","title":"Test-Create_a_new_timeseries_widget_with_new_fixed_span_time_format-1731699182 - with new fixed span time","widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"from":1712080128,"to":1712083128,"type":"fixed"},"title":"","type":"timeseries"}}]}' + string: '{"layout_type":"ordered","reflow_type":"auto","title":"Test-Create_a_new_timeseries_widget_with_new_fixed_span_time_format-1756237678 + with new fixed span time","widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"from":1712080128,"hide_incomplete_cost_data":true,"to":1712083128,"type":"fixed"},"title":"","type":"timeseries"}}]}' headers: Accept: - application/json @@ -15,28 +15,27 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"id":"xfq-c2m-cqi","title":"Test-Create_a_new_timeseries_widget_with_new_fixed_span_time_format-1731699182 - with new fixed span time","description":null,"author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/xfq-c2m-cqi/test-createanewtimeserieswidgetwithnewfixedspantimeformat-1731699182-with-new-fi","is_read_only":false,"template_variables":null,"widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"from":1712080128,"to":1712083128,"type":"fixed"},"title":"","type":"timeseries"},"id":7353899445937131}],"notify_list":null,"created_at":"2024-11-15T19:33:03.107998+00:00","modified_at":"2024-11-15T19:33:03.107998+00:00","reflow_type":"auto","restricted_roles":[]} - - ' + string: '{"id":"43b-7uw-9hv","title":"Test-Create_a_new_timeseries_widget_with_new_fixed_span_time_format-1756237678 + with new fixed span time","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI + Account","layout_type":"ordered","url":"/dashboard/43b-7uw-9hv/test-createanewtimeserieswidgetwithnewfixedspantimeformat-1756237678-with-new-fi","template_variables":null,"widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"from":1712080128,"hide_incomplete_cost_data":true,"to":1712083128,"type":"fixed"},"title":"","type":"timeseries"},"id":7908755715912813}],"notify_list":null,"created_at":"2025-08-26T19:47:59.063106+00:00","modified_at":"2025-08-26T19:47:59.063106+00:00","reflow_type":"auto","restricted_roles":[]}' headers: Content-Type: - application/json status: code: 200 message: OK -- recorded_at: Fri, 15 Nov 2024 19:33:02 GMT +- recorded_at: Tue, 26 Aug 2025 19:47:58 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/dashboard/xfq-c2m-cqi + uri: https://api.datadoghq.com/api/v1/dashboard/43b-7uw-9hv response: body: encoding: UTF-8 - string: '{"deleted_dashboard_id":"xfq-c2m-cqi"} + string: '{"deleted_dashboard_id":"43b-7uw-9hv"} ' headers: diff --git a/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-new-live-span-time-format.frozen b/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-new-live-span-time-format.frozen index b05fa906e0e..b4d5164c57a 100644 --- a/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-new-live-span-time-format.frozen +++ b/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-new-live-span-time-format.frozen @@ -1 +1 @@ -2024-11-15T19:33:03.421Z \ No newline at end of file +2025-08-26T19:47:59.336Z \ No newline at end of file diff --git a/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-new-live-span-time-format.yml b/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-new-live-span-time-format.yml index b4f4abc1e32..be584d1a39c 100644 --- a/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-new-live-span-time-format.yml +++ b/cassettes/features/v1/dashboards/Create-a-new-timeseries-widget-with-new-live-span-time-format.yml @@ -1,10 +1,10 @@ http_interactions: -- recorded_at: Fri, 15 Nov 2024 19:33:03 GMT +- recorded_at: Tue, 26 Aug 2025 19:47:59 GMT request: body: encoding: UTF-8 - string: '{"layout_type":"ordered","reflow_type":"auto","title":"Test-Create_a_new_timeseries_widget_with_new_live_span_time_format-1731699183 - with new live span time","widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"type":"live","unit":"minute","value":8},"title":"","type":"timeseries"}}]}' + string: '{"layout_type":"ordered","reflow_type":"auto","title":"Test-Create_a_new_timeseries_widget_with_new_live_span_time_format-1756237679 + with new live span time","widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"hide_incomplete_cost_data":true,"type":"live","unit":"minute","value":8},"title":"","type":"timeseries"}}]}' headers: Accept: - application/json @@ -15,28 +15,27 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"id":"vtq-7wk-ezs","title":"Test-Create_a_new_timeseries_widget_with_new_live_span_time_format-1731699183 - with new live span time","description":null,"author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/vtq-7wk-ezs/test-createanewtimeserieswidgetwithnewlivespantimeformat-1731699183-with-new-liv","is_read_only":false,"template_variables":null,"widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"type":"live","unit":"minute","value":8},"title":"","type":"timeseries"},"id":5791200763250393}],"notify_list":null,"created_at":"2024-11-15T19:33:03.610036+00:00","modified_at":"2024-11-15T19:33:03.610036+00:00","reflow_type":"auto","restricted_roles":[]} - - ' + string: '{"id":"gwt-rfa-qem","title":"Test-Create_a_new_timeseries_widget_with_new_live_span_time_format-1756237679 + with new live span time","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI + Account","layout_type":"ordered","url":"/dashboard/gwt-rfa-qem/test-createanewtimeserieswidgetwithnewlivespantimeformat-1756237679-with-new-liv","template_variables":null,"widgets":[{"definition":{"legend_columns":["avg","min","max","value","sum"],"legend_layout":"auto","requests":[{"display_type":"line","formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count","metric":"@ci.queue_time"},"data_source":"ci_pipelines","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"ci_level:job"}}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"show_legend":true,"time":{"hide_incomplete_cost_data":true,"type":"live","unit":"minute","value":8},"title":"","type":"timeseries"},"id":6382558947547501}],"notify_list":null,"created_at":"2025-08-26T19:47:59.501406+00:00","modified_at":"2025-08-26T19:47:59.501406+00:00","reflow_type":"auto","restricted_roles":[]}' headers: Content-Type: - application/json status: code: 200 message: OK -- recorded_at: Fri, 15 Nov 2024 19:33:03 GMT +- recorded_at: Tue, 26 Aug 2025 19:47:59 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/dashboard/vtq-7wk-ezs + uri: https://api.datadoghq.com/api/v1/dashboard/gwt-rfa-qem response: body: encoding: UTF-8 - string: '{"deleted_dashboard_id":"vtq-7wk-ezs"} + string: '{"deleted_dashboard_id":"gwt-rfa-qem"} ' headers: diff --git a/cassettes/features/v2/service_scorecards/Create-a-new-rule-returns-Bad-Request-response.frozen b/cassettes/features/v2/service_scorecards/Create-a-new-rule-returns-Bad-Request-response.frozen new file mode 100644 index 00000000000..5d0a1ab6548 --- /dev/null +++ b/cassettes/features/v2/service_scorecards/Create-a-new-rule-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-08-26T15:48:59.496Z \ No newline at end of file diff --git a/cassettes/features/v2/service_scorecards/Create-a-new-rule-returns-Bad-Request-response.yml b/cassettes/features/v2/service_scorecards/Create-a-new-rule-returns-Bad-Request-response.yml new file mode 100644 index 00000000000..121fddeccc7 --- /dev/null +++ b/cassettes/features/v2/service_scorecards/Create-a-new-rule-returns-Bad-Request-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Tue, 26 Aug 2025 15:48:59 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"enabled":true,"level":2,"name":"Team Defined","scorecard_id":"NOT.FOUND"},"type":"rule"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/scorecard/rules + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"scorecard_id\" failed scorecard lookup"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/service_scorecards/Update-Scorecard-outcomes-asynchronously-returns-Accepted-response.frozen b/cassettes/features/v2/service_scorecards/Update-Scorecard-outcomes-asynchronously-returns-Accepted-response.frozen new file mode 100644 index 00000000000..90ae34fee25 --- /dev/null +++ b/cassettes/features/v2/service_scorecards/Update-Scorecard-outcomes-asynchronously-returns-Accepted-response.frozen @@ -0,0 +1 @@ +2025-08-26T14:46:17.790Z \ No newline at end of file diff --git a/cassettes/features/v2/service_scorecards/Update-Scorecard-outcomes-asynchronously-returns-Accepted-response.yml b/cassettes/features/v2/service_scorecards/Update-Scorecard-outcomes-asynchronously-returns-Accepted-response.yml new file mode 100644 index 00000000000..2bc0b21b1b5 --- /dev/null +++ b/cassettes/features/v2/service_scorecards/Update-Scorecard-outcomes-asynchronously-returns-Accepted-response.yml @@ -0,0 +1,66 @@ +http_interactions: +- recorded_at: Tue, 26 Aug 2025 14:46:17 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"enabled":true,"name":"Test-Update_Scorecard_outcomes_asynchronously_returns_Accepted_response-1756219577","owner":"Datadog","scorecard_name":"OpenAPI + Spec Test Best Practices"},"type":"rule"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/scorecard/rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"5e3dexz6x_4f_4pa","type":"rule","attributes":{"category":"OpenAPI + Spec Test Best Practices","created_at":"2025-08-26T14:46:18.889883535Z","custom":true,"enabled":true,"level":3,"modified_at":"2025-08-26T14:46:18.889883535Z","name":"Test-Update_Scorecard_outcomes_asynchronously_returns_Accepted_response-1756219577","owner":"Datadog","scorecard_name":"OpenAPI + Spec Test Best Practices"},"relationships":{"scorecard":{"data":{"id":"qsxpoYRhU_yz","type":"scorecard"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 26 Aug 2025 14:46:17 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"results":[{"entity_reference":"service:my-service","remarks":"See: + Services","rule_id":"5e3dexz6x_4f_4pa","state":"pass"}]},"type":"batched-outcome"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/scorecard/outcomes + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"4iexte5r8prsrlrtzzxpy","type":"async-request"},"meta":{"total_received":1}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 202 + message: Accepted +- recorded_at: Tue, 26 Aug 2025 14:46:17 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/scorecard/rules/5e3dexz6x_4f_4pa + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/service_scorecards/Update-Scorecard-outcomes-asynchronously-returns-Bad-Request-response.frozen b/cassettes/features/v2/service_scorecards/Update-Scorecard-outcomes-asynchronously-returns-Bad-Request-response.frozen new file mode 100644 index 00000000000..b743ee81bce --- /dev/null +++ b/cassettes/features/v2/service_scorecards/Update-Scorecard-outcomes-asynchronously-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-08-26T14:46:19.541Z \ No newline at end of file diff --git a/cassettes/features/v2/service_scorecards/Update-Scorecard-outcomes-asynchronously-returns-Bad-Request-response.yml b/cassettes/features/v2/service_scorecards/Update-Scorecard-outcomes-asynchronously-returns-Bad-Request-response.yml new file mode 100644 index 00000000000..4091eb5cee0 --- /dev/null +++ b/cassettes/features/v2/service_scorecards/Update-Scorecard-outcomes-asynchronously-returns-Bad-Request-response.yml @@ -0,0 +1,66 @@ +http_interactions: +- recorded_at: Tue, 26 Aug 2025 14:46:19 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"enabled":true,"name":"Test-Update_Scorecard_outcomes_asynchronously_returns_Bad_Request_response-1756219579","owner":"Datadog","scorecard_name":"OpenAPI + Spec Test Best Practices"},"type":"rule"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/scorecard/rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"cyysw9dtqcu8zemc","type":"rule","attributes":{"category":"OpenAPI + Spec Test Best Practices","created_at":"2025-08-26T14:46:19.594805953Z","custom":true,"enabled":true,"level":3,"modified_at":"2025-08-26T14:46:19.594805953Z","name":"Test-Update_Scorecard_outcomes_asynchronously_returns_Bad_Request_response-1756219579","owner":"Datadog","scorecard_name":"OpenAPI + Spec Test Best Practices"},"relationships":{"scorecard":{"data":{"id":"qsxpoYRhU_yz","type":"scorecard"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 26 Aug 2025 14:46:19 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"results":[{"entity_reference":"service:my-service","rule_id":"cyysw9dtqcu8zemc","state":"INVALID"}]},"type":"batched-outcome"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/scorecard/outcomes + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"state\" must be one of \"pass fail skip\""}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +- recorded_at: Tue, 26 Aug 2025 14:46:19 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/scorecard/rules/cyysw9dtqcu8zemc + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/service_scorecards/Update-Scorecard-outcomes-asynchronously-returns-Conflict-response.frozen b/cassettes/features/v2/service_scorecards/Update-Scorecard-outcomes-asynchronously-returns-Conflict-response.frozen new file mode 100644 index 00000000000..eb7d1dc0b1a --- /dev/null +++ b/cassettes/features/v2/service_scorecards/Update-Scorecard-outcomes-asynchronously-returns-Conflict-response.frozen @@ -0,0 +1 @@ +2025-08-26T14:46:20.159Z \ No newline at end of file diff --git a/cassettes/features/v2/service_scorecards/Update-Scorecard-outcomes-asynchronously-returns-Conflict-response.yml b/cassettes/features/v2/service_scorecards/Update-Scorecard-outcomes-asynchronously-returns-Conflict-response.yml new file mode 100644 index 00000000000..780204daeca --- /dev/null +++ b/cassettes/features/v2/service_scorecards/Update-Scorecard-outcomes-asynchronously-returns-Conflict-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Tue, 26 Aug 2025 14:46:20 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"results":[{"entity_reference":"service:my-service","remarks":"See: + Services","rule_id":"INVALID.RULE_ID","state":"pass"}]},"type":"batched-outcome"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/scorecard/outcomes + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"409","title":"Invalid rule_id"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 409 + message: Conflict +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/service_scorecards/Update-an-existing-scorecard-rule-returns-Bad-Request-response.frozen b/cassettes/features/v2/service_scorecards/Update-an-existing-scorecard-rule-returns-Bad-Request-response.frozen new file mode 100644 index 00000000000..5eaafa2c360 --- /dev/null +++ b/cassettes/features/v2/service_scorecards/Update-an-existing-scorecard-rule-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-08-26T19:33:28.111Z \ No newline at end of file diff --git a/cassettes/features/v2/service_scorecards/Update-an-existing-scorecard-rule-returns-Bad-Request-response.yml b/cassettes/features/v2/service_scorecards/Update-an-existing-scorecard-rule-returns-Bad-Request-response.yml new file mode 100644 index 00000000000..fee994792eb --- /dev/null +++ b/cassettes/features/v2/service_scorecards/Update-an-existing-scorecard-rule-returns-Bad-Request-response.yml @@ -0,0 +1,66 @@ +http_interactions: +- recorded_at: Tue, 26 Aug 2025 19:33:28 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"enabled":true,"name":"Test-Update_an_existing_scorecard_rule_returns_Bad_Request_response-1756236808","owner":"Datadog","scorecard_name":"OpenAPI + Spec Test Best Practices"},"type":"rule"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/scorecard/rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"z661h8n2bpc5q0kx","type":"rule","attributes":{"category":"OpenAPI + Spec Test Best Practices","created_at":"2025-08-26T19:32:32.06573621Z","custom":true,"enabled":true,"level":3,"modified_at":"2025-08-26T19:32:32.06573621Z","name":"Test-Update_an_existing_scorecard_rule_returns_Bad_Request_response-1756236808","owner":"Datadog","scorecard_name":"OpenAPI + Spec Test Best Practices"},"relationships":{"scorecard":{"data":{"id":"qsxpoYRhU_yz","type":"scorecard"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 26 Aug 2025 19:33:28 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"enabled":true,"level":2,"name":"Team Defined","scorecard_id":"NOT.FOUND"},"type":"rule"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/scorecard/rules/z661h8n2bpc5q0kx + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"scorecard_id\" failed scorecard lookup"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +- recorded_at: Tue, 26 Aug 2025 19:33:28 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/scorecard/rules/z661h8n2bpc5q0kx + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/service_scorecards/Update-an-existing-scorecard-rule-returns-Not-Found-response.frozen b/cassettes/features/v2/service_scorecards/Update-an-existing-scorecard-rule-returns-Not-Found-response.frozen new file mode 100644 index 00000000000..865cee5ede7 --- /dev/null +++ b/cassettes/features/v2/service_scorecards/Update-an-existing-scorecard-rule-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-08-26T19:33:28.966Z \ No newline at end of file diff --git a/cassettes/features/v2/service_scorecards/Update-an-existing-scorecard-rule-returns-Not-Found-response.yml b/cassettes/features/v2/service_scorecards/Update-an-existing-scorecard-rule-returns-Not-Found-response.yml new file mode 100644 index 00000000000..4ffb7edf037 --- /dev/null +++ b/cassettes/features/v2/service_scorecards/Update-an-existing-scorecard-rule-returns-Not-Found-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Tue, 26 Aug 2025 19:33:28 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"enabled":true,"level":2,"name":"Team Defined","scorecard_name":"Deployments + automated via Deployment Trains"},"type":"rule"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/scorecard/rules/REPLACE.ME + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"rule not found: + REPLACE.ME"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/examples/v1/dashboards/CreateDashboard_3066042014.rb b/examples/v1/dashboards/CreateDashboard_3066042014.rb index 652c816257b..63dbd60a03d 100644 --- a/examples/v1/dashboards/CreateDashboard_3066042014.rb +++ b/examples/v1/dashboards/CreateDashboard_3066042014.rb @@ -22,6 +22,7 @@ type: DatadogAPIClient::V1::WidgetNewLiveSpanType::LIVE, unit: DatadogAPIClient::V1::WidgetLiveSpanUnit::MINUTE, value: 8, + hide_incomplete_cost_data: true, }), type: DatadogAPIClient::V1::TimeseriesWidgetDefinitionType::TIMESERIES, requests: [ diff --git a/examples/v1/dashboards/CreateDashboard_3451918078.rb b/examples/v1/dashboards/CreateDashboard_3451918078.rb index 650ec248554..f09dc77b1f7 100644 --- a/examples/v1/dashboards/CreateDashboard_3451918078.rb +++ b/examples/v1/dashboards/CreateDashboard_3451918078.rb @@ -22,6 +22,7 @@ type: DatadogAPIClient::V1::WidgetNewFixedSpanType::FIXED, from: 1712080128, to: 1712083128, + hide_incomplete_cost_data: true, }), type: DatadogAPIClient::V1::TimeseriesWidgetDefinitionType::TIMESERIES, requests: [ diff --git a/examples/v1/dashboards/CreateDashboard_4262729673.rb b/examples/v1/dashboards/CreateDashboard_4262729673.rb index 7ffb04fa6a7..5e50a47244d 100644 --- a/examples/v1/dashboards/CreateDashboard_4262729673.rb +++ b/examples/v1/dashboards/CreateDashboard_4262729673.rb @@ -20,6 +20,7 @@ ], time: DatadogAPIClient::V1::WidgetLegacyLiveSpan.new({ live_span: DatadogAPIClient::V1::WidgetLiveSpan::PAST_FIVE_MINUTES, + hide_incomplete_cost_data: true, }), type: DatadogAPIClient::V1::TimeseriesWidgetDefinitionType::TIMESERIES, requests: [ diff --git a/examples/v2/service-scorecards/UpdateScorecardOutcomesAsync.rb b/examples/v2/service-scorecards/UpdateScorecardOutcomesAsync.rb new file mode 100644 index 00000000000..b2c19901654 --- /dev/null +++ b/examples/v2/service-scorecards/UpdateScorecardOutcomesAsync.rb @@ -0,0 +1,27 @@ +# Update Scorecard outcomes asynchronously returns "Accepted" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_scorecard_outcomes_async".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceScorecardsAPI.new + +# there is a valid "create_scorecard_rule" in the system +CREATE_SCORECARD_RULE_DATA_ID = ENV["CREATE_SCORECARD_RULE_DATA_ID"] + +body = DatadogAPIClient::V2::UpdateOutcomesAsyncRequest.new({ + data: DatadogAPIClient::V2::UpdateOutcomesAsyncRequestData.new({ + attributes: DatadogAPIClient::V2::UpdateOutcomesAsyncAttributes.new({ + results: [ + DatadogAPIClient::V2::UpdateOutcomesAsyncRequestItem.new({ + rule_id: CREATE_SCORECARD_RULE_DATA_ID, + entity_reference: "service:my-service", + remarks: 'See: Services', + state: DatadogAPIClient::V2::State::PASS, + }), + ], + }), + type: DatadogAPIClient::V2::UpdateOutcomesAsyncType::BATCHED_OUTCOME, + }), +}) +p api_instance.update_scorecard_outcomes_async(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 2159ef256c1..e1bd7f875de 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2511,6 +2511,9 @@ "filter_rule_id" => "String", "filter_rule_name" => "String", }, + "v2.UpdateScorecardOutcomesAsync" => { + "body" => "UpdateOutcomesAsyncRequest", + }, "v2.CreateScorecardOutcomesBatch" => { "body" => "OutcomesBatchRequest", }, diff --git a/features/v1/dashboards.feature b/features/v1/dashboards.feature index 47794c745f4..f267082830d 100644 --- a/features/v1/dashboards.feature +++ b/features/v1/dashboards.feature @@ -922,30 +922,33 @@ Feature: Dashboards @team:DataDog/dashboards-backend Scenario: Create a new timeseries widget with legacy live span time format Given new "CreateDashboard" request - And body with value {"title":"{{ unique }} with legacy live span time","widgets":[{"definition":{"title":"","show_legend":true,"legend_layout":"auto","legend_columns":["avg","min","max","value","sum"],"time":{"live_span": "5m"},"type":"timeseries","requests":[{"formulas":[{"formula":"query1"}],"queries":[{"data_source":"ci_pipelines","name":"query1","search":{"query":"ci_level:job"},"indexes":["*"],"compute":{"aggregation":"count", "metric": "@ci.queue_time"},"group_by":[]}],"response_format":"timeseries","style":{"palette":"dog_classic","line_type":"solid","line_width":"normal"},"display_type":"line"}]}}],"layout_type":"ordered","reflow_type":"auto"} + And body with value {"title":"{{ unique }} with legacy live span time","widgets":[{"definition":{"title":"","show_legend":true,"legend_layout":"auto","legend_columns":["avg","min","max","value","sum"],"time":{"live_span": "5m", "hide_incomplete_cost_data": true},"type":"timeseries","requests":[{"formulas":[{"formula":"query1"}],"queries":[{"data_source":"ci_pipelines","name":"query1","search":{"query":"ci_level:job"},"indexes":["*"],"compute":{"aggregation":"count", "metric": "@ci.queue_time"},"group_by":[]}],"response_format":"timeseries","style":{"palette":"dog_classic","line_type":"solid","line_width":"normal"},"display_type":"line"}]}}],"layout_type":"ordered","reflow_type":"auto"} When the request is sent Then the response status is 200 OK And the response "widgets[0].definition.time.live_span" is equal to "5m" + And the response "widgets[0].definition.time.hide_incomplete_cost_data" is equal to true @team:DataDog/dashboards-backend Scenario: Create a new timeseries widget with new fixed span time format Given new "CreateDashboard" request - And body with value {"title":"{{ unique }} with new fixed span time","widgets":[{"definition":{"title":"","show_legend":true,"legend_layout":"auto","legend_columns":["avg","min","max","value","sum"],"time":{"type": "fixed", "from": 1712080128, "to": 1712083128},"type":"timeseries","requests":[{"formulas":[{"formula":"query1"}],"queries":[{"data_source":"ci_pipelines","name":"query1","search":{"query":"ci_level:job"},"indexes":["*"],"compute":{"aggregation":"count", "metric": "@ci.queue_time"},"group_by":[]}],"response_format":"timeseries","style":{"palette":"dog_classic","line_type":"solid","line_width":"normal"},"display_type":"line"}]}}],"layout_type":"ordered","reflow_type":"auto"} + And body with value {"title":"{{ unique }} with new fixed span time","widgets":[{"definition":{"title":"","show_legend":true,"legend_layout":"auto","legend_columns":["avg","min","max","value","sum"],"time":{"type": "fixed", "from": 1712080128, "to": 1712083128, "hide_incomplete_cost_data": true},"type":"timeseries","requests":[{"formulas":[{"formula":"query1"}],"queries":[{"data_source":"ci_pipelines","name":"query1","search":{"query":"ci_level:job"},"indexes":["*"],"compute":{"aggregation":"count", "metric": "@ci.queue_time"},"group_by":[]}],"response_format":"timeseries","style":{"palette":"dog_classic","line_type":"solid","line_width":"normal"},"display_type":"line"}]}}],"layout_type":"ordered","reflow_type":"auto"} When the request is sent Then the response status is 200 OK And the response "widgets[0].definition.time.type" is equal to "fixed" And the response "widgets[0].definition.time.from" is equal to 1712080128 And the response "widgets[0].definition.time.to" is equal to 1712083128 + And the response "widgets[0].definition.time.hide_incomplete_cost_data" is equal to true @team:DataDog/dashboards-backend Scenario: Create a new timeseries widget with new live span time format Given new "CreateDashboard" request - And body with value {"title":"{{ unique }} with new live span time","widgets":[{"definition":{"title":"","show_legend":true,"legend_layout":"auto","legend_columns":["avg","min","max","value","sum"],"time":{"type": "live", "unit": "minute", "value": 8},"type":"timeseries","requests":[{"formulas":[{"formula":"query1"}],"queries":[{"data_source":"ci_pipelines","name":"query1","search":{"query":"ci_level:job"},"indexes":["*"],"compute":{"aggregation":"count", "metric": "@ci.queue_time"},"group_by":[]}],"response_format":"timeseries","style":{"palette":"dog_classic","line_type":"solid","line_width":"normal"},"display_type":"line"}]}}],"layout_type":"ordered","reflow_type":"auto"} + And body with value {"title":"{{ unique }} with new live span time","widgets":[{"definition":{"title":"","show_legend":true,"legend_layout":"auto","legend_columns":["avg","min","max","value","sum"],"time":{"type": "live", "unit": "minute", "value": 8, "hide_incomplete_cost_data": true},"type":"timeseries","requests":[{"formulas":[{"formula":"query1"}],"queries":[{"data_source":"ci_pipelines","name":"query1","search":{"query":"ci_level:job"},"indexes":["*"],"compute":{"aggregation":"count", "metric": "@ci.queue_time"},"group_by":[]}],"response_format":"timeseries","style":{"palette":"dog_classic","line_type":"solid","line_width":"normal"},"display_type":"line"}]}}],"layout_type":"ordered","reflow_type":"auto"} When the request is sent Then the response status is 200 OK And the response "widgets[0].definition.time.type" is equal to "live" And the response "widgets[0].definition.time.unit" is equal to "minute" And the response "widgets[0].definition.time.value" is equal to 8 + And the response "widgets[0].definition.time.hide_incomplete_cost_data" is equal to true @generated @skip @team:DataDog/reporting-and-sharing Scenario: Create a shared dashboard returns "Bad Request" response diff --git a/features/v2/service_scorecards.feature b/features/v2/service_scorecards.feature index 11d2c7f4328..387f04cf711 100644 --- a/features/v2/service_scorecards.feature +++ b/features/v2/service_scorecards.feature @@ -10,11 +10,11 @@ Feature: Service Scorecards And a valid "appKeyAuth" key in the system And an instance of "ServiceScorecards" API - @generated @skip @team:DataDog/service-catalog + @team:DataDog/service-catalog Scenario: Create a new rule returns "Bad Request" response Given operation "CreateScorecardRule" enabled And new "CreateScorecardRule" request - And body with value {"data": {"attributes": {"enabled": true, "name": "Team Defined", "scorecard_name": "Deployments automated via Deployment Trains"}, "type": "rule"}} + And body with value {"data": {"attributes": {"enabled": true, "level": 2, "name": "Team Defined", "scorecard_id": "NOT.FOUND"}, "type": "rule"}} When the request is sent Then the response status is 400 Bad Request @@ -121,12 +121,41 @@ Feature: Service Scorecards Then the response status is 200 OK And the response has 4 items + @team:DataDog/service-catalog + Scenario: Update Scorecard outcomes asynchronously returns "Accepted" response + Given operation "UpdateScorecardOutcomesAsync" enabled + And there is a valid "create_scorecard_rule" in the system + And new "UpdateScorecardOutcomesAsync" request + And body with value {"data": {"attributes": {"results": [{"rule_id": "{{create_scorecard_rule.data.id}}", "entity_reference": "service:my-service", "remarks": "See: Services", "state": "pass"}]}, "type": "batched-outcome"}} + When the request is sent + Then the response status is 202 Accepted + + @team:DataDog/service-catalog + Scenario: Update Scorecard outcomes asynchronously returns "Bad Request" response + Given operation "UpdateScorecardOutcomesAsync" enabled + And there is a valid "create_scorecard_rule" in the system + And new "UpdateScorecardOutcomesAsync" request + And body with value {"data": {"attributes": {"results": [{"rule_id": "{{create_scorecard_rule.data.id}}", "entity_reference": "service:my-service", "state": "INVALID"}]}, "type": "batched-outcome"}} + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0]" has field "detail" + + @team:DataDog/service-catalog + Scenario: Update Scorecard outcomes asynchronously returns "Conflict" response + Given operation "UpdateScorecardOutcomesAsync" enabled + And new "UpdateScorecardOutcomesAsync" request + And body with value {"data": {"attributes": {"results": [{"rule_id": "INVALID.RULE_ID", "entity_reference": "service:my-service", "remarks": "See: Services", "state": "pass"}]}, "type": "batched-outcome"}} + When the request is sent + Then the response status is 409 Conflict + And the response "errors" has length 1 + @generated @skip @team:DataDog/service-catalog Scenario: Update an existing rule returns "Bad Request" response Given operation "UpdateScorecardRule" enabled And new "UpdateScorecardRule" request And request contains "rule_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"enabled": true, "name": "Team Defined", "scorecard_name": "Deployments automated via Deployment Trains"}, "type": "rule"}} + And body with value {"data": {"attributes": {"enabled": true, "level": 2, "name": "Team Defined", "scorecard_name": "Deployments automated via Deployment Trains"}, "type": "rule"}} When the request is sent Then the response status is 400 Bad Request @@ -139,3 +168,22 @@ Feature: Service Scorecards And body with value {"data": { "attributes" : {"enabled": true, "name": "{{create_scorecard_rule.data.attributes.name}}", "scorecard_name": "{{create_scorecard_rule.data.attributes.scorecard_name}}", "description": "Updated description via test"}}} When the request is sent Then the response status is 200 Rule updated successfully + + @team:DataDog/service-catalog + Scenario: Update an existing scorecard rule returns "Bad Request" response + Given operation "UpdateScorecardRule" enabled + And there is a valid "create_scorecard_rule" in the system + And new "UpdateScorecardRule" request + And request contains "rule_id" parameter from "create_scorecard_rule.data.id" + And body with value {"data": {"attributes": {"enabled": true, "level": 2, "name": "Team Defined", "scorecard_id": "NOT.FOUND"}, "type": "rule"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/service-catalog + Scenario: Update an existing scorecard rule returns "Not Found" response + Given operation "UpdateScorecardRule" enabled + And new "UpdateScorecardRule" request + And request contains "rule_id" parameter with value "REPLACE.ME" + And body with value {"data": {"attributes": {"enabled": true, "level": 2, "name": "Team Defined", "scorecard_name": "Deployments automated via Deployment Trains"}, "type": "rule"}} + When the request is sent + Then the response status is 404 Not Found diff --git a/features/v2/undo.json b/features/v2/undo.json index 9878d7a4678..444ec9d07dc 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2742,6 +2742,12 @@ "type": "safe" } }, + "UpdateScorecardOutcomesAsync": { + "tag": "Service Scorecards", + "undo": { + "type": "idempotent" + } + }, "CreateScorecardOutcomesBatch": { "tag": "Service Scorecards", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index a6a5a665e36..7700e3412f1 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -265,6 +265,7 @@ def initialize "v2.delete_scorecard_rule": false, "v2.list_scorecard_outcomes": false, "v2.list_scorecard_rules": false, + "v2.update_scorecard_outcomes_async": false, "v2.update_scorecard_rule": false, "v2.create_incident_service": false, "v2.delete_incident_service": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 7d7d1985f89..d23ae42738f 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3709,6 +3709,11 @@ def overrides "v2.update_open_api_response" => "UpdateOpenAPIResponse", "v2.update_open_api_response_attributes" => "UpdateOpenAPIResponseAttributes", "v2.update_open_api_response_data" => "UpdateOpenAPIResponseData", + "v2.update_outcomes_async_attributes" => "UpdateOutcomesAsyncAttributes", + "v2.update_outcomes_async_request" => "UpdateOutcomesAsyncRequest", + "v2.update_outcomes_async_request_data" => "UpdateOutcomesAsyncRequestData", + "v2.update_outcomes_async_request_item" => "UpdateOutcomesAsyncRequestItem", + "v2.update_outcomes_async_type" => "UpdateOutcomesAsyncType", "v2.update_resource_evaluation_filters_request" => "UpdateResourceEvaluationFiltersRequest", "v2.update_resource_evaluation_filters_request_data" => "UpdateResourceEvaluationFiltersRequestData", "v2.update_resource_evaluation_filters_response" => "UpdateResourceEvaluationFiltersResponse", diff --git a/lib/datadog_api_client/v1/models/widget_legacy_live_span.rb b/lib/datadog_api_client/v1/models/widget_legacy_live_span.rb index 9d03b7a473f..e292887c063 100644 --- a/lib/datadog_api_client/v1/models/widget_legacy_live_span.rb +++ b/lib/datadog_api_client/v1/models/widget_legacy_live_span.rb @@ -21,6 +21,9 @@ module DatadogAPIClient::V1 class WidgetLegacyLiveSpan include BaseGenericModel + # Whether to hide incomplete cost data in the widget. + attr_accessor :hide_incomplete_cost_data + # The available timeframes depend on the widget you are using. attr_accessor :live_span @@ -28,6 +31,7 @@ class WidgetLegacyLiveSpan # @!visibility private def self.attribute_map { + :'hide_incomplete_cost_data' => :'hide_incomplete_cost_data', :'live_span' => :'live_span' } end @@ -36,6 +40,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { + :'hide_incomplete_cost_data' => :'Boolean', :'live_span' => :'WidgetLiveSpan' } end @@ -56,6 +61,10 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'hide_incomplete_cost_data') + self.hide_incomplete_cost_data = attributes[:'hide_incomplete_cost_data'] + end + if attributes.key?(:'live_span') self.live_span = attributes[:'live_span'] end @@ -67,6 +76,7 @@ def initialize(attributes = {}) def ==(o) return true if self.equal?(o) self.class == o.class && + hide_incomplete_cost_data == o.hide_incomplete_cost_data && live_span == o.live_span end @@ -74,7 +84,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [live_span].hash + [hide_incomplete_cost_data, live_span].hash end end end diff --git a/lib/datadog_api_client/v1/models/widget_new_fixed_span.rb b/lib/datadog_api_client/v1/models/widget_new_fixed_span.rb index c9e0bccbd14..fb6c66ea4cc 100644 --- a/lib/datadog_api_client/v1/models/widget_new_fixed_span.rb +++ b/lib/datadog_api_client/v1/models/widget_new_fixed_span.rb @@ -24,6 +24,9 @@ class WidgetNewFixedSpan # Start time in seconds since epoch. attr_reader :from + # Whether to hide incomplete cost data in the widget. + attr_accessor :hide_incomplete_cost_data + # End time in seconds since epoch. attr_reader :to @@ -37,6 +40,7 @@ class WidgetNewFixedSpan def self.attribute_map { :'from' => :'from', + :'hide_incomplete_cost_data' => :'hide_incomplete_cost_data', :'to' => :'to', :'type' => :'type' } @@ -47,6 +51,7 @@ def self.attribute_map def self.openapi_types { :'from' => :'Integer', + :'hide_incomplete_cost_data' => :'Boolean', :'to' => :'Integer', :'type' => :'WidgetNewFixedSpanType' } @@ -74,6 +79,10 @@ def initialize(attributes = {}) self.from = attributes[:'from'] end + if attributes.key?(:'hide_incomplete_cost_data') + self.hide_incomplete_cost_data = attributes[:'hide_incomplete_cost_data'] + end + if attributes.key?(:'to') self.to = attributes[:'to'] end @@ -158,6 +167,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && from == o.from && + hide_incomplete_cost_data == o.hide_incomplete_cost_data && to == o.to && type == o.type && additional_properties == o.additional_properties @@ -167,7 +177,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [from, to, type, additional_properties].hash + [from, hide_incomplete_cost_data, to, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v1/models/widget_new_live_span.rb b/lib/datadog_api_client/v1/models/widget_new_live_span.rb index 582732e86a0..580a3607500 100644 --- a/lib/datadog_api_client/v1/models/widget_new_live_span.rb +++ b/lib/datadog_api_client/v1/models/widget_new_live_span.rb @@ -21,6 +21,9 @@ module DatadogAPIClient::V1 class WidgetNewLiveSpan include BaseGenericModel + # Whether to hide incomplete cost data in the widget. + attr_accessor :hide_incomplete_cost_data + # Type "live" denotes a live span in the new format. attr_reader :type @@ -36,6 +39,7 @@ class WidgetNewLiveSpan # @!visibility private def self.attribute_map { + :'hide_incomplete_cost_data' => :'hide_incomplete_cost_data', :'type' => :'type', :'unit' => :'unit', :'value' => :'value' @@ -46,6 +50,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { + :'hide_incomplete_cost_data' => :'Boolean', :'type' => :'WidgetNewLiveSpanType', :'unit' => :'WidgetLiveSpanUnit', :'value' => :'Integer' @@ -70,6 +75,10 @@ def initialize(attributes = {}) end } + if attributes.key?(:'hide_incomplete_cost_data') + self.hide_incomplete_cost_data = attributes[:'hide_incomplete_cost_data'] + end + if attributes.key?(:'type') self.type = attributes[:'type'] end @@ -153,6 +162,7 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && + hide_incomplete_cost_data == o.hide_incomplete_cost_data && type == o.type && unit == o.unit && value == o.value && @@ -163,7 +173,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [type, unit, value, additional_properties].hash + [hide_incomplete_cost_data, type, unit, value, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/api/service_scorecards_api.rb b/lib/datadog_api_client/v2/api/service_scorecards_api.rb index b1385f3bea1..b9ba3606557 100644 --- a/lib/datadog_api_client/v2/api/service_scorecards_api.rb +++ b/lib/datadog_api_client/v2/api/service_scorecards_api.rb @@ -454,6 +454,79 @@ def list_scorecard_rules_with_pagination(opts = {}) end end + # Update Scorecard outcomes asynchronously. + # + # @see #update_scorecard_outcomes_async_with_http_info + def update_scorecard_outcomes_async(body, opts = {}) + update_scorecard_outcomes_async_with_http_info(body, opts) + nil + end + + # Update Scorecard outcomes asynchronously. + # + # Updates multiple scorecard rule outcomes in a single batched request. + # + # @param body [UpdateOutcomesAsyncRequest] Set of scorecard outcomes. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_scorecard_outcomes_async_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_scorecard_outcomes_async".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_scorecard_outcomes_async") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_scorecard_outcomes_async")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.update_scorecard_outcomes_async ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ServiceScorecardsAPI.update_scorecard_outcomes_async" + end + # resource path + local_var_path = '/api/v2/scorecard/outcomes' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_scorecard_outcomes_async, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceScorecardsAPI#update_scorecard_outcomes_async\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update an existing rule. # # @see #update_scorecard_rule_with_http_info diff --git a/lib/datadog_api_client/v2/models/rule_attributes.rb b/lib/datadog_api_client/v2/models/rule_attributes.rb index 95f63feedfa..15a41060681 100644 --- a/lib/datadog_api_client/v2/models/rule_attributes.rb +++ b/lib/datadog_api_client/v2/models/rule_attributes.rb @@ -36,6 +36,9 @@ class RuleAttributes # If enabled, the rule is calculated as part of the score. attr_accessor :enabled + # The maturity level of the rule (1, 2, or 3). + attr_reader :level + # Time of the last rule outcome modification. attr_accessor :modified_at @@ -59,6 +62,7 @@ def self.attribute_map :'custom' => :'custom', :'description' => :'description', :'enabled' => :'enabled', + :'level' => :'level', :'modified_at' => :'modified_at', :'name' => :'name', :'owner' => :'owner', @@ -75,6 +79,7 @@ def self.openapi_types :'custom' => :'Boolean', :'description' => :'String', :'enabled' => :'Boolean', + :'level' => :'Integer', :'modified_at' => :'Time', :'name' => :'String', :'owner' => :'String', @@ -120,6 +125,10 @@ def initialize(attributes = {}) self.enabled = attributes[:'enabled'] end + if attributes.key?(:'level') + self.level = attributes[:'level'] + end + if attributes.key?(:'modified_at') self.modified_at = attributes[:'modified_at'] end @@ -137,6 +146,28 @@ def initialize(attributes = {}) end end + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@level.nil? && @level > 3 + return false if !@level.nil? && @level < 1 + true + end + + # Custom attribute writer method with validation + # @param level [Object] Object to be assigned + # @!visibility private + def level=(level) + if !level.nil? && level > 3 + fail ArgumentError, 'invalid value for "level", must be smaller than or equal to 3.' + end + if !level.nil? && level < 1 + fail ArgumentError, 'invalid value for "level", must be greater than or equal to 1.' + end + @level = level + end + # Returns the object in the form of hash, with additionalProperties support. # @return [Hash] Returns the object in the form of hash # @!visibility private @@ -168,6 +199,7 @@ def ==(o) custom == o.custom && description == o.description && enabled == o.enabled && + level == o.level && modified_at == o.modified_at && name == o.name && owner == o.owner && @@ -179,7 +211,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [category, created_at, custom, description, enabled, modified_at, name, owner, scorecard_name, additional_properties].hash + [category, created_at, custom, description, enabled, level, modified_at, name, owner, scorecard_name, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/update_outcomes_async_attributes.rb b/lib/datadog_api_client/v2/models/update_outcomes_async_attributes.rb new file mode 100644 index 00000000000..0b0fb15b436 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_outcomes_async_attributes.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The JSON:API attributes for a batched set of scorecard outcomes. + class UpdateOutcomesAsyncAttributes + include BaseGenericModel + + # Set of scorecard outcomes to update asynchronously. + attr_accessor :results + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'results' => :'results' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'results' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateOutcomesAsyncAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'results') + if (value = attributes[:'results']).is_a?(Array) + self.results = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + results == o.results && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [results, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_outcomes_async_request.rb b/lib/datadog_api_client/v2/models/update_outcomes_async_request.rb new file mode 100644 index 00000000000..3520dd1ceaa --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_outcomes_async_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Scorecard outcomes batch request. + class UpdateOutcomesAsyncRequest + include BaseGenericModel + + # Scorecard outcomes batch request data. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'UpdateOutcomesAsyncRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateOutcomesAsyncRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_outcomes_async_request_data.rb b/lib/datadog_api_client/v2/models/update_outcomes_async_request_data.rb new file mode 100644 index 00000000000..1b7a73a953a --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_outcomes_async_request_data.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Scorecard outcomes batch request data. + class UpdateOutcomesAsyncRequestData + include BaseGenericModel + + # The JSON:API attributes for a batched set of scorecard outcomes. + attr_accessor :attributes + + # The JSON:API type for scorecard outcomes. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'UpdateOutcomesAsyncAttributes', + :'type' => :'UpdateOutcomesAsyncType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateOutcomesAsyncRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_outcomes_async_request_item.rb b/lib/datadog_api_client/v2/models/update_outcomes_async_request_item.rb new file mode 100644 index 00000000000..6df5336218e --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_outcomes_async_request_item.rb @@ -0,0 +1,175 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Scorecard outcome for a single entity and rule. + class UpdateOutcomesAsyncRequestItem + include BaseGenericModel + + # The unique reference for an IDP entity. + attr_reader :entity_reference + + # Any remarks regarding the scorecard rule's evaluation. Supports HTML hyperlinks. + attr_accessor :remarks + + # The unique ID for a scorecard rule. + attr_reader :rule_id + + # The state of the rule evaluation. + attr_reader :state + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'entity_reference' => :'entity_reference', + :'remarks' => :'remarks', + :'rule_id' => :'rule_id', + :'state' => :'state' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'entity_reference' => :'String', + :'remarks' => :'String', + :'rule_id' => :'String', + :'state' => :'State' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateOutcomesAsyncRequestItem` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'entity_reference') + self.entity_reference = attributes[:'entity_reference'] + end + + if attributes.key?(:'remarks') + self.remarks = attributes[:'remarks'] + end + + if attributes.key?(:'rule_id') + self.rule_id = attributes[:'rule_id'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @entity_reference.nil? + return false if @rule_id.nil? + return false if @state.nil? + true + end + + # Custom attribute writer method with validation + # @param entity_reference [Object] Object to be assigned + # @!visibility private + def entity_reference=(entity_reference) + if entity_reference.nil? + fail ArgumentError, 'invalid value for "entity_reference", entity_reference cannot be nil.' + end + @entity_reference = entity_reference + end + + # Custom attribute writer method with validation + # @param rule_id [Object] Object to be assigned + # @!visibility private + def rule_id=(rule_id) + if rule_id.nil? + fail ArgumentError, 'invalid value for "rule_id", rule_id cannot be nil.' + end + @rule_id = rule_id + end + + # Custom attribute writer method with validation + # @param state [Object] Object to be assigned + # @!visibility private + def state=(state) + if state.nil? + fail ArgumentError, 'invalid value for "state", state cannot be nil.' + end + @state = state + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + entity_reference == o.entity_reference && + remarks == o.remarks && + rule_id == o.rule_id && + state == o.state && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [entity_reference, remarks, rule_id, state, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_outcomes_async_type.rb b/lib/datadog_api_client/v2/models/update_outcomes_async_type.rb new file mode 100644 index 00000000000..76da169c92f --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_outcomes_async_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The JSON:API type for scorecard outcomes. + class UpdateOutcomesAsyncType + include BaseEnumModel + + BATCHED_OUTCOME = "batched-outcome".freeze + end +end