From c42ba282919301a5d2686fe10ce35af3b5fe7235 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 19 Feb 2026 08:11:24 +0000 Subject: [PATCH] Regenerate client from commit 8574e36 of spec repo --- .generator/schemas/v2/openapi.yaml | 1547 ++++++++++++++++- docs/datadog_api_client.v2.model.rst | 315 ++++ .../CreateScorecardCampaign.py | 42 + .../DeleteScorecardCampaign.py | 14 + .../DeleteScorecardRuleWorkflow.py | 14 + .../GenerateScorecardCampaignReport.py | 33 + .../GenerateScorecardCampaignTeamReports.py | 41 + .../GetScorecardCampaign.py | 16 + .../ListScorecardCampaigns.py | 14 + .../ListScorecardDefaultRules.py | 14 + .../service-scorecards/ListScorecardFacets.py | 14 + .../service-scorecards/ListScorecardScores.py | 16 + .../v2/service-scorecards/ListScorecards.py | 14 + .../service-scorecards/SetupScorecardRules.py | 28 + .../UpdateScorecardCampaign.py | 41 + .../UpdateScorecardRuleWorkflow.py | 15 + src/datadog_api_client/configuration.py | 14 + .../v2/api/service_scorecards_api.py | 792 ++++++++- .../v2/model/campaign_response.py | 40 + .../v2/model/campaign_response_attributes.py | 115 ++ .../v2/model/campaign_response_data.py | 54 + .../v2/model/campaign_status.py | 41 + .../v2/model/campaign_type.py | 35 + .../v2/model/create_campaign_request.py | 40 + .../create_campaign_request_attributes.py | 115 ++ .../v2/model/create_campaign_request_data.py | 48 + .../model/default_rule_response_attributes.py | 79 + .../v2/model/default_rule_response_data.py | 54 + .../v2/model/default_rule_type.py | 35 + .../v2/model/entity_owner_destination.py | 46 + src/datadog_api_client/v2/model/facet_item.py | 39 + .../v2/model/facet_response_attributes.py | 55 + .../v2/model/facet_response_data.py | 54 + src/datadog_api_client/v2/model/facet_type.py | 35 + .../model/generate_campaign_report_request.py | 40 + ...rate_campaign_report_request_attributes.py | 40 + .../generate_campaign_report_request_data.py | 61 + ...erate_campaign_report_request_data_type.py | 35 + .../generate_campaign_team_reports_request.py | 44 + ...ampaign_team_reports_request_attributes.py | 40 + ...rate_campaign_team_reports_request_data.py | 61 + ...campaign_team_reports_request_data_type.py | 37 + .../v2/model/list_campaigns_response.py | 48 + .../v2/model/list_default_rules_response.py | 40 + .../v2/model/list_facets_response.py | 48 + .../v2/model/list_facets_response_meta.py | 33 + .../v2/model/list_scorecards_response.py | 40 + .../v2/model/list_scores_response.py | 48 + .../v2/model/paginated_response_meta.py | 51 + .../v2/model/score_response_attributes.py | 86 + .../v2/model/score_response_data.py | 54 + src/datadog_api_client/v2/model/score_type.py | 35 + .../scorecard_list_response_attributes.py | 63 + .../v2/model/scorecard_list_response_data.py | 54 + .../v2/model/scorecard_list_type.py | 35 + .../v2/model/setup_rules_request.py | 40 + .../model/setup_rules_request_attributes.py | 36 + .../v2/model/setup_rules_request_data.py | 48 + .../v2/model/setup_rules_request_data_type.py | 35 + .../v2/model/slack_routing_options.py | 64 + .../v2/model/update_campaign_request.py | 40 + .../update_campaign_request_attributes.py | 109 ++ .../v2/model/update_campaign_request_data.py | 48 + src/datadog_api_client/v2/models/__init__.py | 98 ++ tests/v2/features/service_scorecards.feature | 278 +++ tests/v2/features/undo.json | 84 + 66 files changed, 5726 insertions(+), 16 deletions(-) create mode 100644 examples/v2/service-scorecards/CreateScorecardCampaign.py create mode 100644 examples/v2/service-scorecards/DeleteScorecardCampaign.py create mode 100644 examples/v2/service-scorecards/DeleteScorecardRuleWorkflow.py create mode 100644 examples/v2/service-scorecards/GenerateScorecardCampaignReport.py create mode 100644 examples/v2/service-scorecards/GenerateScorecardCampaignTeamReports.py create mode 100644 examples/v2/service-scorecards/GetScorecardCampaign.py create mode 100644 examples/v2/service-scorecards/ListScorecardCampaigns.py create mode 100644 examples/v2/service-scorecards/ListScorecardDefaultRules.py create mode 100644 examples/v2/service-scorecards/ListScorecardFacets.py create mode 100644 examples/v2/service-scorecards/ListScorecardScores.py create mode 100644 examples/v2/service-scorecards/ListScorecards.py create mode 100644 examples/v2/service-scorecards/SetupScorecardRules.py create mode 100644 examples/v2/service-scorecards/UpdateScorecardCampaign.py create mode 100644 examples/v2/service-scorecards/UpdateScorecardRuleWorkflow.py create mode 100644 src/datadog_api_client/v2/model/campaign_response.py create mode 100644 src/datadog_api_client/v2/model/campaign_response_attributes.py create mode 100644 src/datadog_api_client/v2/model/campaign_response_data.py create mode 100644 src/datadog_api_client/v2/model/campaign_status.py create mode 100644 src/datadog_api_client/v2/model/campaign_type.py create mode 100644 src/datadog_api_client/v2/model/create_campaign_request.py create mode 100644 src/datadog_api_client/v2/model/create_campaign_request_attributes.py create mode 100644 src/datadog_api_client/v2/model/create_campaign_request_data.py create mode 100644 src/datadog_api_client/v2/model/default_rule_response_attributes.py create mode 100644 src/datadog_api_client/v2/model/default_rule_response_data.py create mode 100644 src/datadog_api_client/v2/model/default_rule_type.py create mode 100644 src/datadog_api_client/v2/model/entity_owner_destination.py create mode 100644 src/datadog_api_client/v2/model/facet_item.py create mode 100644 src/datadog_api_client/v2/model/facet_response_attributes.py create mode 100644 src/datadog_api_client/v2/model/facet_response_data.py create mode 100644 src/datadog_api_client/v2/model/facet_type.py create mode 100644 src/datadog_api_client/v2/model/generate_campaign_report_request.py create mode 100644 src/datadog_api_client/v2/model/generate_campaign_report_request_attributes.py create mode 100644 src/datadog_api_client/v2/model/generate_campaign_report_request_data.py create mode 100644 src/datadog_api_client/v2/model/generate_campaign_report_request_data_type.py create mode 100644 src/datadog_api_client/v2/model/generate_campaign_team_reports_request.py create mode 100644 src/datadog_api_client/v2/model/generate_campaign_team_reports_request_attributes.py create mode 100644 src/datadog_api_client/v2/model/generate_campaign_team_reports_request_data.py create mode 100644 src/datadog_api_client/v2/model/generate_campaign_team_reports_request_data_type.py create mode 100644 src/datadog_api_client/v2/model/list_campaigns_response.py create mode 100644 src/datadog_api_client/v2/model/list_default_rules_response.py create mode 100644 src/datadog_api_client/v2/model/list_facets_response.py create mode 100644 src/datadog_api_client/v2/model/list_facets_response_meta.py create mode 100644 src/datadog_api_client/v2/model/list_scorecards_response.py create mode 100644 src/datadog_api_client/v2/model/list_scores_response.py create mode 100644 src/datadog_api_client/v2/model/paginated_response_meta.py create mode 100644 src/datadog_api_client/v2/model/score_response_attributes.py create mode 100644 src/datadog_api_client/v2/model/score_response_data.py create mode 100644 src/datadog_api_client/v2/model/score_type.py create mode 100644 src/datadog_api_client/v2/model/scorecard_list_response_attributes.py create mode 100644 src/datadog_api_client/v2/model/scorecard_list_response_data.py create mode 100644 src/datadog_api_client/v2/model/scorecard_list_type.py create mode 100644 src/datadog_api_client/v2/model/setup_rules_request.py create mode 100644 src/datadog_api_client/v2/model/setup_rules_request_attributes.py create mode 100644 src/datadog_api_client/v2/model/setup_rules_request_data.py create mode 100644 src/datadog_api_client/v2/model/setup_rules_request_data_type.py create mode 100644 src/datadog_api_client/v2/model/slack_routing_options.py create mode 100644 src/datadog_api_client/v2/model/update_campaign_request.py create mode 100644 src/datadog_api_client/v2/model/update_campaign_request_attributes.py create mode 100644 src/datadog_api_client/v2/model/update_campaign_request_data.py diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 590c8e62b6..72c53b8074 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -9354,6 +9354,110 @@ components: - name - expression type: object + CampaignResponse: + description: Response containing campaign data. + properties: + data: + $ref: '#/components/schemas/CampaignResponseData' + required: + - data + type: object + CampaignResponseAttributes: + description: Campaign attributes. + properties: + created_at: + description: Creation time of the campaign. + example: '2023-12-15T10:30:00Z' + format: date-time + type: string + description: + description: The description of the campaign. + example: Campaign to improve security posture for Q1 2024. + type: string + due_date: + description: The due date of the campaign. + example: '2024-03-31T23:59:59Z' + format: date-time + type: string + entity_scope: + description: Entity scope query to filter entities for this campaign. + example: kind:service AND team:platform + type: string + guidance: + description: Guidance for the campaign. + example: Please ensure all services pass the security requirements. + type: string + key: + description: The unique key for the campaign. + example: q1-security-2024 + type: string + modified_at: + description: Time of last campaign modification. + example: '2024-01-05T14:20:00Z' + format: date-time + type: string + name: + description: The name of the campaign. + example: Q1 Security Campaign + type: string + owner: + description: The UUID of the campaign owner. + example: 550e8400-e29b-41d4-a716-446655440000 + type: string + start_date: + description: The start date of the campaign. + example: '2024-01-01T00:00:00Z' + format: date-time + type: string + status: + description: The status of the campaign. + example: in_progress + type: string + required: + - key + - name + - owner + - status + - start_date + - created_at + - modified_at + type: object + CampaignResponseData: + description: Campaign data. + properties: + attributes: + $ref: '#/components/schemas/CampaignResponseAttributes' + id: + description: The unique ID of the campaign. + example: c10ODp0VCrrIpXmz + type: string + type: + $ref: '#/components/schemas/CampaignType' + required: + - id + - type + - attributes + type: object + CampaignStatus: + description: The status of the campaign. + enum: + - in_progress + - not_started + - completed + example: in_progress + type: string + x-enum-varnames: + - IN_PROGRESS + - NOT_STARTED + - COMPLETED + CampaignType: + description: The JSON:API type for campaigns. + enum: + - campaign + example: campaign + type: string + x-enum-varnames: + - CAMPAIGN CancelDataDeletionResponseBody: description: The response from the cancel data deletion request endpoint. properties: @@ -13801,6 +13905,79 @@ components: example: Postmortem-IR-123 type: string type: object + CreateCampaignRequest: + description: Request to create a new campaign. + properties: + data: + $ref: '#/components/schemas/CreateCampaignRequestData' + required: + - data + type: object + CreateCampaignRequestAttributes: + description: Attributes for creating a new campaign. + properties: + description: + description: The description of the campaign. + example: Campaign to improve security posture for Q1 2024. + type: string + due_date: + description: The due date of the campaign. + example: '2024-03-31T23:59:59Z' + format: date-time + type: string + entity_scope: + description: Entity scope query to filter entities for this campaign. + example: kind:service AND team:platform + type: string + guidance: + description: Guidance for the campaign. + example: Please ensure all services pass the security requirements. + type: string + key: + description: The unique key for the campaign. + example: q1-security-2024 + type: string + name: + description: The name of the campaign. + example: Q1 Security Campaign + type: string + owner_id: + description: The UUID of the campaign owner. + example: 550e8400-e29b-41d4-a716-446655440000 + type: string + rule_ids: + description: Array of rule IDs associated with this campaign. + example: + - q8MQxk8TCqrHnWkx + - r9NRyl9UDrsIoXly + items: + type: string + type: array + start_date: + description: The start date of the campaign. + example: '2024-01-01T00:00:00Z' + format: date-time + type: string + status: + $ref: '#/components/schemas/CampaignStatus' + required: + - name + - key + - owner_id + - start_date + - rule_ids + type: object + CreateCampaignRequestData: + description: Data for creating a new campaign. + properties: + attributes: + $ref: '#/components/schemas/CreateCampaignRequestAttributes' + type: + $ref: '#/components/schemas/CampaignType' + required: + - type + - attributes + type: object CreateCaseRequestArray: description: List of requests to create cases for security findings. properties: @@ -19191,6 +19368,62 @@ components: example: 1722439510282 format: int64 type: integer + DefaultRuleResponseAttributes: + description: Default rule attributes. + properties: + description: + description: The description of the default rule. + example: Service has at least one SLO defined. + type: string + level: + description: The maturity level of the rule. + example: 2 + format: int64 + type: integer + name: + description: The name of the default rule. + example: SLOs Defined + type: string + scope_required: + description: Required scope for the rule. + example: kind:service + type: string + scorecard_description: + description: The description of the scorecard. + example: Best practices for observability. + type: string + scorecard_name: + description: The scorecard this rule belongs to. + example: Observability Best Practices + type: string + required: + - name + - scorecard_name + type: object + DefaultRuleResponseData: + description: Default rule data. + properties: + attributes: + $ref: '#/components/schemas/DefaultRuleResponseAttributes' + id: + description: The unique ID of the default rule. + example: q8MQxk8TCqrHnWkx + type: string + type: + $ref: '#/components/schemas/DefaultRuleType' + required: + - id + - type + - attributes + type: object + DefaultRuleType: + description: The JSON:API type for default rules. + enum: + - default-rule + example: default-rule + type: string + x-enum-varnames: + - DEFAULT_RULE Degradation: properties: data: @@ -20956,6 +21189,19 @@ components: description: The origin. type: string type: object + EntityOwnerDestination: + description: Entity owner and Slack destination for team reports. + properties: + slack: + $ref: '#/components/schemas/SlackRoutingOptions' + team_id: + description: Team UUID. + example: 550e8400-e29b-41d4-a716-446655440000 + type: string + required: + - team_id + - slack + type: object EntityRaw: description: Entity definition in raw JSON or YAML representation. example: "apiVersion: v3\nkind: service\nmetadata:\n name: myservice" @@ -23573,6 +23819,66 @@ components: type: string x-enum-varnames: - USERS_FACET_INFO + FacetItem: + description: Facet item with count. + properties: + name: + description: The name of the facet value. + example: platform + type: string + value: + description: The count for this facet value. + example: 42 + format: int64 + type: integer + required: + - name + - value + type: object + FacetResponseAttributes: + description: Facet attributes. + properties: + items: + description: Array of facet values. + items: + $ref: '#/components/schemas/FacetItem' + type: array + key: + description: The key of the facet. + example: team + type: string + name: + description: The display name of the facet. + example: Team + type: string + required: + - key + - items + type: object + FacetResponseData: + description: Facet data. + properties: + attributes: + $ref: '#/components/schemas/FacetResponseAttributes' + id: + description: The unique ID of the facet. + example: team + type: string + type: + $ref: '#/components/schemas/FacetType' + required: + - id + - type + - attributes + type: object + FacetType: + description: The JSON:API type for facets. + enum: + - facet + example: facet + type: string + x-enum-varnames: + - FACET FastlyAPIKey: description: The definition of the `FastlyAPIKey` object. properties: @@ -26866,6 +27172,82 @@ components: required: - type type: object + GenerateCampaignReportRequest: + description: Request to generate a campaign report. + properties: + data: + $ref: '#/components/schemas/GenerateCampaignReportRequestData' + required: + - data + type: object + GenerateCampaignReportRequestAttributes: + description: Attributes for generating a campaign report. + properties: + slack: + $ref: '#/components/schemas/SlackRoutingOptions' + required: + - slack + type: object + GenerateCampaignReportRequestData: + description: Data for generating a campaign report. + properties: + attributes: + $ref: '#/components/schemas/GenerateCampaignReportRequestAttributes' + type: + $ref: '#/components/schemas/GenerateCampaignReportRequestDataType' + required: + - type + - attributes + type: object + GenerateCampaignReportRequestDataType: + enum: + - campaign-report + example: campaign-report + type: string + x-enum-varnames: + - CAMPAIGN_REPORT + GenerateCampaignTeamReportsRequest: + description: Request to generate team-specific campaign reports. + properties: + data: + $ref: '#/components/schemas/GenerateCampaignTeamReportsRequestData' + required: + - data + type: object + GenerateCampaignTeamReportsRequestAttributes: + description: Attributes for generating team campaign reports. + properties: + entity_owners: + description: List of entity owners and their Slack destinations. + example: + - slack: + channel_id: C024BDQ4N + workspace_id: T024BDQ4N + team_id: 550e8400-e29b-41d4-a716-446655440000 + items: + $ref: '#/components/schemas/EntityOwnerDestination' + type: array + required: + - entity_owners + type: object + GenerateCampaignTeamReportsRequestData: + description: Data for generating team campaign reports. + properties: + attributes: + $ref: '#/components/schemas/GenerateCampaignTeamReportsRequestAttributes' + type: + $ref: '#/components/schemas/GenerateCampaignTeamReportsRequestDataType' + required: + - type + - attributes + type: object + GenerateCampaignTeamReportsRequestDataType: + enum: + - campaign-team-report + example: campaign-team-report + type: string + x-enum-varnames: + - CAMPAIGN_TEAM_REPORT GetActionConnectionResponse: description: The response for found connection properties: @@ -33757,6 +34139,22 @@ components: required: - data type: object + ListCampaignsResponse: + description: Response containing a list of campaigns. + properties: + data: + $ref: '#/components/schemas/ListCampaignsResponseData' + meta: + $ref: '#/components/schemas/PaginatedResponseMeta' + required: + - data + - meta + type: object + ListCampaignsResponseData: + description: Array of campaigns. + items: + $ref: '#/components/schemas/CampaignResponseData' + type: array ListConnectionsResponse: example: data: @@ -33855,6 +34253,19 @@ components: type: string x-enum-varnames: - LIST_CONNECTIONS_RESPONSE + ListDefaultRulesResponse: + description: Response containing a list of default rules. + properties: + data: + $ref: '#/components/schemas/ListDefaultRulesResponseData' + required: + - data + type: object + ListDefaultRulesResponseData: + description: Array of default rules. + items: + $ref: '#/components/schemas/DefaultRuleResponseData' + type: array ListDeploymentRuleResponseData: description: Data for a list of deployment rules. properties: @@ -33966,6 +34377,33 @@ components: description: Current link. type: string type: object + ListFacetsResponse: + description: Response containing a list of facets. + properties: + data: + $ref: '#/components/schemas/ListFacetsResponseData' + meta: + $ref: '#/components/schemas/ListFacetsResponseMeta' + required: + - data + - meta + type: object + ListFacetsResponseData: + description: Array of facets. + items: + $ref: '#/components/schemas/FacetResponseData' + type: array + ListFacetsResponseMeta: + description: Metadata for facets response. + properties: + total_entities: + description: Total number of entities. + example: 150 + format: int64 + type: integer + required: + - total_entities + type: object ListFindingsData: description: Array of findings. items: @@ -34162,6 +34600,35 @@ components: example: /api/v2/scorecard/rules?page%5Blimit%5D=2&page%5Boffset%5D=2&page%5Bsize%5D=2 type: string type: object + ListScorecardsResponse: + description: Response containing a list of scorecards. + properties: + data: + $ref: '#/components/schemas/ListScorecardsResponseData' + required: + - data + type: object + ListScorecardsResponseData: + description: Array of scorecards. + items: + $ref: '#/components/schemas/ScorecardListResponseData' + type: array + ListScoresResponse: + description: Response containing a list of scores. + properties: + data: + $ref: '#/components/schemas/ListScoresResponseData' + meta: + $ref: '#/components/schemas/PaginatedResponseMeta' + required: + - data + - meta + type: object + ListScoresResponseData: + description: Array of scores. + items: + $ref: '#/components/schemas/ScoreResponseData' + type: array ListSecurityFindingsResponse: description: The expected response schema when listing security findings. properties: @@ -45002,6 +45469,35 @@ components: x-enum-varnames: - LOW - HIGH + PaginatedResponseMeta: + description: Metadata for scores response. + properties: + count: + description: Number of entities in this response. + example: 10 + format: int64 + type: integer + limit: + description: Pagination limit. + example: 10 + format: int64 + type: integer + offset: + description: Pagination offset. + example: 0 + format: int64 + type: integer + total: + description: Total number of entities available. + example: 150 + format: int64 + type: integer + required: + - count + - total + - limit + - offset + type: object Pagination: description: Pagination object. properties: @@ -52686,6 +53182,132 @@ components: type: string x-enum-varnames: - USERS + ScoreResponseAttributes: + description: Score attributes. + properties: + aggregation: + description: The aggregation type. + example: by-entity + type: string + denominator: + description: Score denominator. + example: 18 + format: int64 + type: integer + numerator: + description: Score numerator. + example: 15 + format: int64 + type: integer + score: + description: Calculated score value. + example: 0.833 + format: double + type: number + total_fail: + description: Total number of failing rules. + example: 3 + format: int64 + type: integer + total_no_data: + description: Total number of rules with no data. + example: 1 + format: int64 + type: integer + total_pass: + description: Total number of passing rules. + example: 15 + format: int64 + type: integer + total_skip: + description: Total number of skipped rules. + example: 2 + format: int64 + type: integer + required: + - aggregation + - total_pass + - total_fail + - total_skip + - total_no_data + - numerator + - denominator + - score + type: object + ScoreResponseData: + description: Score data. + properties: + attributes: + $ref: '#/components/schemas/ScoreResponseAttributes' + id: + description: The unique ID of the score entity. + example: service:my-service + type: string + type: + $ref: '#/components/schemas/ScoreType' + required: + - id + - type + - attributes + type: object + ScoreType: + description: The JSON:API type for scores. + enum: + - score + example: score + type: string + x-enum-varnames: + - SCORE + ScorecardListResponseAttributes: + description: Scorecard attributes. + properties: + created_at: + description: Creation time of the scorecard. + example: '2023-01-15T10:30:00Z' + format: date-time + type: string + description: + description: The description of the scorecard. + example: Best practices for observability. + type: string + modified_at: + description: Time of last scorecard modification. + example: '2024-01-05T14:20:00Z' + format: date-time + type: string + name: + description: The name of the scorecard. + example: Observability Best Practices + type: string + required: + - name + - created_at + - modified_at + type: object + ScorecardListResponseData: + description: Scorecard data. + properties: + attributes: + $ref: '#/components/schemas/ScorecardListResponseAttributes' + id: + description: The unique ID of the scorecard. + example: q8MQxk8TCqrHnWkx + type: string + type: + $ref: '#/components/schemas/ScorecardListType' + required: + - id + - type + - attributes + type: object + ScorecardListType: + description: The JSON:API type for scorecard list. + enum: + - scorecard + example: scorecard + type: string + x-enum-varnames: + - SCORECARD ScorecardType: default: scorecard description: The JSON:API type for scorecard. @@ -58922,6 +59544,44 @@ components: required: - type type: object + SetupRulesRequest: + description: Request to set up rules for an organization. + properties: + data: + $ref: '#/components/schemas/SetupRulesRequestData' + required: + - data + type: object + SetupRulesRequestAttributes: + description: Attributes for setting up rules. + properties: + disabled_default_rules: + description: Array of default rule IDs to disable. + example: + - q8MQxk8TCqrHnWkx + - r9NRyl9UDrsIoXly + items: + type: string + type: array + type: object + SetupRulesRequestData: + description: Data for setting up rules. + properties: + attributes: + $ref: '#/components/schemas/SetupRulesRequestAttributes' + type: + $ref: '#/components/schemas/SetupRulesRequestDataType' + required: + - type + - attributes + type: object + SetupRulesRequestDataType: + enum: + - setup + example: setup + type: string + x-enum-varnames: + - SETUP Shift: description: An on-call shift with its associated data and relationships. example: @@ -59310,6 +59970,26 @@ components: - channel_name - redirect_url type: object + SlackRoutingOptions: + description: Slack routing options for report delivery. + properties: + channel_id: + description: Slack channel ID. + example: C024BDQ4N + type: string + channel_name: + description: Slack channel name. + example: service-scorecards + type: string + workspace_id: + description: Slack workspace ID. + example: T024BDQ4N + type: string + workspace_name: + description: Slack workspace name. + example: datadog-workspace + type: string + type: object SlackTriggerWrapper: description: Schema for a Slack-based trigger. properties: @@ -65310,6 +65990,81 @@ components: description: The display name of the datastore. type: string type: object + UpdateCampaignRequest: + description: Request to update a campaign. + properties: + data: + $ref: '#/components/schemas/UpdateCampaignRequestData' + required: + - data + type: object + UpdateCampaignRequestAttributes: + description: Attributes for updating a campaign. + properties: + description: + description: The description of the campaign. + example: Campaign to improve security posture for Q1 2024. + type: string + due_date: + description: The due date of the campaign. + example: '2024-03-31T23:59:59Z' + format: date-time + type: string + entity_scope: + description: Entity scope query to filter entities for this campaign. + example: kind:service AND team:platform + type: string + guidance: + description: Guidance for the campaign. + example: Please ensure all services pass the security requirements. + type: string + key: + description: The unique key for the campaign. + example: q1-security-2024 + type: string + name: + description: The name of the campaign. + example: Q1 Security Campaign + type: string + owner_id: + description: The UUID of the campaign owner. + example: 550e8400-e29b-41d4-a716-446655440000 + type: string + rule_ids: + description: Array of rule IDs associated with this campaign. + example: + - q8MQxk8TCqrHnWkx + - r9NRyl9UDrsIoXly + items: + type: string + type: array + start_date: + description: The start date of the campaign. + example: '2024-01-01T00:00:00Z' + format: date-time + type: string + status: + description: The status of the campaign. + example: in_progress + type: string + required: + - name + - owner_id + - status + - start_date + - rule_ids + type: object + UpdateCampaignRequestData: + description: Data for updating a campaign. + properties: + attributes: + $ref: '#/components/schemas/UpdateCampaignRequestAttributes' + type: + $ref: '#/components/schemas/CampaignType' + required: + - type + - attributes + type: object UpdateConnectionRequest: example: data: @@ -93131,6 +93886,476 @@ paths: operator: OR permissions: - org_management + /api/v2/scorecard/campaigns: + get: + description: Fetches all scorecard campaigns. + operationId: ListScorecardCampaigns + parameters: + - description: Maximum number of campaigns to return. + in: query + name: page[limit] + required: false + schema: + default: 10 + example: 10 + format: int64 + type: integer + - description: Offset for pagination. + in: query + name: page[offset] + required: false + schema: + default: 0 + example: 0 + format: int64 + type: integer + - description: Filter campaigns by name (full-text search). + in: query + name: filter[campaign][name] + required: false + schema: + example: security + type: string + - description: Filter campaigns by status. + in: query + name: filter[campaign][status] + required: false + schema: + example: in_progress + type: string + - description: Filter campaigns by owner UUID. + in: query + name: filter[campaign][owner] + required: false + schema: + example: 550e8400-e29b-41d4-a716-446655440000 + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListCampaignsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_read + - cases_read + summary: List all campaigns + tags: + - Service Scorecards + x-unstable: '**Note**: This endpoint is in Preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Creates a new scorecard campaign. + operationId: CreateScorecardCampaign + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateCampaignRequest' + description: Campaign data. + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/CampaignResponse' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_write + - cases_write + summary: Create a new campaign + tags: + - Service Scorecards + x-unstable: '**Note**: This endpoint is in Preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/scorecard/campaigns/{campaign_id}: + delete: + description: Deletes a single campaign by ID or key. + operationId: DeleteScorecardCampaign + parameters: + - description: Campaign ID or key. + in: path + name: campaign_id + required: true + schema: + example: c10ODp0VCrrIpXmz + type: string + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_write + - cases_write + summary: Delete a campaign + tags: + - Service Scorecards + x-unstable: '**Note**: This endpoint is in Preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Fetches a single campaign by ID or key. + operationId: GetScorecardCampaign + parameters: + - description: Campaign ID or key. + in: path + name: campaign_id + required: true + schema: + example: c10ODp0VCrrIpXmz + type: string + - description: Include related data (for example, scores). + in: query + name: include + required: false + schema: + example: scores + type: string + - description: Include metadata (entity and rule counts). + in: query + name: include_meta + required: false + schema: + example: true + type: boolean + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CampaignResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_read + - cases_read + summary: Get a campaign + tags: + - Service Scorecards + x-unstable: '**Note**: This endpoint is in Preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + put: + description: Updates an existing campaign. + operationId: UpdateScorecardCampaign + parameters: + - description: Campaign ID or key. + in: path + name: campaign_id + required: true + schema: + example: c10ODp0VCrrIpXmz + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateCampaignRequest' + description: Campaign data. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CampaignResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_write + - cases_write + summary: Update a campaign + tags: + - Service Scorecards + x-unstable: '**Note**: This endpoint is in Preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/scorecard/campaigns/{campaign_id}/entity-owner-report: + post: + description: Generates and sends team-specific campaign reports to Slack. + operationId: GenerateScorecardCampaignTeamReports + parameters: + - description: Campaign ID. + in: path + name: campaign_id + required: true + schema: + example: c10ODp0VCrrIpXmz + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GenerateCampaignTeamReportsRequest' + description: Team report generation request. + required: true + responses: + '202': + description: Accepted + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_read + - cases_read + summary: Generate team-specific campaign reports + tags: + - Service Scorecards + x-unstable: '**Note**: This endpoint is in Preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/scorecard/campaigns/{campaign_id}/report: + post: + description: Generates and sends a campaign report to Slack. + operationId: GenerateScorecardCampaignReport + parameters: + - description: Campaign ID. + in: path + name: campaign_id + required: true + schema: + example: c10ODp0VCrrIpXmz + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GenerateCampaignReportRequest' + description: Report generation request. + required: true + responses: + '202': + description: Accepted + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_read + - cases_read + summary: Generate campaign report + tags: + - Service Scorecards + x-unstable: '**Note**: This endpoint is in Preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/scorecard/default-rules: + get: + description: Fetches all default scorecard rules available for the organization. + operationId: ListScorecardDefaultRules + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListDefaultRulesResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_read + summary: List default rules + tags: + - Service Scorecards + x-unstable: '**Note**: This endpoint is in Preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/scorecard/facets: + get: + description: Fetches facets for scorecard entities with counts. + operationId: ListScorecardFacets + parameters: + - description: Entity query filter. + in: query + name: filter[entity][query] + required: false + schema: + example: kind:service AND team:platform + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListFacetsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_read + summary: List entity facets + tags: + - Service Scorecards + x-unstable: '**Note**: This endpoint is in Preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/scorecard/outcomes: get: description: Fetches all rule outcomes. @@ -93159,21 +94384,21 @@ paths: schema: example: name type: string - - description: Filter the outcomes on a specific service name. + - description: Filter outcomes on a specific service name. in: query name: filter[outcome][service_name] required: false schema: example: web-store type: string - - description: Filter the outcomes by a specific state. + - description: Filter outcomes by a specific state. in: query name: filter[outcome][state] required: false schema: example: fail type: string - - description: Filter outcomes on whether a rule is enabled/disabled. + - description: Filter outcomes based on whether a rule is enabled or disabled. in: query name: filter[rule][enabled] required: false @@ -93219,7 +94444,7 @@ paths: limitParam: page[size] pageOffsetParam: page[offset] resultsPath: data - x-unstable: '**Note**: This endpoint is in public beta. + x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' post: @@ -93252,7 +94477,7 @@ paths: tags: - Service Scorecards x-codegen-request-body-name: body - x-unstable: '**Note**: This endpoint is in public beta. + x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/scorecard/outcomes/batch: @@ -93288,7 +94513,7 @@ paths: tags: - Service Scorecards x-codegen-request-body-name: body - x-unstable: '**Note**: This endpoint is in public beta. + x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/scorecard/rules: @@ -93380,7 +94605,7 @@ paths: limitParam: page[size] pageOffsetParam: page[offset] resultsPath: data - x-unstable: '**Note**: This endpoint is in public beta. + x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' post: @@ -93415,7 +94640,7 @@ paths: tags: - Service Scorecards x-codegen-request-body-name: body - x-unstable: '**Note**: This endpoint is in public beta. + x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/scorecard/rules/{rule_id}: @@ -93443,7 +94668,7 @@ paths: summary: Delete a rule tags: - Service Scorecards - x-unstable: '**Note**: This endpoint is in public beta. + x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' put: @@ -93480,7 +94705,309 @@ paths: tags: - Service Scorecards x-codegen-request-body-name: body - x-unstable: '**Note**: This endpoint is in public beta. + x-unstable: '**Note**: This endpoint is in Preview. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/scorecard/rules/{rule_id}/workflow: + delete: + description: Removes workflow association from a scorecard rule. + operationId: DeleteScorecardRuleWorkflow + parameters: + - $ref: '#/components/parameters/RuleId' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_write + summary: Delete rule workflow + tags: + - Service Scorecards + x-unstable: '**Note**: This endpoint is in Preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/scorecard/rules/{rule_id}/workflow/{workflow_id}: + put: + description: Associates a workflow with a scorecard rule. + operationId: UpdateScorecardRuleWorkflow + parameters: + - $ref: '#/components/parameters/RuleId' + - description: Workflow ID. + in: path + name: workflow_id + required: true + schema: + example: 550e8400-e29b-41d4-a716-446655440000 + type: string + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_write + summary: Associate workflow with rule + tags: + - Service Scorecards + x-unstable: '**Note**: This endpoint is in Preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/scorecard/scorecards: + get: + description: Fetches all scorecards. + operationId: ListScorecards + parameters: + - description: Offset for pagination. + in: query + name: page[offset] + required: false + schema: + default: 0 + example: 0 + format: int64 + type: integer + - description: Maximum number of scorecards to return. + in: query + name: page[size] + required: false + schema: + default: 100 + example: 10 + format: int64 + type: integer + - description: Filter by scorecard ID. + in: query + name: filter[scorecard][id] + required: false + schema: + example: q8MQxk8TCqrHnWkx + type: string + - description: Filter by scorecard name (partial match). + in: query + name: filter[scorecard][name] + required: false + schema: + example: Observability + type: string + - description: Filter by scorecard description (partial match). + in: query + name: filter[scorecard][description] + required: false + schema: + example: Best Practices + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListScorecardsResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_read + summary: List all scorecards + tags: + - Service Scorecards + x-unstable: '**Note**: This endpoint is in Preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/scorecard/scores/{aggregation}: + get: + description: Fetches scorecard scores aggregated by entity, rule, scorecard, + service, or team. + operationId: ListScorecardScores + parameters: + - description: Aggregation type (by-entity, by-rule, by-scorecard, by-service, + by-team). + in: path + name: aggregation + required: true + schema: + example: by-entity + type: string + - description: Maximum number of scores to return. + in: query + name: page[limit] + required: false + schema: + default: 100 + example: 10 + format: int64 + type: integer + - description: Offset for pagination. + in: query + name: page[offset] + required: false + schema: + default: 0 + example: 0 + format: int64 + type: integer + - description: Entity query filter. + in: query + name: filter[entity][query] + required: false + schema: + example: kind:service AND team:platform + type: string + - description: Filter by rule IDs (comma-separated). + in: query + name: filter[rule][id] + required: false + schema: + example: q8MQxk8TCqrHnWkx + type: string + - description: Filter by rule enabled status. + in: query + name: filter[rule][enabled] + required: false + schema: + example: true + type: boolean + - description: Filter by custom rules. + in: query + name: filter[rule][custom] + required: false + schema: + example: false + type: boolean + - description: Sort order (comma-separated list of fields; prefix a field with + - for descending order). + in: query + name: sort + required: false + schema: + example: score,-total_fail + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListScoresResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_read + summary: List scores by aggregation + tags: + - Service Scorecards + x-unstable: '**Note**: This endpoint is in Preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/scorecard/setup: + post: + description: Sets up default scorecard rules for the organization. + operationId: SetupScorecardRules + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SetupRulesRequest' + description: Setup rules request. + required: true + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_write + summary: Set up rules for organization + tags: + - Service Scorecards + x-unstable: '**Note**: This endpoint is in Preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/seats/users: diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 83de6067c9..7b515200de 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -2979,6 +2979,41 @@ datadog\_api\_client.v2.model.calculated\_field module :members: :show-inheritance: +datadog\_api\_client.v2.model.campaign\_response module +------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.campaign_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.campaign\_response\_attributes module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.campaign_response_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.campaign\_response\_data module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.campaign_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.campaign\_status module +----------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.campaign_status + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.campaign\_type module +--------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.campaign_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.cancel\_data\_deletion\_response\_body module --------------------------------------------------------------------------- @@ -5562,6 +5597,27 @@ datadog\_api\_client.v2.model.create\_attachment\_request\_data\_attributes\_att :members: :show-inheritance: +datadog\_api\_client.v2.model.create\_campaign\_request module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_campaign_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_campaign\_request\_attributes module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_campaign_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_campaign\_request\_data module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_campaign_request_data + :members: + :show-inheritance: + datadog\_api\_client.v2.model.create\_case\_request\_array module ----------------------------------------------------------------- @@ -7543,6 +7599,27 @@ datadog\_api\_client.v2.model.datastore\_trigger\_wrapper module :members: :show-inheritance: +datadog\_api\_client.v2.model.default\_rule\_response\_attributes module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.default_rule_response_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.default\_rule\_response\_data module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.default_rule_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.default\_rule\_type module +-------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.default_rule_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.degradation module ------------------------------------------------ @@ -8600,6 +8677,13 @@ datadog\_api\_client.v2.model.entity\_meta module :members: :show-inheritance: +datadog\_api\_client.v2.model.entity\_owner\_destination module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.entity_owner_destination + :members: + :show-inheritance: + datadog\_api\_client.v2.model.entity\_relationships module ---------------------------------------------------------- @@ -9853,6 +9937,34 @@ datadog\_api\_client.v2.model.facet\_info\_response\_data\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.facet\_item module +------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.facet_item + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.facet\_response\_attributes module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.facet_response_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.facet\_response\_data module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.facet_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.facet\_type module +------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.facet_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.fastly\_accoun\_response\_attributes module ------------------------------------------------------------------------- @@ -11197,6 +11309,62 @@ datadog\_api\_client.v2.model.gemini\_integration\_update module :members: :show-inheritance: +datadog\_api\_client.v2.model.generate\_campaign\_report\_request module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.generate_campaign_report_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.generate\_campaign\_report\_request\_attributes module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.generate_campaign_report_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.generate\_campaign\_report\_request\_data module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.generate_campaign_report_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.generate\_campaign\_report\_request\_data\_type module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.generate_campaign_report_request_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.generate\_campaign\_team\_reports\_request module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.generate_campaign_team_reports_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.generate\_campaign\_team\_reports\_request\_attributes module +------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.generate_campaign_team_reports_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.generate\_campaign\_team\_reports\_request\_data module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.generate_campaign_team_reports_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.generate\_campaign\_team\_reports\_request\_data\_type module +------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.generate_campaign_team_reports_request_data_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.get\_action\_connection\_response module ---------------------------------------------------------------------- @@ -14487,6 +14655,13 @@ datadog\_api\_client.v2.model.list\_assets\_sbo\_ms\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.list\_campaigns\_response module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_campaigns_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.list\_connections\_response module ---------------------------------------------------------------- @@ -14529,6 +14704,13 @@ datadog\_api\_client.v2.model.list\_connections\_response\_data\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.list\_default\_rules\_response module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_default_rules_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.list\_deployment\_rule\_response\_data module --------------------------------------------------------------------------- @@ -14599,6 +14781,20 @@ datadog\_api\_client.v2.model.list\_entity\_catalog\_response\_links module :members: :show-inheritance: +datadog\_api\_client.v2.model.list\_facets\_response module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_facets_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.list\_facets\_response\_meta module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_facets_response_meta + :members: + :show-inheritance: + datadog\_api\_client.v2.model.list\_findings\_meta module --------------------------------------------------------- @@ -14711,6 +14907,20 @@ datadog\_api\_client.v2.model.list\_rules\_response\_links module :members: :show-inheritance: +datadog\_api\_client.v2.model.list\_scorecards\_response module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_scorecards_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.list\_scores\_response module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_scores_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.list\_security\_findings\_response module ----------------------------------------------------------------------- @@ -19562,6 +19772,13 @@ datadog\_api\_client.v2.model.page\_urgency module :members: :show-inheritance: +datadog\_api\_client.v2.model.paginated\_response\_meta module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.paginated_response_meta + :members: + :show-inheritance: + datadog\_api\_client.v2.model.pagination module ----------------------------------------------- @@ -23286,6 +23503,48 @@ datadog\_api\_client.v2.model.schedule\_user\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.score\_response\_attributes module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.score_response_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.score\_response\_data module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.score_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.score\_type module +------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.score_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.scorecard\_list\_response\_attributes module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.scorecard_list_response_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.scorecard\_list\_response\_data module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.scorecard_list_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.scorecard\_list\_type module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.scorecard_list_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.scorecard\_type module ---------------------------------------------------- @@ -25778,6 +26037,34 @@ datadog\_api\_client.v2.model.session\_id\_data module :members: :show-inheritance: +datadog\_api\_client.v2.model.setup\_rules\_request module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.setup_rules_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.setup\_rules\_request\_attributes module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.setup_rules_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.setup\_rules\_request\_data module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.setup_rules_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.setup\_rules\_request\_data\_type module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.setup_rules_request_data_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.shift module ------------------------------------------ @@ -25932,6 +26219,13 @@ datadog\_api\_client.v2.model.slack\_integration\_metadata\_channel\_item module :members: :show-inheritance: +datadog\_api\_client.v2.model.slack\_routing\_options module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.slack_routing_options + :members: + :show-inheritance: + datadog\_api\_client.v2.model.slack\_trigger\_wrapper module ------------------------------------------------------------ @@ -28788,6 +29082,27 @@ datadog\_api\_client.v2.model.update\_apps\_datastore\_request\_data\_attributes :members: :show-inheritance: +datadog\_api\_client.v2.model.update\_campaign\_request module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.update_campaign_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.update\_campaign\_request\_attributes module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.update_campaign_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.update\_campaign\_request\_data module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.update_campaign_request_data + :members: + :show-inheritance: + datadog\_api\_client.v2.model.update\_connection\_request module ---------------------------------------------------------------- diff --git a/examples/v2/service-scorecards/CreateScorecardCampaign.py b/examples/v2/service-scorecards/CreateScorecardCampaign.py new file mode 100644 index 0000000000..f559930b3f --- /dev/null +++ b/examples/v2/service-scorecards/CreateScorecardCampaign.py @@ -0,0 +1,42 @@ +""" +Create a new campaign returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.service_scorecards_api import ServiceScorecardsApi +from datadog_api_client.v2.model.campaign_status import CampaignStatus +from datadog_api_client.v2.model.campaign_type import CampaignType +from datadog_api_client.v2.model.create_campaign_request import CreateCampaignRequest +from datadog_api_client.v2.model.create_campaign_request_attributes import CreateCampaignRequestAttributes +from datadog_api_client.v2.model.create_campaign_request_data import CreateCampaignRequestData +from datetime import datetime +from dateutil.tz import tzutc + +body = CreateCampaignRequest( + data=CreateCampaignRequestData( + attributes=CreateCampaignRequestAttributes( + description="Campaign to improve security posture for Q1 2024.", + due_date=datetime(2024, 3, 31, 23, 59, 59, tzinfo=tzutc()), + entity_scope="kind:service AND team:platform", + guidance="Please ensure all services pass the security requirements.", + key="q1-security-2024", + name="Q1 Security Campaign", + owner_id="550e8400-e29b-41d4-a716-446655440000", + rule_ids=[ + "q8MQxk8TCqrHnWkx", + "r9NRyl9UDrsIoXly", + ], + start_date=datetime(2024, 1, 1, 0, 0, tzinfo=tzutc()), + status=CampaignStatus.IN_PROGRESS, + ), + type=CampaignType.CAMPAIGN, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_scorecard_campaign"] = True +with ApiClient(configuration) as api_client: + api_instance = ServiceScorecardsApi(api_client) + response = api_instance.create_scorecard_campaign(body=body) + + print(response) diff --git a/examples/v2/service-scorecards/DeleteScorecardCampaign.py b/examples/v2/service-scorecards/DeleteScorecardCampaign.py new file mode 100644 index 0000000000..18ffc04371 --- /dev/null +++ b/examples/v2/service-scorecards/DeleteScorecardCampaign.py @@ -0,0 +1,14 @@ +""" +Delete a campaign returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.service_scorecards_api import ServiceScorecardsApi + +configuration = Configuration() +configuration.unstable_operations["delete_scorecard_campaign"] = True +with ApiClient(configuration) as api_client: + api_instance = ServiceScorecardsApi(api_client) + api_instance.delete_scorecard_campaign( + campaign_id="c10ODp0VCrrIpXmz", + ) diff --git a/examples/v2/service-scorecards/DeleteScorecardRuleWorkflow.py b/examples/v2/service-scorecards/DeleteScorecardRuleWorkflow.py new file mode 100644 index 0000000000..932853dc98 --- /dev/null +++ b/examples/v2/service-scorecards/DeleteScorecardRuleWorkflow.py @@ -0,0 +1,14 @@ +""" +Delete rule workflow returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.service_scorecards_api import ServiceScorecardsApi + +configuration = Configuration() +configuration.unstable_operations["delete_scorecard_rule_workflow"] = True +with ApiClient(configuration) as api_client: + api_instance = ServiceScorecardsApi(api_client) + api_instance.delete_scorecard_rule_workflow( + rule_id="rule_id", + ) diff --git a/examples/v2/service-scorecards/GenerateScorecardCampaignReport.py b/examples/v2/service-scorecards/GenerateScorecardCampaignReport.py new file mode 100644 index 0000000000..6be14cd266 --- /dev/null +++ b/examples/v2/service-scorecards/GenerateScorecardCampaignReport.py @@ -0,0 +1,33 @@ +""" +Generate campaign report returns "Accepted" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.service_scorecards_api import ServiceScorecardsApi +from datadog_api_client.v2.model.generate_campaign_report_request import GenerateCampaignReportRequest +from datadog_api_client.v2.model.generate_campaign_report_request_attributes import ( + GenerateCampaignReportRequestAttributes, +) +from datadog_api_client.v2.model.generate_campaign_report_request_data import GenerateCampaignReportRequestData +from datadog_api_client.v2.model.generate_campaign_report_request_data_type import GenerateCampaignReportRequestDataType +from datadog_api_client.v2.model.slack_routing_options import SlackRoutingOptions + +body = GenerateCampaignReportRequest( + data=GenerateCampaignReportRequestData( + attributes=GenerateCampaignReportRequestAttributes( + slack=SlackRoutingOptions( + channel_id="C024BDQ4N", + channel_name="service-scorecards", + workspace_id="T024BDQ4N", + workspace_name="datadog-workspace", + ), + ), + type=GenerateCampaignReportRequestDataType.CAMPAIGN_REPORT, + ), +) + +configuration = Configuration() +configuration.unstable_operations["generate_scorecard_campaign_report"] = True +with ApiClient(configuration) as api_client: + api_instance = ServiceScorecardsApi(api_client) + api_instance.generate_scorecard_campaign_report(campaign_id="c10ODp0VCrrIpXmz", body=body) diff --git a/examples/v2/service-scorecards/GenerateScorecardCampaignTeamReports.py b/examples/v2/service-scorecards/GenerateScorecardCampaignTeamReports.py new file mode 100644 index 0000000000..32faaea911 --- /dev/null +++ b/examples/v2/service-scorecards/GenerateScorecardCampaignTeamReports.py @@ -0,0 +1,41 @@ +""" +Generate team-specific campaign reports returns "Accepted" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.service_scorecards_api import ServiceScorecardsApi +from datadog_api_client.v2.model.entity_owner_destination import EntityOwnerDestination +from datadog_api_client.v2.model.generate_campaign_team_reports_request import GenerateCampaignTeamReportsRequest +from datadog_api_client.v2.model.generate_campaign_team_reports_request_attributes import ( + GenerateCampaignTeamReportsRequestAttributes, +) +from datadog_api_client.v2.model.generate_campaign_team_reports_request_data import ( + GenerateCampaignTeamReportsRequestData, +) +from datadog_api_client.v2.model.generate_campaign_team_reports_request_data_type import ( + GenerateCampaignTeamReportsRequestDataType, +) +from datadog_api_client.v2.model.slack_routing_options import SlackRoutingOptions + +body = GenerateCampaignTeamReportsRequest( + data=GenerateCampaignTeamReportsRequestData( + attributes=GenerateCampaignTeamReportsRequestAttributes( + entity_owners=[ + EntityOwnerDestination( + slack=SlackRoutingOptions( + channel_id="C024BDQ4N", + workspace_id="T024BDQ4N", + ), + team_id="550e8400-e29b-41d4-a716-446655440000", + ), + ], + ), + type=GenerateCampaignTeamReportsRequestDataType.CAMPAIGN_TEAM_REPORT, + ), +) + +configuration = Configuration() +configuration.unstable_operations["generate_scorecard_campaign_team_reports"] = True +with ApiClient(configuration) as api_client: + api_instance = ServiceScorecardsApi(api_client) + api_instance.generate_scorecard_campaign_team_reports(campaign_id="c10ODp0VCrrIpXmz", body=body) diff --git a/examples/v2/service-scorecards/GetScorecardCampaign.py b/examples/v2/service-scorecards/GetScorecardCampaign.py new file mode 100644 index 0000000000..6268f3d96c --- /dev/null +++ b/examples/v2/service-scorecards/GetScorecardCampaign.py @@ -0,0 +1,16 @@ +""" +Get a campaign returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.service_scorecards_api import ServiceScorecardsApi + +configuration = Configuration() +configuration.unstable_operations["get_scorecard_campaign"] = True +with ApiClient(configuration) as api_client: + api_instance = ServiceScorecardsApi(api_client) + response = api_instance.get_scorecard_campaign( + campaign_id="c10ODp0VCrrIpXmz", + ) + + print(response) diff --git a/examples/v2/service-scorecards/ListScorecardCampaigns.py b/examples/v2/service-scorecards/ListScorecardCampaigns.py new file mode 100644 index 0000000000..2e4d4158b9 --- /dev/null +++ b/examples/v2/service-scorecards/ListScorecardCampaigns.py @@ -0,0 +1,14 @@ +""" +List all campaigns returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.service_scorecards_api import ServiceScorecardsApi + +configuration = Configuration() +configuration.unstable_operations["list_scorecard_campaigns"] = True +with ApiClient(configuration) as api_client: + api_instance = ServiceScorecardsApi(api_client) + response = api_instance.list_scorecard_campaigns() + + print(response) diff --git a/examples/v2/service-scorecards/ListScorecardDefaultRules.py b/examples/v2/service-scorecards/ListScorecardDefaultRules.py new file mode 100644 index 0000000000..4e818dc375 --- /dev/null +++ b/examples/v2/service-scorecards/ListScorecardDefaultRules.py @@ -0,0 +1,14 @@ +""" +List default rules returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.service_scorecards_api import ServiceScorecardsApi + +configuration = Configuration() +configuration.unstable_operations["list_scorecard_default_rules"] = True +with ApiClient(configuration) as api_client: + api_instance = ServiceScorecardsApi(api_client) + response = api_instance.list_scorecard_default_rules() + + print(response) diff --git a/examples/v2/service-scorecards/ListScorecardFacets.py b/examples/v2/service-scorecards/ListScorecardFacets.py new file mode 100644 index 0000000000..f4021e0f9d --- /dev/null +++ b/examples/v2/service-scorecards/ListScorecardFacets.py @@ -0,0 +1,14 @@ +""" +List entity facets returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.service_scorecards_api import ServiceScorecardsApi + +configuration = Configuration() +configuration.unstable_operations["list_scorecard_facets"] = True +with ApiClient(configuration) as api_client: + api_instance = ServiceScorecardsApi(api_client) + response = api_instance.list_scorecard_facets() + + print(response) diff --git a/examples/v2/service-scorecards/ListScorecardScores.py b/examples/v2/service-scorecards/ListScorecardScores.py new file mode 100644 index 0000000000..7c74b1ea8a --- /dev/null +++ b/examples/v2/service-scorecards/ListScorecardScores.py @@ -0,0 +1,16 @@ +""" +List scores by aggregation returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.service_scorecards_api import ServiceScorecardsApi + +configuration = Configuration() +configuration.unstable_operations["list_scorecard_scores"] = True +with ApiClient(configuration) as api_client: + api_instance = ServiceScorecardsApi(api_client) + response = api_instance.list_scorecard_scores( + aggregation="by-entity", + ) + + print(response) diff --git a/examples/v2/service-scorecards/ListScorecards.py b/examples/v2/service-scorecards/ListScorecards.py new file mode 100644 index 0000000000..2d60a3f8bb --- /dev/null +++ b/examples/v2/service-scorecards/ListScorecards.py @@ -0,0 +1,14 @@ +""" +List all scorecards returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.service_scorecards_api import ServiceScorecardsApi + +configuration = Configuration() +configuration.unstable_operations["list_scorecards"] = True +with ApiClient(configuration) as api_client: + api_instance = ServiceScorecardsApi(api_client) + response = api_instance.list_scorecards() + + print(response) diff --git a/examples/v2/service-scorecards/SetupScorecardRules.py b/examples/v2/service-scorecards/SetupScorecardRules.py new file mode 100644 index 0000000000..d70fbef9fd --- /dev/null +++ b/examples/v2/service-scorecards/SetupScorecardRules.py @@ -0,0 +1,28 @@ +""" +Set up rules for organization returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.service_scorecards_api import ServiceScorecardsApi +from datadog_api_client.v2.model.setup_rules_request import SetupRulesRequest +from datadog_api_client.v2.model.setup_rules_request_attributes import SetupRulesRequestAttributes +from datadog_api_client.v2.model.setup_rules_request_data import SetupRulesRequestData +from datadog_api_client.v2.model.setup_rules_request_data_type import SetupRulesRequestDataType + +body = SetupRulesRequest( + data=SetupRulesRequestData( + attributes=SetupRulesRequestAttributes( + disabled_default_rules=[ + "q8MQxk8TCqrHnWkx", + "r9NRyl9UDrsIoXly", + ], + ), + type=SetupRulesRequestDataType.SETUP, + ), +) + +configuration = Configuration() +configuration.unstable_operations["setup_scorecard_rules"] = True +with ApiClient(configuration) as api_client: + api_instance = ServiceScorecardsApi(api_client) + api_instance.setup_scorecard_rules(body=body) diff --git a/examples/v2/service-scorecards/UpdateScorecardCampaign.py b/examples/v2/service-scorecards/UpdateScorecardCampaign.py new file mode 100644 index 0000000000..3c148b9f0f --- /dev/null +++ b/examples/v2/service-scorecards/UpdateScorecardCampaign.py @@ -0,0 +1,41 @@ +""" +Update a campaign returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.service_scorecards_api import ServiceScorecardsApi +from datadog_api_client.v2.model.campaign_type import CampaignType +from datadog_api_client.v2.model.update_campaign_request import UpdateCampaignRequest +from datadog_api_client.v2.model.update_campaign_request_attributes import UpdateCampaignRequestAttributes +from datadog_api_client.v2.model.update_campaign_request_data import UpdateCampaignRequestData +from datetime import datetime +from dateutil.tz import tzutc + +body = UpdateCampaignRequest( + data=UpdateCampaignRequestData( + attributes=UpdateCampaignRequestAttributes( + description="Campaign to improve security posture for Q1 2024.", + due_date=datetime(2024, 3, 31, 23, 59, 59, tzinfo=tzutc()), + entity_scope="kind:service AND team:platform", + guidance="Please ensure all services pass the security requirements.", + key="q1-security-2024", + name="Q1 Security Campaign", + owner_id="550e8400-e29b-41d4-a716-446655440000", + rule_ids=[ + "q8MQxk8TCqrHnWkx", + "r9NRyl9UDrsIoXly", + ], + start_date=datetime(2024, 1, 1, 0, 0, tzinfo=tzutc()), + status="in_progress", + ), + type=CampaignType.CAMPAIGN, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_scorecard_campaign"] = True +with ApiClient(configuration) as api_client: + api_instance = ServiceScorecardsApi(api_client) + response = api_instance.update_scorecard_campaign(campaign_id="c10ODp0VCrrIpXmz", body=body) + + print(response) diff --git a/examples/v2/service-scorecards/UpdateScorecardRuleWorkflow.py b/examples/v2/service-scorecards/UpdateScorecardRuleWorkflow.py new file mode 100644 index 0000000000..6d4fd48615 --- /dev/null +++ b/examples/v2/service-scorecards/UpdateScorecardRuleWorkflow.py @@ -0,0 +1,15 @@ +""" +Associate workflow with rule returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.service_scorecards_api import ServiceScorecardsApi + +configuration = Configuration() +configuration.unstable_operations["update_scorecard_rule_workflow"] = True +with ApiClient(configuration) as api_client: + api_instance = ServiceScorecardsApi(api_client) + api_instance.update_scorecard_rule_workflow( + rule_id="rule_id", + workflow_id="550e8400-e29b-41d4-a716-446655440000", + ) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index efa1d3f521..5b5275347a 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -410,13 +410,27 @@ def __init__( "v2.query_event_filtered_users": False, "v2.query_users": False, "v2.update_connection": False, + "v2.create_scorecard_campaign": False, "v2.create_scorecard_outcomes_batch": False, "v2.create_scorecard_rule": False, + "v2.delete_scorecard_campaign": False, "v2.delete_scorecard_rule": False, + "v2.delete_scorecard_rule_workflow": False, + "v2.generate_scorecard_campaign_report": False, + "v2.generate_scorecard_campaign_team_reports": False, + "v2.get_scorecard_campaign": False, + "v2.list_scorecard_campaigns": False, + "v2.list_scorecard_default_rules": False, + "v2.list_scorecard_facets": False, "v2.list_scorecard_outcomes": False, "v2.list_scorecard_rules": False, + "v2.list_scorecards": False, + "v2.list_scorecard_scores": False, + "v2.setup_scorecard_rules": False, + "v2.update_scorecard_campaign": False, "v2.update_scorecard_outcomes_async": False, "v2.update_scorecard_rule": False, + "v2.update_scorecard_rule_workflow": False, "v2.list_entity_risk_scores": False, "v2.create_incident_service": False, "v2.delete_incident_service": False, diff --git a/src/datadog_api_client/v2/api/service_scorecards_api.py b/src/datadog_api_client/v2/api/service_scorecards_api.py index 17f1b0de83..9f827b6adb 100644 --- a/src/datadog_api_client/v2/api/service_scorecards_api.py +++ b/src/datadog_api_client/v2/api/service_scorecards_api.py @@ -14,6 +14,14 @@ UnsetType, unset, ) +from datadog_api_client.v2.model.list_campaigns_response import ListCampaignsResponse +from datadog_api_client.v2.model.campaign_response import CampaignResponse +from datadog_api_client.v2.model.create_campaign_request import CreateCampaignRequest +from datadog_api_client.v2.model.update_campaign_request import UpdateCampaignRequest +from datadog_api_client.v2.model.generate_campaign_team_reports_request import GenerateCampaignTeamReportsRequest +from datadog_api_client.v2.model.generate_campaign_report_request import GenerateCampaignReportRequest +from datadog_api_client.v2.model.list_default_rules_response import ListDefaultRulesResponse +from datadog_api_client.v2.model.list_facets_response import ListFacetsResponse from datadog_api_client.v2.model.outcomes_response import OutcomesResponse from datadog_api_client.v2.model.outcomes_response_data_item import OutcomesResponseDataItem from datadog_api_client.v2.model.update_outcomes_async_request import UpdateOutcomesAsyncRequest @@ -25,6 +33,9 @@ from datadog_api_client.v2.model.create_rule_request import CreateRuleRequest from datadog_api_client.v2.model.update_rule_response import UpdateRuleResponse from datadog_api_client.v2.model.update_rule_request import UpdateRuleRequest +from datadog_api_client.v2.model.list_scorecards_response import ListScorecardsResponse +from datadog_api_client.v2.model.list_scores_response import ListScoresResponse +from datadog_api_client.v2.model.setup_rules_request import SetupRulesRequest class ServiceScorecardsApi: @@ -39,6 +50,26 @@ def __init__(self, api_client=None): api_client = ApiClient(Configuration()) self.api_client = api_client + self._create_scorecard_campaign_endpoint = _Endpoint( + settings={ + "response_type": (CampaignResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/scorecard/campaigns", + "operation_id": "create_scorecard_campaign", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (CreateCampaignRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._create_scorecard_outcomes_batch_endpoint = _Endpoint( settings={ "response_type": (OutcomesBatchResponse,), @@ -79,6 +110,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._delete_scorecard_campaign_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/scorecard/campaigns/{campaign_id}", + "operation_id": "delete_scorecard_campaign", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "campaign_id": { + "required": True, + "openapi_types": (str,), + "attribute": "campaign_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + self._delete_scorecard_rule_endpoint = _Endpoint( settings={ "response_type": None, @@ -102,6 +156,194 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._delete_scorecard_rule_workflow_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/scorecard/rules/{rule_id}/workflow", + "operation_id": "delete_scorecard_rule_workflow", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "rule_id": { + "required": True, + "openapi_types": (str,), + "attribute": "rule_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._generate_scorecard_campaign_report_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/scorecard/campaigns/{campaign_id}/report", + "operation_id": "generate_scorecard_campaign_report", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "campaign_id": { + "required": True, + "openapi_types": (str,), + "attribute": "campaign_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (GenerateCampaignReportRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._generate_scorecard_campaign_team_reports_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/scorecard/campaigns/{campaign_id}/entity-owner-report", + "operation_id": "generate_scorecard_campaign_team_reports", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "campaign_id": { + "required": True, + "openapi_types": (str,), + "attribute": "campaign_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (GenerateCampaignTeamReportsRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._get_scorecard_campaign_endpoint = _Endpoint( + settings={ + "response_type": (CampaignResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/scorecard/campaigns/{campaign_id}", + "operation_id": "get_scorecard_campaign", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "campaign_id": { + "required": True, + "openapi_types": (str,), + "attribute": "campaign_id", + "location": "path", + }, + "include": { + "openapi_types": (str,), + "attribute": "include", + "location": "query", + }, + "include_meta": { + "openapi_types": (bool,), + "attribute": "include_meta", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_scorecard_campaigns_endpoint = _Endpoint( + settings={ + "response_type": (ListCampaignsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/scorecard/campaigns", + "operation_id": "list_scorecard_campaigns", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "page_limit": { + "openapi_types": (int,), + "attribute": "page[limit]", + "location": "query", + }, + "page_offset": { + "openapi_types": (int,), + "attribute": "page[offset]", + "location": "query", + }, + "filter_campaign_name": { + "openapi_types": (str,), + "attribute": "filter[campaign][name]", + "location": "query", + }, + "filter_campaign_status": { + "openapi_types": (str,), + "attribute": "filter[campaign][status]", + "location": "query", + }, + "filter_campaign_owner": { + "openapi_types": (str,), + "attribute": "filter[campaign][owner]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_scorecard_default_rules_endpoint = _Endpoint( + settings={ + "response_type": (ListDefaultRulesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/scorecard/default-rules", + "operation_id": "list_scorecard_default_rules", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_scorecard_facets_endpoint = _Endpoint( + settings={ + "response_type": (ListFacetsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/scorecard/facets", + "operation_id": "list_scorecard_facets", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "filter_entity_query": { + "openapi_types": (str,), + "attribute": "filter[entity][query]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._list_scorecard_outcomes_endpoint = _Endpoint( settings={ "response_type": (OutcomesResponse,), @@ -236,6 +478,152 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._list_scorecards_endpoint = _Endpoint( + settings={ + "response_type": (ListScorecardsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/scorecard/scorecards", + "operation_id": "list_scorecards", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "page_offset": { + "openapi_types": (int,), + "attribute": "page[offset]", + "location": "query", + }, + "page_size": { + "openapi_types": (int,), + "attribute": "page[size]", + "location": "query", + }, + "filter_scorecard_id": { + "openapi_types": (str,), + "attribute": "filter[scorecard][id]", + "location": "query", + }, + "filter_scorecard_name": { + "openapi_types": (str,), + "attribute": "filter[scorecard][name]", + "location": "query", + }, + "filter_scorecard_description": { + "openapi_types": (str,), + "attribute": "filter[scorecard][description]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_scorecard_scores_endpoint = _Endpoint( + settings={ + "response_type": (ListScoresResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/scorecard/scores/{aggregation}", + "operation_id": "list_scorecard_scores", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "aggregation": { + "required": True, + "openapi_types": (str,), + "attribute": "aggregation", + "location": "path", + }, + "page_limit": { + "openapi_types": (int,), + "attribute": "page[limit]", + "location": "query", + }, + "page_offset": { + "openapi_types": (int,), + "attribute": "page[offset]", + "location": "query", + }, + "filter_entity_query": { + "openapi_types": (str,), + "attribute": "filter[entity][query]", + "location": "query", + }, + "filter_rule_id": { + "openapi_types": (str,), + "attribute": "filter[rule][id]", + "location": "query", + }, + "filter_rule_enabled": { + "openapi_types": (bool,), + "attribute": "filter[rule][enabled]", + "location": "query", + }, + "filter_rule_custom": { + "openapi_types": (bool,), + "attribute": "filter[rule][custom]", + "location": "query", + }, + "sort": { + "openapi_types": (str,), + "attribute": "sort", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._setup_scorecard_rules_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/scorecard/setup", + "operation_id": "setup_scorecard_rules", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (SetupRulesRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._update_scorecard_campaign_endpoint = _Endpoint( + settings={ + "response_type": (CampaignResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/scorecard/campaigns/{campaign_id}", + "operation_id": "update_scorecard_campaign", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "campaign_id": { + "required": True, + "openapi_types": (str,), + "attribute": "campaign_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (UpdateCampaignRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._update_scorecard_outcomes_async_endpoint = _Endpoint( settings={ "response_type": None, @@ -282,6 +670,52 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._update_scorecard_rule_workflow_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/scorecard/rules/{rule_id}/workflow/{workflow_id}", + "operation_id": "update_scorecard_rule_workflow", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "rule_id": { + "required": True, + "openapi_types": (str,), + "attribute": "rule_id", + "location": "path", + }, + "workflow_id": { + "required": True, + "openapi_types": (str,), + "attribute": "workflow_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + def create_scorecard_campaign( + self, + body: CreateCampaignRequest, + ) -> CampaignResponse: + """Create a new campaign. + + Creates a new scorecard campaign. + + :param body: Campaign data. + :type body: CreateCampaignRequest + :rtype: CampaignResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_scorecard_campaign_endpoint.call_with_http_info(**kwargs) + def create_scorecard_outcomes_batch( self, body: OutcomesBatchRequest, @@ -316,6 +750,23 @@ def create_scorecard_rule( return self._create_scorecard_rule_endpoint.call_with_http_info(**kwargs) + def delete_scorecard_campaign( + self, + campaign_id: str, + ) -> None: + """Delete a campaign. + + Deletes a single campaign by ID or key. + + :param campaign_id: Campaign ID or key. + :type campaign_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["campaign_id"] = campaign_id + + return self._delete_scorecard_campaign_endpoint.call_with_http_info(**kwargs) + def delete_scorecard_rule( self, rule_id: str, @@ -333,6 +784,171 @@ def delete_scorecard_rule( return self._delete_scorecard_rule_endpoint.call_with_http_info(**kwargs) + def delete_scorecard_rule_workflow( + self, + rule_id: str, + ) -> None: + """Delete rule workflow. + + Removes workflow association from a scorecard rule. + + :param rule_id: The ID of the rule. + :type rule_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["rule_id"] = rule_id + + return self._delete_scorecard_rule_workflow_endpoint.call_with_http_info(**kwargs) + + def generate_scorecard_campaign_report( + self, + campaign_id: str, + body: GenerateCampaignReportRequest, + ) -> None: + """Generate campaign report. + + Generates and sends a campaign report to Slack. + + :param campaign_id: Campaign ID. + :type campaign_id: str + :param body: Report generation request. + :type body: GenerateCampaignReportRequest + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["campaign_id"] = campaign_id + + kwargs["body"] = body + + return self._generate_scorecard_campaign_report_endpoint.call_with_http_info(**kwargs) + + def generate_scorecard_campaign_team_reports( + self, + campaign_id: str, + body: GenerateCampaignTeamReportsRequest, + ) -> None: + """Generate team-specific campaign reports. + + Generates and sends team-specific campaign reports to Slack. + + :param campaign_id: Campaign ID. + :type campaign_id: str + :param body: Team report generation request. + :type body: GenerateCampaignTeamReportsRequest + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["campaign_id"] = campaign_id + + kwargs["body"] = body + + return self._generate_scorecard_campaign_team_reports_endpoint.call_with_http_info(**kwargs) + + def get_scorecard_campaign( + self, + campaign_id: str, + *, + include: Union[str, UnsetType] = unset, + include_meta: Union[bool, UnsetType] = unset, + ) -> CampaignResponse: + """Get a campaign. + + Fetches a single campaign by ID or key. + + :param campaign_id: Campaign ID or key. + :type campaign_id: str + :param include: Include related data (for example, scores). + :type include: str, optional + :param include_meta: Include metadata (entity and rule counts). + :type include_meta: bool, optional + :rtype: CampaignResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["campaign_id"] = campaign_id + + if include is not unset: + kwargs["include"] = include + + if include_meta is not unset: + kwargs["include_meta"] = include_meta + + return self._get_scorecard_campaign_endpoint.call_with_http_info(**kwargs) + + def list_scorecard_campaigns( + self, + *, + page_limit: Union[int, UnsetType] = unset, + page_offset: Union[int, UnsetType] = unset, + filter_campaign_name: Union[str, UnsetType] = unset, + filter_campaign_status: Union[str, UnsetType] = unset, + filter_campaign_owner: Union[str, UnsetType] = unset, + ) -> ListCampaignsResponse: + """List all campaigns. + + Fetches all scorecard campaigns. + + :param page_limit: Maximum number of campaigns to return. + :type page_limit: int, optional + :param page_offset: Offset for pagination. + :type page_offset: int, optional + :param filter_campaign_name: Filter campaigns by name (full-text search). + :type filter_campaign_name: str, optional + :param filter_campaign_status: Filter campaigns by status. + :type filter_campaign_status: str, optional + :param filter_campaign_owner: Filter campaigns by owner UUID. + :type filter_campaign_owner: str, optional + :rtype: ListCampaignsResponse + """ + kwargs: Dict[str, Any] = {} + if page_limit is not unset: + kwargs["page_limit"] = page_limit + + if page_offset is not unset: + kwargs["page_offset"] = page_offset + + if filter_campaign_name is not unset: + kwargs["filter_campaign_name"] = filter_campaign_name + + if filter_campaign_status is not unset: + kwargs["filter_campaign_status"] = filter_campaign_status + + if filter_campaign_owner is not unset: + kwargs["filter_campaign_owner"] = filter_campaign_owner + + return self._list_scorecard_campaigns_endpoint.call_with_http_info(**kwargs) + + def list_scorecard_default_rules( + self, + ) -> ListDefaultRulesResponse: + """List default rules. + + Fetches all default scorecard rules available for the organization. + + :rtype: ListDefaultRulesResponse + """ + kwargs: Dict[str, Any] = {} + return self._list_scorecard_default_rules_endpoint.call_with_http_info(**kwargs) + + def list_scorecard_facets( + self, + *, + filter_entity_query: Union[str, UnsetType] = unset, + ) -> ListFacetsResponse: + """List entity facets. + + Fetches facets for scorecard entities with counts. + + :param filter_entity_query: Entity query filter. + :type filter_entity_query: str, optional + :rtype: ListFacetsResponse + """ + kwargs: Dict[str, Any] = {} + if filter_entity_query is not unset: + kwargs["filter_entity_query"] = filter_entity_query + + return self._list_scorecard_facets_endpoint.call_with_http_info(**kwargs) + def list_scorecard_outcomes( self, *, @@ -361,11 +977,11 @@ def list_scorecard_outcomes( :type fields_outcome: str, optional :param fields_rule: Return only specified values in the included rule details. :type fields_rule: str, optional - :param filter_outcome_service_name: Filter the outcomes on a specific service name. + :param filter_outcome_service_name: Filter outcomes on a specific service name. :type filter_outcome_service_name: str, optional - :param filter_outcome_state: Filter the outcomes by a specific state. + :param filter_outcome_state: Filter outcomes by a specific state. :type filter_outcome_state: str, optional - :param filter_rule_enabled: Filter outcomes on whether a rule is enabled/disabled. + :param filter_rule_enabled: Filter outcomes based on whether a rule is enabled or disabled. :type filter_rule_enabled: bool, optional :param filter_rule_id: Filter outcomes based on rule ID. :type filter_rule_id: str, optional @@ -434,11 +1050,11 @@ def list_scorecard_outcomes_with_pagination( :type fields_outcome: str, optional :param fields_rule: Return only specified values in the included rule details. :type fields_rule: str, optional - :param filter_outcome_service_name: Filter the outcomes on a specific service name. + :param filter_outcome_service_name: Filter outcomes on a specific service name. :type filter_outcome_service_name: str, optional - :param filter_outcome_state: Filter the outcomes by a specific state. + :param filter_outcome_state: Filter outcomes by a specific state. :type filter_outcome_state: str, optional - :param filter_rule_enabled: Filter outcomes on whether a rule is enabled/disabled. + :param filter_rule_enabled: Filter outcomes based on whether a rule is enabled or disabled. :type filter_rule_enabled: bool, optional :param filter_rule_id: Filter outcomes based on rule ID. :type filter_rule_id: str, optional @@ -649,6 +1265,148 @@ def list_scorecard_rules_with_pagination( } return endpoint.call_with_http_info_paginated(pagination) + def list_scorecards( + self, + *, + page_offset: Union[int, UnsetType] = unset, + page_size: Union[int, UnsetType] = unset, + filter_scorecard_id: Union[str, UnsetType] = unset, + filter_scorecard_name: Union[str, UnsetType] = unset, + filter_scorecard_description: Union[str, UnsetType] = unset, + ) -> ListScorecardsResponse: + """List all scorecards. + + Fetches all scorecards. + + :param page_offset: Offset for pagination. + :type page_offset: int, optional + :param page_size: Maximum number of scorecards to return. + :type page_size: int, optional + :param filter_scorecard_id: Filter by scorecard ID. + :type filter_scorecard_id: str, optional + :param filter_scorecard_name: Filter by scorecard name (partial match). + :type filter_scorecard_name: str, optional + :param filter_scorecard_description: Filter by scorecard description (partial match). + :type filter_scorecard_description: str, optional + :rtype: ListScorecardsResponse + """ + kwargs: Dict[str, Any] = {} + if page_offset is not unset: + kwargs["page_offset"] = page_offset + + if page_size is not unset: + kwargs["page_size"] = page_size + + if filter_scorecard_id is not unset: + kwargs["filter_scorecard_id"] = filter_scorecard_id + + if filter_scorecard_name is not unset: + kwargs["filter_scorecard_name"] = filter_scorecard_name + + if filter_scorecard_description is not unset: + kwargs["filter_scorecard_description"] = filter_scorecard_description + + return self._list_scorecards_endpoint.call_with_http_info(**kwargs) + + def list_scorecard_scores( + self, + aggregation: str, + *, + page_limit: Union[int, UnsetType] = unset, + page_offset: Union[int, UnsetType] = unset, + filter_entity_query: Union[str, UnsetType] = unset, + filter_rule_id: Union[str, UnsetType] = unset, + filter_rule_enabled: Union[bool, UnsetType] = unset, + filter_rule_custom: Union[bool, UnsetType] = unset, + sort: Union[str, UnsetType] = unset, + ) -> ListScoresResponse: + """List scores by aggregation. + + Fetches scorecard scores aggregated by entity, rule, scorecard, service, or team. + + :param aggregation: Aggregation type (by-entity, by-rule, by-scorecard, by-service, by-team). + :type aggregation: str + :param page_limit: Maximum number of scores to return. + :type page_limit: int, optional + :param page_offset: Offset for pagination. + :type page_offset: int, optional + :param filter_entity_query: Entity query filter. + :type filter_entity_query: str, optional + :param filter_rule_id: Filter by rule IDs (comma-separated). + :type filter_rule_id: str, optional + :param filter_rule_enabled: Filter by rule enabled status. + :type filter_rule_enabled: bool, optional + :param filter_rule_custom: Filter by custom rules. + :type filter_rule_custom: bool, optional + :param sort: Sort order (comma-separated list of fields; prefix a field with - for descending order). + :type sort: str, optional + :rtype: ListScoresResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["aggregation"] = aggregation + + if page_limit is not unset: + kwargs["page_limit"] = page_limit + + if page_offset is not unset: + kwargs["page_offset"] = page_offset + + if filter_entity_query is not unset: + kwargs["filter_entity_query"] = filter_entity_query + + if filter_rule_id is not unset: + kwargs["filter_rule_id"] = filter_rule_id + + if filter_rule_enabled is not unset: + kwargs["filter_rule_enabled"] = filter_rule_enabled + + if filter_rule_custom is not unset: + kwargs["filter_rule_custom"] = filter_rule_custom + + if sort is not unset: + kwargs["sort"] = sort + + return self._list_scorecard_scores_endpoint.call_with_http_info(**kwargs) + + def setup_scorecard_rules( + self, + body: SetupRulesRequest, + ) -> None: + """Set up rules for organization. + + Sets up default scorecard rules for the organization. + + :param body: Setup rules request. + :type body: SetupRulesRequest + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._setup_scorecard_rules_endpoint.call_with_http_info(**kwargs) + + def update_scorecard_campaign( + self, + campaign_id: str, + body: UpdateCampaignRequest, + ) -> CampaignResponse: + """Update a campaign. + + Updates an existing campaign. + + :param campaign_id: Campaign ID or key. + :type campaign_id: str + :param body: Campaign data. + :type body: UpdateCampaignRequest + :rtype: CampaignResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["campaign_id"] = campaign_id + + kwargs["body"] = body + + return self._update_scorecard_campaign_endpoint.call_with_http_info(**kwargs) + def update_scorecard_outcomes_async( self, body: UpdateOutcomesAsyncRequest, @@ -687,3 +1445,25 @@ def update_scorecard_rule( kwargs["body"] = body return self._update_scorecard_rule_endpoint.call_with_http_info(**kwargs) + + def update_scorecard_rule_workflow( + self, + rule_id: str, + workflow_id: str, + ) -> None: + """Associate workflow with rule. + + Associates a workflow with a scorecard rule. + + :param rule_id: The ID of the rule. + :type rule_id: str + :param workflow_id: Workflow ID. + :type workflow_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["rule_id"] = rule_id + + kwargs["workflow_id"] = workflow_id + + return self._update_scorecard_rule_workflow_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/model/campaign_response.py b/src/datadog_api_client/v2/model/campaign_response.py new file mode 100644 index 0000000000..a2c3a99d28 --- /dev/null +++ b/src/datadog_api_client/v2/model/campaign_response.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.campaign_response_data import CampaignResponseData + + +class CampaignResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.campaign_response_data import CampaignResponseData + + return { + "data": (CampaignResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: CampaignResponseData, **kwargs): + """ + Response containing campaign data. + + :param data: Campaign data. + :type data: CampaignResponseData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/campaign_response_attributes.py b/src/datadog_api_client/v2/model/campaign_response_attributes.py new file mode 100644 index 0000000000..e1579f8016 --- /dev/null +++ b/src/datadog_api_client/v2/model/campaign_response_attributes.py @@ -0,0 +1,115 @@ +# 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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + unset, + UnsetType, +) + + +class CampaignResponseAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "created_at": (datetime,), + "description": (str,), + "due_date": (datetime,), + "entity_scope": (str,), + "guidance": (str,), + "key": (str,), + "modified_at": (datetime,), + "name": (str,), + "owner": (str,), + "start_date": (datetime,), + "status": (str,), + } + + attribute_map = { + "created_at": "created_at", + "description": "description", + "due_date": "due_date", + "entity_scope": "entity_scope", + "guidance": "guidance", + "key": "key", + "modified_at": "modified_at", + "name": "name", + "owner": "owner", + "start_date": "start_date", + "status": "status", + } + + def __init__( + self_, + created_at: datetime, + key: str, + modified_at: datetime, + name: str, + owner: str, + start_date: datetime, + status: str, + description: Union[str, UnsetType] = unset, + due_date: Union[datetime, UnsetType] = unset, + entity_scope: Union[str, UnsetType] = unset, + guidance: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Campaign attributes. + + :param created_at: Creation time of the campaign. + :type created_at: datetime + + :param description: The description of the campaign. + :type description: str, optional + + :param due_date: The due date of the campaign. + :type due_date: datetime, optional + + :param entity_scope: Entity scope query to filter entities for this campaign. + :type entity_scope: str, optional + + :param guidance: Guidance for the campaign. + :type guidance: str, optional + + :param key: The unique key for the campaign. + :type key: str + + :param modified_at: Time of last campaign modification. + :type modified_at: datetime + + :param name: The name of the campaign. + :type name: str + + :param owner: The UUID of the campaign owner. + :type owner: str + + :param start_date: The start date of the campaign. + :type start_date: datetime + + :param status: The status of the campaign. + :type status: str + """ + if description is not unset: + kwargs["description"] = description + if due_date is not unset: + kwargs["due_date"] = due_date + if entity_scope is not unset: + kwargs["entity_scope"] = entity_scope + if guidance is not unset: + kwargs["guidance"] = guidance + super().__init__(kwargs) + + self_.created_at = created_at + self_.key = key + self_.modified_at = modified_at + self_.name = name + self_.owner = owner + self_.start_date = start_date + self_.status = status diff --git a/src/datadog_api_client/v2/model/campaign_response_data.py b/src/datadog_api_client/v2/model/campaign_response_data.py new file mode 100644 index 0000000000..e933789262 --- /dev/null +++ b/src/datadog_api_client/v2/model/campaign_response_data.py @@ -0,0 +1,54 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.campaign_response_attributes import CampaignResponseAttributes + from datadog_api_client.v2.model.campaign_type import CampaignType + + +class CampaignResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.campaign_response_attributes import CampaignResponseAttributes + from datadog_api_client.v2.model.campaign_type import CampaignType + + return { + "attributes": (CampaignResponseAttributes,), + "id": (str,), + "type": (CampaignType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: CampaignResponseAttributes, id: str, type: CampaignType, **kwargs): + """ + Campaign data. + + :param attributes: Campaign attributes. + :type attributes: CampaignResponseAttributes + + :param id: The unique ID of the campaign. + :type id: str + + :param type: The JSON:API type for campaigns. + :type type: CampaignType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/campaign_status.py b/src/datadog_api_client/v2/model/campaign_status.py new file mode 100644 index 0000000000..0f95364353 --- /dev/null +++ b/src/datadog_api_client/v2/model/campaign_status.py @@ -0,0 +1,41 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class CampaignStatus(ModelSimple): + """ + The status of the campaign. + + :param value: Must be one of ["in_progress", "not_started", "completed"]. + :type value: str + """ + + allowed_values = { + "in_progress", + "not_started", + "completed", + } + IN_PROGRESS: ClassVar["CampaignStatus"] + NOT_STARTED: ClassVar["CampaignStatus"] + COMPLETED: ClassVar["CampaignStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CampaignStatus.IN_PROGRESS = CampaignStatus("in_progress") +CampaignStatus.NOT_STARTED = CampaignStatus("not_started") +CampaignStatus.COMPLETED = CampaignStatus("completed") diff --git a/src/datadog_api_client/v2/model/campaign_type.py b/src/datadog_api_client/v2/model/campaign_type.py new file mode 100644 index 0000000000..ad488b91d0 --- /dev/null +++ b/src/datadog_api_client/v2/model/campaign_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class CampaignType(ModelSimple): + """ + The JSON:API type for campaigns. + + :param value: If omitted defaults to "campaign". Must be one of ["campaign"]. + :type value: str + """ + + allowed_values = { + "campaign", + } + CAMPAIGN: ClassVar["CampaignType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CampaignType.CAMPAIGN = CampaignType("campaign") diff --git a/src/datadog_api_client/v2/model/create_campaign_request.py b/src/datadog_api_client/v2/model/create_campaign_request.py new file mode 100644 index 0000000000..658bb1cedc --- /dev/null +++ b/src/datadog_api_client/v2/model/create_campaign_request.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_campaign_request_data import CreateCampaignRequestData + + +class CreateCampaignRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_campaign_request_data import CreateCampaignRequestData + + return { + "data": (CreateCampaignRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: CreateCampaignRequestData, **kwargs): + """ + Request to create a new campaign. + + :param data: Data for creating a new campaign. + :type data: CreateCampaignRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/create_campaign_request_attributes.py b/src/datadog_api_client/v2/model/create_campaign_request_attributes.py new file mode 100644 index 0000000000..8eade9761c --- /dev/null +++ b/src/datadog_api_client/v2/model/create_campaign_request_attributes.py @@ -0,0 +1,115 @@ +# 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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.campaign_status import CampaignStatus + + +class CreateCampaignRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.campaign_status import CampaignStatus + + return { + "description": (str,), + "due_date": (datetime,), + "entity_scope": (str,), + "guidance": (str,), + "key": (str,), + "name": (str,), + "owner_id": (str,), + "rule_ids": ([str],), + "start_date": (datetime,), + "status": (CampaignStatus,), + } + + attribute_map = { + "description": "description", + "due_date": "due_date", + "entity_scope": "entity_scope", + "guidance": "guidance", + "key": "key", + "name": "name", + "owner_id": "owner_id", + "rule_ids": "rule_ids", + "start_date": "start_date", + "status": "status", + } + + def __init__( + self_, + key: str, + name: str, + owner_id: str, + rule_ids: List[str], + start_date: datetime, + description: Union[str, UnsetType] = unset, + due_date: Union[datetime, UnsetType] = unset, + entity_scope: Union[str, UnsetType] = unset, + guidance: Union[str, UnsetType] = unset, + status: Union[CampaignStatus, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for creating a new campaign. + + :param description: The description of the campaign. + :type description: str, optional + + :param due_date: The due date of the campaign. + :type due_date: datetime, optional + + :param entity_scope: Entity scope query to filter entities for this campaign. + :type entity_scope: str, optional + + :param guidance: Guidance for the campaign. + :type guidance: str, optional + + :param key: The unique key for the campaign. + :type key: str + + :param name: The name of the campaign. + :type name: str + + :param owner_id: The UUID of the campaign owner. + :type owner_id: str + + :param rule_ids: Array of rule IDs associated with this campaign. + :type rule_ids: [str] + + :param start_date: The start date of the campaign. + :type start_date: datetime + + :param status: The status of the campaign. + :type status: CampaignStatus, optional + """ + if description is not unset: + kwargs["description"] = description + if due_date is not unset: + kwargs["due_date"] = due_date + if entity_scope is not unset: + kwargs["entity_scope"] = entity_scope + if guidance is not unset: + kwargs["guidance"] = guidance + if status is not unset: + kwargs["status"] = status + super().__init__(kwargs) + + self_.key = key + self_.name = name + self_.owner_id = owner_id + self_.rule_ids = rule_ids + self_.start_date = start_date diff --git a/src/datadog_api_client/v2/model/create_campaign_request_data.py b/src/datadog_api_client/v2/model/create_campaign_request_data.py new file mode 100644 index 0000000000..c9e307e1f4 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_campaign_request_data.py @@ -0,0 +1,48 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_campaign_request_attributes import CreateCampaignRequestAttributes + from datadog_api_client.v2.model.campaign_type import CampaignType + + +class CreateCampaignRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_campaign_request_attributes import CreateCampaignRequestAttributes + from datadog_api_client.v2.model.campaign_type import CampaignType + + return { + "attributes": (CreateCampaignRequestAttributes,), + "type": (CampaignType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: CreateCampaignRequestAttributes, type: CampaignType, **kwargs): + """ + Data for creating a new campaign. + + :param attributes: Attributes for creating a new campaign. + :type attributes: CreateCampaignRequestAttributes + + :param type: The JSON:API type for campaigns. + :type type: CampaignType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/default_rule_response_attributes.py b/src/datadog_api_client/v2/model/default_rule_response_attributes.py new file mode 100644 index 0000000000..5e5a9faeff --- /dev/null +++ b/src/datadog_api_client/v2/model/default_rule_response_attributes.py @@ -0,0 +1,79 @@ +# 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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class DefaultRuleResponseAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "description": (str,), + "level": (int,), + "name": (str,), + "scope_required": (str,), + "scorecard_description": (str,), + "scorecard_name": (str,), + } + + attribute_map = { + "description": "description", + "level": "level", + "name": "name", + "scope_required": "scope_required", + "scorecard_description": "scorecard_description", + "scorecard_name": "scorecard_name", + } + + def __init__( + self_, + name: str, + scorecard_name: str, + description: Union[str, UnsetType] = unset, + level: Union[int, UnsetType] = unset, + scope_required: Union[str, UnsetType] = unset, + scorecard_description: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Default rule attributes. + + :param description: The description of the default rule. + :type description: str, optional + + :param level: The maturity level of the rule. + :type level: int, optional + + :param name: The name of the default rule. + :type name: str + + :param scope_required: Required scope for the rule. + :type scope_required: str, optional + + :param scorecard_description: The description of the scorecard. + :type scorecard_description: str, optional + + :param scorecard_name: The scorecard this rule belongs to. + :type scorecard_name: str + """ + if description is not unset: + kwargs["description"] = description + if level is not unset: + kwargs["level"] = level + if scope_required is not unset: + kwargs["scope_required"] = scope_required + if scorecard_description is not unset: + kwargs["scorecard_description"] = scorecard_description + super().__init__(kwargs) + + self_.name = name + self_.scorecard_name = scorecard_name diff --git a/src/datadog_api_client/v2/model/default_rule_response_data.py b/src/datadog_api_client/v2/model/default_rule_response_data.py new file mode 100644 index 0000000000..624026e275 --- /dev/null +++ b/src/datadog_api_client/v2/model/default_rule_response_data.py @@ -0,0 +1,54 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.default_rule_response_attributes import DefaultRuleResponseAttributes + from datadog_api_client.v2.model.default_rule_type import DefaultRuleType + + +class DefaultRuleResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.default_rule_response_attributes import DefaultRuleResponseAttributes + from datadog_api_client.v2.model.default_rule_type import DefaultRuleType + + return { + "attributes": (DefaultRuleResponseAttributes,), + "id": (str,), + "type": (DefaultRuleType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: DefaultRuleResponseAttributes, id: str, type: DefaultRuleType, **kwargs): + """ + Default rule data. + + :param attributes: Default rule attributes. + :type attributes: DefaultRuleResponseAttributes + + :param id: The unique ID of the default rule. + :type id: str + + :param type: The JSON:API type for default rules. + :type type: DefaultRuleType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/default_rule_type.py b/src/datadog_api_client/v2/model/default_rule_type.py new file mode 100644 index 0000000000..3047b76c95 --- /dev/null +++ b/src/datadog_api_client/v2/model/default_rule_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class DefaultRuleType(ModelSimple): + """ + The JSON:API type for default rules. + + :param value: If omitted defaults to "default-rule". Must be one of ["default-rule"]. + :type value: str + """ + + allowed_values = { + "default-rule", + } + DEFAULT_RULE: ClassVar["DefaultRuleType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +DefaultRuleType.DEFAULT_RULE = DefaultRuleType("default-rule") diff --git a/src/datadog_api_client/v2/model/entity_owner_destination.py b/src/datadog_api_client/v2/model/entity_owner_destination.py new file mode 100644 index 0000000000..c63f473397 --- /dev/null +++ b/src/datadog_api_client/v2/model/entity_owner_destination.py @@ -0,0 +1,46 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.slack_routing_options import SlackRoutingOptions + + +class EntityOwnerDestination(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.slack_routing_options import SlackRoutingOptions + + return { + "slack": (SlackRoutingOptions,), + "team_id": (str,), + } + + attribute_map = { + "slack": "slack", + "team_id": "team_id", + } + + def __init__(self_, slack: SlackRoutingOptions, team_id: str, **kwargs): + """ + Entity owner and Slack destination for team reports. + + :param slack: Slack routing options for report delivery. + :type slack: SlackRoutingOptions + + :param team_id: Team UUID. + :type team_id: str + """ + super().__init__(kwargs) + + self_.slack = slack + self_.team_id = team_id diff --git a/src/datadog_api_client/v2/model/facet_item.py b/src/datadog_api_client/v2/model/facet_item.py new file mode 100644 index 0000000000..1e2bd7c7b2 --- /dev/null +++ b/src/datadog_api_client/v2/model/facet_item.py @@ -0,0 +1,39 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class FacetItem(ModelNormal): + @cached_property + def openapi_types(_): + return { + "name": (str,), + "value": (int,), + } + + attribute_map = { + "name": "name", + "value": "value", + } + + def __init__(self_, name: str, value: int, **kwargs): + """ + Facet item with count. + + :param name: The name of the facet value. + :type name: str + + :param value: The count for this facet value. + :type value: int + """ + super().__init__(kwargs) + + self_.name = name + self_.value = value diff --git a/src/datadog_api_client/v2/model/facet_response_attributes.py b/src/datadog_api_client/v2/model/facet_response_attributes.py new file mode 100644 index 0000000000..60e2f633a8 --- /dev/null +++ b/src/datadog_api_client/v2/model/facet_response_attributes.py @@ -0,0 +1,55 @@ +# 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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.facet_item import FacetItem + + +class FacetResponseAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.facet_item import FacetItem + + return { + "items": ([FacetItem],), + "key": (str,), + "name": (str,), + } + + attribute_map = { + "items": "items", + "key": "key", + "name": "name", + } + + def __init__(self_, items: List[FacetItem], key: str, name: Union[str, UnsetType] = unset, **kwargs): + """ + Facet attributes. + + :param items: Array of facet values. + :type items: [FacetItem] + + :param key: The key of the facet. + :type key: str + + :param name: The display name of the facet. + :type name: str, optional + """ + if name is not unset: + kwargs["name"] = name + super().__init__(kwargs) + + self_.items = items + self_.key = key diff --git a/src/datadog_api_client/v2/model/facet_response_data.py b/src/datadog_api_client/v2/model/facet_response_data.py new file mode 100644 index 0000000000..01cb231b75 --- /dev/null +++ b/src/datadog_api_client/v2/model/facet_response_data.py @@ -0,0 +1,54 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.facet_response_attributes import FacetResponseAttributes + from datadog_api_client.v2.model.facet_type import FacetType + + +class FacetResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.facet_response_attributes import FacetResponseAttributes + from datadog_api_client.v2.model.facet_type import FacetType + + return { + "attributes": (FacetResponseAttributes,), + "id": (str,), + "type": (FacetType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: FacetResponseAttributes, id: str, type: FacetType, **kwargs): + """ + Facet data. + + :param attributes: Facet attributes. + :type attributes: FacetResponseAttributes + + :param id: The unique ID of the facet. + :type id: str + + :param type: The JSON:API type for facets. + :type type: FacetType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/facet_type.py b/src/datadog_api_client/v2/model/facet_type.py new file mode 100644 index 0000000000..daea455954 --- /dev/null +++ b/src/datadog_api_client/v2/model/facet_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class FacetType(ModelSimple): + """ + The JSON:API type for facets. + + :param value: If omitted defaults to "facet". Must be one of ["facet"]. + :type value: str + """ + + allowed_values = { + "facet", + } + FACET: ClassVar["FacetType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FacetType.FACET = FacetType("facet") diff --git a/src/datadog_api_client/v2/model/generate_campaign_report_request.py b/src/datadog_api_client/v2/model/generate_campaign_report_request.py new file mode 100644 index 0000000000..182cd6f55e --- /dev/null +++ b/src/datadog_api_client/v2/model/generate_campaign_report_request.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.generate_campaign_report_request_data import GenerateCampaignReportRequestData + + +class GenerateCampaignReportRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.generate_campaign_report_request_data import GenerateCampaignReportRequestData + + return { + "data": (GenerateCampaignReportRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: GenerateCampaignReportRequestData, **kwargs): + """ + Request to generate a campaign report. + + :param data: Data for generating a campaign report. + :type data: GenerateCampaignReportRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/generate_campaign_report_request_attributes.py b/src/datadog_api_client/v2/model/generate_campaign_report_request_attributes.py new file mode 100644 index 0000000000..d525f5b080 --- /dev/null +++ b/src/datadog_api_client/v2/model/generate_campaign_report_request_attributes.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.slack_routing_options import SlackRoutingOptions + + +class GenerateCampaignReportRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.slack_routing_options import SlackRoutingOptions + + return { + "slack": (SlackRoutingOptions,), + } + + attribute_map = { + "slack": "slack", + } + + def __init__(self_, slack: SlackRoutingOptions, **kwargs): + """ + Attributes for generating a campaign report. + + :param slack: Slack routing options for report delivery. + :type slack: SlackRoutingOptions + """ + super().__init__(kwargs) + + self_.slack = slack diff --git a/src/datadog_api_client/v2/model/generate_campaign_report_request_data.py b/src/datadog_api_client/v2/model/generate_campaign_report_request_data.py new file mode 100644 index 0000000000..cf9b840666 --- /dev/null +++ b/src/datadog_api_client/v2/model/generate_campaign_report_request_data.py @@ -0,0 +1,61 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.generate_campaign_report_request_attributes import ( + GenerateCampaignReportRequestAttributes, + ) + from datadog_api_client.v2.model.generate_campaign_report_request_data_type import ( + GenerateCampaignReportRequestDataType, + ) + + +class GenerateCampaignReportRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.generate_campaign_report_request_attributes import ( + GenerateCampaignReportRequestAttributes, + ) + from datadog_api_client.v2.model.generate_campaign_report_request_data_type import ( + GenerateCampaignReportRequestDataType, + ) + + return { + "attributes": (GenerateCampaignReportRequestAttributes,), + "type": (GenerateCampaignReportRequestDataType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, + attributes: GenerateCampaignReportRequestAttributes, + type: GenerateCampaignReportRequestDataType, + **kwargs, + ): + """ + Data for generating a campaign report. + + :param attributes: Attributes for generating a campaign report. + :type attributes: GenerateCampaignReportRequestAttributes + + :param type: + :type type: GenerateCampaignReportRequestDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/generate_campaign_report_request_data_type.py b/src/datadog_api_client/v2/model/generate_campaign_report_request_data_type.py new file mode 100644 index 0000000000..fd37164ff7 --- /dev/null +++ b/src/datadog_api_client/v2/model/generate_campaign_report_request_data_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class GenerateCampaignReportRequestDataType(ModelSimple): + """ + + + :param value: If omitted defaults to "campaign-report". Must be one of ["campaign-report"]. + :type value: str + """ + + allowed_values = { + "campaign-report", + } + CAMPAIGN_REPORT: ClassVar["GenerateCampaignReportRequestDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +GenerateCampaignReportRequestDataType.CAMPAIGN_REPORT = GenerateCampaignReportRequestDataType("campaign-report") diff --git a/src/datadog_api_client/v2/model/generate_campaign_team_reports_request.py b/src/datadog_api_client/v2/model/generate_campaign_team_reports_request.py new file mode 100644 index 0000000000..70ef08290a --- /dev/null +++ b/src/datadog_api_client/v2/model/generate_campaign_team_reports_request.py @@ -0,0 +1,44 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.generate_campaign_team_reports_request_data import ( + GenerateCampaignTeamReportsRequestData, + ) + + +class GenerateCampaignTeamReportsRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.generate_campaign_team_reports_request_data import ( + GenerateCampaignTeamReportsRequestData, + ) + + return { + "data": (GenerateCampaignTeamReportsRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: GenerateCampaignTeamReportsRequestData, **kwargs): + """ + Request to generate team-specific campaign reports. + + :param data: Data for generating team campaign reports. + :type data: GenerateCampaignTeamReportsRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/generate_campaign_team_reports_request_attributes.py b/src/datadog_api_client/v2/model/generate_campaign_team_reports_request_attributes.py new file mode 100644 index 0000000000..1fa8fa97cb --- /dev/null +++ b/src/datadog_api_client/v2/model/generate_campaign_team_reports_request_attributes.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.entity_owner_destination import EntityOwnerDestination + + +class GenerateCampaignTeamReportsRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.entity_owner_destination import EntityOwnerDestination + + return { + "entity_owners": ([EntityOwnerDestination],), + } + + attribute_map = { + "entity_owners": "entity_owners", + } + + def __init__(self_, entity_owners: List[EntityOwnerDestination], **kwargs): + """ + Attributes for generating team campaign reports. + + :param entity_owners: List of entity owners and their Slack destinations. + :type entity_owners: [EntityOwnerDestination] + """ + super().__init__(kwargs) + + self_.entity_owners = entity_owners diff --git a/src/datadog_api_client/v2/model/generate_campaign_team_reports_request_data.py b/src/datadog_api_client/v2/model/generate_campaign_team_reports_request_data.py new file mode 100644 index 0000000000..29fbca0673 --- /dev/null +++ b/src/datadog_api_client/v2/model/generate_campaign_team_reports_request_data.py @@ -0,0 +1,61 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.generate_campaign_team_reports_request_attributes import ( + GenerateCampaignTeamReportsRequestAttributes, + ) + from datadog_api_client.v2.model.generate_campaign_team_reports_request_data_type import ( + GenerateCampaignTeamReportsRequestDataType, + ) + + +class GenerateCampaignTeamReportsRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.generate_campaign_team_reports_request_attributes import ( + GenerateCampaignTeamReportsRequestAttributes, + ) + from datadog_api_client.v2.model.generate_campaign_team_reports_request_data_type import ( + GenerateCampaignTeamReportsRequestDataType, + ) + + return { + "attributes": (GenerateCampaignTeamReportsRequestAttributes,), + "type": (GenerateCampaignTeamReportsRequestDataType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, + attributes: GenerateCampaignTeamReportsRequestAttributes, + type: GenerateCampaignTeamReportsRequestDataType, + **kwargs, + ): + """ + Data for generating team campaign reports. + + :param attributes: Attributes for generating team campaign reports. + :type attributes: GenerateCampaignTeamReportsRequestAttributes + + :param type: + :type type: GenerateCampaignTeamReportsRequestDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/generate_campaign_team_reports_request_data_type.py b/src/datadog_api_client/v2/model/generate_campaign_team_reports_request_data_type.py new file mode 100644 index 0000000000..2d322d7a91 --- /dev/null +++ b/src/datadog_api_client/v2/model/generate_campaign_team_reports_request_data_type.py @@ -0,0 +1,37 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class GenerateCampaignTeamReportsRequestDataType(ModelSimple): + """ + + + :param value: If omitted defaults to "campaign-team-report". Must be one of ["campaign-team-report"]. + :type value: str + """ + + allowed_values = { + "campaign-team-report", + } + CAMPAIGN_TEAM_REPORT: ClassVar["GenerateCampaignTeamReportsRequestDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +GenerateCampaignTeamReportsRequestDataType.CAMPAIGN_TEAM_REPORT = GenerateCampaignTeamReportsRequestDataType( + "campaign-team-report" +) diff --git a/src/datadog_api_client/v2/model/list_campaigns_response.py b/src/datadog_api_client/v2/model/list_campaigns_response.py new file mode 100644 index 0000000000..062a11da07 --- /dev/null +++ b/src/datadog_api_client/v2/model/list_campaigns_response.py @@ -0,0 +1,48 @@ +# 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. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.campaign_response_data import CampaignResponseData + from datadog_api_client.v2.model.paginated_response_meta import PaginatedResponseMeta + + +class ListCampaignsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.campaign_response_data import CampaignResponseData + from datadog_api_client.v2.model.paginated_response_meta import PaginatedResponseMeta + + return { + "data": ([CampaignResponseData],), + "meta": (PaginatedResponseMeta,), + } + + attribute_map = { + "data": "data", + "meta": "meta", + } + + def __init__(self_, data: List[CampaignResponseData], meta: PaginatedResponseMeta, **kwargs): + """ + Response containing a list of campaigns. + + :param data: Array of campaigns. + :type data: [CampaignResponseData] + + :param meta: Metadata for scores response. + :type meta: PaginatedResponseMeta + """ + super().__init__(kwargs) + + self_.data = data + self_.meta = meta diff --git a/src/datadog_api_client/v2/model/list_default_rules_response.py b/src/datadog_api_client/v2/model/list_default_rules_response.py new file mode 100644 index 0000000000..237240975f --- /dev/null +++ b/src/datadog_api_client/v2/model/list_default_rules_response.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.default_rule_response_data import DefaultRuleResponseData + + +class ListDefaultRulesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.default_rule_response_data import DefaultRuleResponseData + + return { + "data": ([DefaultRuleResponseData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[DefaultRuleResponseData], **kwargs): + """ + Response containing a list of default rules. + + :param data: Array of default rules. + :type data: [DefaultRuleResponseData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/list_facets_response.py b/src/datadog_api_client/v2/model/list_facets_response.py new file mode 100644 index 0000000000..671b35f1fe --- /dev/null +++ b/src/datadog_api_client/v2/model/list_facets_response.py @@ -0,0 +1,48 @@ +# 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. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.facet_response_data import FacetResponseData + from datadog_api_client.v2.model.list_facets_response_meta import ListFacetsResponseMeta + + +class ListFacetsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.facet_response_data import FacetResponseData + from datadog_api_client.v2.model.list_facets_response_meta import ListFacetsResponseMeta + + return { + "data": ([FacetResponseData],), + "meta": (ListFacetsResponseMeta,), + } + + attribute_map = { + "data": "data", + "meta": "meta", + } + + def __init__(self_, data: List[FacetResponseData], meta: ListFacetsResponseMeta, **kwargs): + """ + Response containing a list of facets. + + :param data: Array of facets. + :type data: [FacetResponseData] + + :param meta: Metadata for facets response. + :type meta: ListFacetsResponseMeta + """ + super().__init__(kwargs) + + self_.data = data + self_.meta = meta diff --git a/src/datadog_api_client/v2/model/list_facets_response_meta.py b/src/datadog_api_client/v2/model/list_facets_response_meta.py new file mode 100644 index 0000000000..74c19bb54b --- /dev/null +++ b/src/datadog_api_client/v2/model/list_facets_response_meta.py @@ -0,0 +1,33 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class ListFacetsResponseMeta(ModelNormal): + @cached_property + def openapi_types(_): + return { + "total_entities": (int,), + } + + attribute_map = { + "total_entities": "total_entities", + } + + def __init__(self_, total_entities: int, **kwargs): + """ + Metadata for facets response. + + :param total_entities: Total number of entities. + :type total_entities: int + """ + super().__init__(kwargs) + + self_.total_entities = total_entities diff --git a/src/datadog_api_client/v2/model/list_scorecards_response.py b/src/datadog_api_client/v2/model/list_scorecards_response.py new file mode 100644 index 0000000000..4685773b40 --- /dev/null +++ b/src/datadog_api_client/v2/model/list_scorecards_response.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.scorecard_list_response_data import ScorecardListResponseData + + +class ListScorecardsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.scorecard_list_response_data import ScorecardListResponseData + + return { + "data": ([ScorecardListResponseData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[ScorecardListResponseData], **kwargs): + """ + Response containing a list of scorecards. + + :param data: Array of scorecards. + :type data: [ScorecardListResponseData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/list_scores_response.py b/src/datadog_api_client/v2/model/list_scores_response.py new file mode 100644 index 0000000000..f91a1fbde4 --- /dev/null +++ b/src/datadog_api_client/v2/model/list_scores_response.py @@ -0,0 +1,48 @@ +# 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. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.score_response_data import ScoreResponseData + from datadog_api_client.v2.model.paginated_response_meta import PaginatedResponseMeta + + +class ListScoresResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.score_response_data import ScoreResponseData + from datadog_api_client.v2.model.paginated_response_meta import PaginatedResponseMeta + + return { + "data": ([ScoreResponseData],), + "meta": (PaginatedResponseMeta,), + } + + attribute_map = { + "data": "data", + "meta": "meta", + } + + def __init__(self_, data: List[ScoreResponseData], meta: PaginatedResponseMeta, **kwargs): + """ + Response containing a list of scores. + + :param data: Array of scores. + :type data: [ScoreResponseData] + + :param meta: Metadata for scores response. + :type meta: PaginatedResponseMeta + """ + super().__init__(kwargs) + + self_.data = data + self_.meta = meta diff --git a/src/datadog_api_client/v2/model/paginated_response_meta.py b/src/datadog_api_client/v2/model/paginated_response_meta.py new file mode 100644 index 0000000000..56939d857c --- /dev/null +++ b/src/datadog_api_client/v2/model/paginated_response_meta.py @@ -0,0 +1,51 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class PaginatedResponseMeta(ModelNormal): + @cached_property + def openapi_types(_): + return { + "count": (int,), + "limit": (int,), + "offset": (int,), + "total": (int,), + } + + attribute_map = { + "count": "count", + "limit": "limit", + "offset": "offset", + "total": "total", + } + + def __init__(self_, count: int, limit: int, offset: int, total: int, **kwargs): + """ + Metadata for scores response. + + :param count: Number of entities in this response. + :type count: int + + :param limit: Pagination limit. + :type limit: int + + :param offset: Pagination offset. + :type offset: int + + :param total: Total number of entities available. + :type total: int + """ + super().__init__(kwargs) + + self_.count = count + self_.limit = limit + self_.offset = offset + self_.total = total diff --git a/src/datadog_api_client/v2/model/score_response_attributes.py b/src/datadog_api_client/v2/model/score_response_attributes.py new file mode 100644 index 0000000000..75cffa5145 --- /dev/null +++ b/src/datadog_api_client/v2/model/score_response_attributes.py @@ -0,0 +1,86 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class ScoreResponseAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "aggregation": (str,), + "denominator": (int,), + "numerator": (int,), + "score": (float,), + "total_fail": (int,), + "total_no_data": (int,), + "total_pass": (int,), + "total_skip": (int,), + } + + attribute_map = { + "aggregation": "aggregation", + "denominator": "denominator", + "numerator": "numerator", + "score": "score", + "total_fail": "total_fail", + "total_no_data": "total_no_data", + "total_pass": "total_pass", + "total_skip": "total_skip", + } + + def __init__( + self_, + aggregation: str, + denominator: int, + numerator: int, + score: float, + total_fail: int, + total_no_data: int, + total_pass: int, + total_skip: int, + **kwargs, + ): + """ + Score attributes. + + :param aggregation: The aggregation type. + :type aggregation: str + + :param denominator: Score denominator. + :type denominator: int + + :param numerator: Score numerator. + :type numerator: int + + :param score: Calculated score value. + :type score: float + + :param total_fail: Total number of failing rules. + :type total_fail: int + + :param total_no_data: Total number of rules with no data. + :type total_no_data: int + + :param total_pass: Total number of passing rules. + :type total_pass: int + + :param total_skip: Total number of skipped rules. + :type total_skip: int + """ + super().__init__(kwargs) + + self_.aggregation = aggregation + self_.denominator = denominator + self_.numerator = numerator + self_.score = score + self_.total_fail = total_fail + self_.total_no_data = total_no_data + self_.total_pass = total_pass + self_.total_skip = total_skip diff --git a/src/datadog_api_client/v2/model/score_response_data.py b/src/datadog_api_client/v2/model/score_response_data.py new file mode 100644 index 0000000000..9911198cd2 --- /dev/null +++ b/src/datadog_api_client/v2/model/score_response_data.py @@ -0,0 +1,54 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.score_response_attributes import ScoreResponseAttributes + from datadog_api_client.v2.model.score_type import ScoreType + + +class ScoreResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.score_response_attributes import ScoreResponseAttributes + from datadog_api_client.v2.model.score_type import ScoreType + + return { + "attributes": (ScoreResponseAttributes,), + "id": (str,), + "type": (ScoreType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: ScoreResponseAttributes, id: str, type: ScoreType, **kwargs): + """ + Score data. + + :param attributes: Score attributes. + :type attributes: ScoreResponseAttributes + + :param id: The unique ID of the score entity. + :type id: str + + :param type: The JSON:API type for scores. + :type type: ScoreType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/score_type.py b/src/datadog_api_client/v2/model/score_type.py new file mode 100644 index 0000000000..607ad5c830 --- /dev/null +++ b/src/datadog_api_client/v2/model/score_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ScoreType(ModelSimple): + """ + The JSON:API type for scores. + + :param value: If omitted defaults to "score". Must be one of ["score"]. + :type value: str + """ + + allowed_values = { + "score", + } + SCORE: ClassVar["ScoreType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ScoreType.SCORE = ScoreType("score") diff --git a/src/datadog_api_client/v2/model/scorecard_list_response_attributes.py b/src/datadog_api_client/v2/model/scorecard_list_response_attributes.py new file mode 100644 index 0000000000..db0ea8b618 --- /dev/null +++ b/src/datadog_api_client/v2/model/scorecard_list_response_attributes.py @@ -0,0 +1,63 @@ +# 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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + unset, + UnsetType, +) + + +class ScorecardListResponseAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "created_at": (datetime,), + "description": (str,), + "modified_at": (datetime,), + "name": (str,), + } + + attribute_map = { + "created_at": "created_at", + "description": "description", + "modified_at": "modified_at", + "name": "name", + } + + def __init__( + self_, + created_at: datetime, + modified_at: datetime, + name: str, + description: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Scorecard attributes. + + :param created_at: Creation time of the scorecard. + :type created_at: datetime + + :param description: The description of the scorecard. + :type description: str, optional + + :param modified_at: Time of last scorecard modification. + :type modified_at: datetime + + :param name: The name of the scorecard. + :type name: str + """ + if description is not unset: + kwargs["description"] = description + super().__init__(kwargs) + + self_.created_at = created_at + self_.modified_at = modified_at + self_.name = name diff --git a/src/datadog_api_client/v2/model/scorecard_list_response_data.py b/src/datadog_api_client/v2/model/scorecard_list_response_data.py new file mode 100644 index 0000000000..f0cf6821dd --- /dev/null +++ b/src/datadog_api_client/v2/model/scorecard_list_response_data.py @@ -0,0 +1,54 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.scorecard_list_response_attributes import ScorecardListResponseAttributes + from datadog_api_client.v2.model.scorecard_list_type import ScorecardListType + + +class ScorecardListResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.scorecard_list_response_attributes import ScorecardListResponseAttributes + from datadog_api_client.v2.model.scorecard_list_type import ScorecardListType + + return { + "attributes": (ScorecardListResponseAttributes,), + "id": (str,), + "type": (ScorecardListType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: ScorecardListResponseAttributes, id: str, type: ScorecardListType, **kwargs): + """ + Scorecard data. + + :param attributes: Scorecard attributes. + :type attributes: ScorecardListResponseAttributes + + :param id: The unique ID of the scorecard. + :type id: str + + :param type: The JSON:API type for scorecard list. + :type type: ScorecardListType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/scorecard_list_type.py b/src/datadog_api_client/v2/model/scorecard_list_type.py new file mode 100644 index 0000000000..264cf27f80 --- /dev/null +++ b/src/datadog_api_client/v2/model/scorecard_list_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ScorecardListType(ModelSimple): + """ + The JSON:API type for scorecard list. + + :param value: If omitted defaults to "scorecard". Must be one of ["scorecard"]. + :type value: str + """ + + allowed_values = { + "scorecard", + } + SCORECARD: ClassVar["ScorecardListType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ScorecardListType.SCORECARD = ScorecardListType("scorecard") diff --git a/src/datadog_api_client/v2/model/setup_rules_request.py b/src/datadog_api_client/v2/model/setup_rules_request.py new file mode 100644 index 0000000000..8ce70cb616 --- /dev/null +++ b/src/datadog_api_client/v2/model/setup_rules_request.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.setup_rules_request_data import SetupRulesRequestData + + +class SetupRulesRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.setup_rules_request_data import SetupRulesRequestData + + return { + "data": (SetupRulesRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: SetupRulesRequestData, **kwargs): + """ + Request to set up rules for an organization. + + :param data: Data for setting up rules. + :type data: SetupRulesRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/setup_rules_request_attributes.py b/src/datadog_api_client/v2/model/setup_rules_request_attributes.py new file mode 100644 index 0000000000..4ef535edd7 --- /dev/null +++ b/src/datadog_api_client/v2/model/setup_rules_request_attributes.py @@ -0,0 +1,36 @@ +# 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. +from __future__ import annotations + +from typing import List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class SetupRulesRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "disabled_default_rules": ([str],), + } + + attribute_map = { + "disabled_default_rules": "disabled_default_rules", + } + + def __init__(self_, disabled_default_rules: Union[List[str], UnsetType] = unset, **kwargs): + """ + Attributes for setting up rules. + + :param disabled_default_rules: Array of default rule IDs to disable. + :type disabled_default_rules: [str], optional + """ + if disabled_default_rules is not unset: + kwargs["disabled_default_rules"] = disabled_default_rules + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/setup_rules_request_data.py b/src/datadog_api_client/v2/model/setup_rules_request_data.py new file mode 100644 index 0000000000..21d25c4fe0 --- /dev/null +++ b/src/datadog_api_client/v2/model/setup_rules_request_data.py @@ -0,0 +1,48 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.setup_rules_request_attributes import SetupRulesRequestAttributes + from datadog_api_client.v2.model.setup_rules_request_data_type import SetupRulesRequestDataType + + +class SetupRulesRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.setup_rules_request_attributes import SetupRulesRequestAttributes + from datadog_api_client.v2.model.setup_rules_request_data_type import SetupRulesRequestDataType + + return { + "attributes": (SetupRulesRequestAttributes,), + "type": (SetupRulesRequestDataType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: SetupRulesRequestAttributes, type: SetupRulesRequestDataType, **kwargs): + """ + Data for setting up rules. + + :param attributes: Attributes for setting up rules. + :type attributes: SetupRulesRequestAttributes + + :param type: + :type type: SetupRulesRequestDataType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/setup_rules_request_data_type.py b/src/datadog_api_client/v2/model/setup_rules_request_data_type.py new file mode 100644 index 0000000000..c04e892ba2 --- /dev/null +++ b/src/datadog_api_client/v2/model/setup_rules_request_data_type.py @@ -0,0 +1,35 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SetupRulesRequestDataType(ModelSimple): + """ + + + :param value: If omitted defaults to "setup". Must be one of ["setup"]. + :type value: str + """ + + allowed_values = { + "setup", + } + SETUP: ClassVar["SetupRulesRequestDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SetupRulesRequestDataType.SETUP = SetupRulesRequestDataType("setup") diff --git a/src/datadog_api_client/v2/model/slack_routing_options.py b/src/datadog_api_client/v2/model/slack_routing_options.py new file mode 100644 index 0000000000..804836e328 --- /dev/null +++ b/src/datadog_api_client/v2/model/slack_routing_options.py @@ -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. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class SlackRoutingOptions(ModelNormal): + @cached_property + def openapi_types(_): + return { + "channel_id": (str,), + "channel_name": (str,), + "workspace_id": (str,), + "workspace_name": (str,), + } + + attribute_map = { + "channel_id": "channel_id", + "channel_name": "channel_name", + "workspace_id": "workspace_id", + "workspace_name": "workspace_name", + } + + def __init__( + self_, + channel_id: Union[str, UnsetType] = unset, + channel_name: Union[str, UnsetType] = unset, + workspace_id: Union[str, UnsetType] = unset, + workspace_name: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Slack routing options for report delivery. + + :param channel_id: Slack channel ID. + :type channel_id: str, optional + + :param channel_name: Slack channel name. + :type channel_name: str, optional + + :param workspace_id: Slack workspace ID. + :type workspace_id: str, optional + + :param workspace_name: Slack workspace name. + :type workspace_name: str, optional + """ + if channel_id is not unset: + kwargs["channel_id"] = channel_id + if channel_name is not unset: + kwargs["channel_name"] = channel_name + if workspace_id is not unset: + kwargs["workspace_id"] = workspace_id + if workspace_name is not unset: + kwargs["workspace_name"] = workspace_name + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/update_campaign_request.py b/src/datadog_api_client/v2/model/update_campaign_request.py new file mode 100644 index 0000000000..4ef257e37a --- /dev/null +++ b/src/datadog_api_client/v2/model/update_campaign_request.py @@ -0,0 +1,40 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.update_campaign_request_data import UpdateCampaignRequestData + + +class UpdateCampaignRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.update_campaign_request_data import UpdateCampaignRequestData + + return { + "data": (UpdateCampaignRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: UpdateCampaignRequestData, **kwargs): + """ + Request to update a campaign. + + :param data: Data for updating a campaign. + :type data: UpdateCampaignRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/update_campaign_request_attributes.py b/src/datadog_api_client/v2/model/update_campaign_request_attributes.py new file mode 100644 index 0000000000..e60f938ab2 --- /dev/null +++ b/src/datadog_api_client/v2/model/update_campaign_request_attributes.py @@ -0,0 +1,109 @@ +# 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. +from __future__ import annotations + +from typing import List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + unset, + UnsetType, +) + + +class UpdateCampaignRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "description": (str,), + "due_date": (datetime,), + "entity_scope": (str,), + "guidance": (str,), + "key": (str,), + "name": (str,), + "owner_id": (str,), + "rule_ids": ([str],), + "start_date": (datetime,), + "status": (str,), + } + + attribute_map = { + "description": "description", + "due_date": "due_date", + "entity_scope": "entity_scope", + "guidance": "guidance", + "key": "key", + "name": "name", + "owner_id": "owner_id", + "rule_ids": "rule_ids", + "start_date": "start_date", + "status": "status", + } + + def __init__( + self_, + name: str, + owner_id: str, + rule_ids: List[str], + start_date: datetime, + status: str, + description: Union[str, UnsetType] = unset, + due_date: Union[datetime, UnsetType] = unset, + entity_scope: Union[str, UnsetType] = unset, + guidance: Union[str, UnsetType] = unset, + key: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for updating a campaign. + + :param description: The description of the campaign. + :type description: str, optional + + :param due_date: The due date of the campaign. + :type due_date: datetime, optional + + :param entity_scope: Entity scope query to filter entities for this campaign. + :type entity_scope: str, optional + + :param guidance: Guidance for the campaign. + :type guidance: str, optional + + :param key: The unique key for the campaign. + :type key: str, optional + + :param name: The name of the campaign. + :type name: str + + :param owner_id: The UUID of the campaign owner. + :type owner_id: str + + :param rule_ids: Array of rule IDs associated with this campaign. + :type rule_ids: [str] + + :param start_date: The start date of the campaign. + :type start_date: datetime + + :param status: The status of the campaign. + :type status: str + """ + if description is not unset: + kwargs["description"] = description + if due_date is not unset: + kwargs["due_date"] = due_date + if entity_scope is not unset: + kwargs["entity_scope"] = entity_scope + if guidance is not unset: + kwargs["guidance"] = guidance + if key is not unset: + kwargs["key"] = key + super().__init__(kwargs) + + self_.name = name + self_.owner_id = owner_id + self_.rule_ids = rule_ids + self_.start_date = start_date + self_.status = status diff --git a/src/datadog_api_client/v2/model/update_campaign_request_data.py b/src/datadog_api_client/v2/model/update_campaign_request_data.py new file mode 100644 index 0000000000..3e0178451d --- /dev/null +++ b/src/datadog_api_client/v2/model/update_campaign_request_data.py @@ -0,0 +1,48 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.update_campaign_request_attributes import UpdateCampaignRequestAttributes + from datadog_api_client.v2.model.campaign_type import CampaignType + + +class UpdateCampaignRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.update_campaign_request_attributes import UpdateCampaignRequestAttributes + from datadog_api_client.v2.model.campaign_type import CampaignType + + return { + "attributes": (UpdateCampaignRequestAttributes,), + "type": (CampaignType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: UpdateCampaignRequestAttributes, type: CampaignType, **kwargs): + """ + Data for updating a campaign. + + :param attributes: Attributes for updating a campaign. + :type attributes: UpdateCampaignRequestAttributes + + :param type: The JSON:API type for campaigns. + :type type: CampaignType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 2f5f812904..d26a372e45 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -665,6 +665,11 @@ from datadog_api_client.v2.model.csm_agents_type import CSMAgentsType from datadog_api_client.v2.model.cvss import CVSS from datadog_api_client.v2.model.calculated_field import CalculatedField +from datadog_api_client.v2.model.campaign_response import CampaignResponse +from datadog_api_client.v2.model.campaign_response_attributes import CampaignResponseAttributes +from datadog_api_client.v2.model.campaign_response_data import CampaignResponseData +from datadog_api_client.v2.model.campaign_status import CampaignStatus +from datadog_api_client.v2.model.campaign_type import CampaignType from datadog_api_client.v2.model.cancel_data_deletion_response_body import CancelDataDeletionResponseBody from datadog_api_client.v2.model.case import Case from datadog_api_client.v2.model.case3rd_party_ticket_status import Case3rdPartyTicketStatus @@ -1051,6 +1056,9 @@ from datadog_api_client.v2.model.create_attachment_request_data_attributes_attachment import ( CreateAttachmentRequestDataAttributesAttachment, ) +from datadog_api_client.v2.model.create_campaign_request import CreateCampaignRequest +from datadog_api_client.v2.model.create_campaign_request_attributes import CreateCampaignRequestAttributes +from datadog_api_client.v2.model.create_campaign_request_data import CreateCampaignRequestData from datadog_api_client.v2.model.create_case_request_array import CreateCaseRequestArray from datadog_api_client.v2.model.create_case_request_data import CreateCaseRequestData from datadog_api_client.v2.model.create_case_request_data_attributes import CreateCaseRequestDataAttributes @@ -1529,6 +1537,9 @@ from datadog_api_client.v2.model.datastore_primary_key_generation_strategy import DatastorePrimaryKeyGenerationStrategy from datadog_api_client.v2.model.datastore_trigger import DatastoreTrigger from datadog_api_client.v2.model.datastore_trigger_wrapper import DatastoreTriggerWrapper +from datadog_api_client.v2.model.default_rule_response_attributes import DefaultRuleResponseAttributes +from datadog_api_client.v2.model.default_rule_response_data import DefaultRuleResponseData +from datadog_api_client.v2.model.default_rule_type import DefaultRuleType from datadog_api_client.v2.model.degradation import Degradation from datadog_api_client.v2.model.degradation_array import DegradationArray from datadog_api_client.v2.model.degradation_array_included import DegradationArrayIncluded @@ -1686,6 +1697,7 @@ from datadog_api_client.v2.model.entity_attributes import EntityAttributes from datadog_api_client.v2.model.entity_data import EntityData from datadog_api_client.v2.model.entity_meta import EntityMeta +from datadog_api_client.v2.model.entity_owner_destination import EntityOwnerDestination from datadog_api_client.v2.model.entity_relationships import EntityRelationships from datadog_api_client.v2.model.entity_response_array import EntityResponseArray from datadog_api_client.v2.model.entity_response_data_attributes import EntityResponseDataAttributes @@ -1945,6 +1957,10 @@ FacetInfoResponseDataAttributesResultValuesItems, ) from datadog_api_client.v2.model.facet_info_response_data_type import FacetInfoResponseDataType +from datadog_api_client.v2.model.facet_item import FacetItem +from datadog_api_client.v2.model.facet_response_attributes import FacetResponseAttributes +from datadog_api_client.v2.model.facet_response_data import FacetResponseData +from datadog_api_client.v2.model.facet_type import FacetType from datadog_api_client.v2.model.fastly_api_key import FastlyAPIKey from datadog_api_client.v2.model.fastly_api_key_type import FastlyAPIKeyType from datadog_api_client.v2.model.fastly_api_key_update import FastlyAPIKeyUpdate @@ -2148,6 +2164,22 @@ from datadog_api_client.v2.model.gemini_integration import GeminiIntegration from datadog_api_client.v2.model.gemini_integration_type import GeminiIntegrationType from datadog_api_client.v2.model.gemini_integration_update import GeminiIntegrationUpdate +from datadog_api_client.v2.model.generate_campaign_report_request import GenerateCampaignReportRequest +from datadog_api_client.v2.model.generate_campaign_report_request_attributes import ( + GenerateCampaignReportRequestAttributes, +) +from datadog_api_client.v2.model.generate_campaign_report_request_data import GenerateCampaignReportRequestData +from datadog_api_client.v2.model.generate_campaign_report_request_data_type import GenerateCampaignReportRequestDataType +from datadog_api_client.v2.model.generate_campaign_team_reports_request import GenerateCampaignTeamReportsRequest +from datadog_api_client.v2.model.generate_campaign_team_reports_request_attributes import ( + GenerateCampaignTeamReportsRequestAttributes, +) +from datadog_api_client.v2.model.generate_campaign_team_reports_request_data import ( + GenerateCampaignTeamReportsRequestData, +) +from datadog_api_client.v2.model.generate_campaign_team_reports_request_data_type import ( + GenerateCampaignTeamReportsRequestDataType, +) from datadog_api_client.v2.model.get_action_connection_response import GetActionConnectionResponse from datadog_api_client.v2.model.get_app_key_registration_response import GetAppKeyRegistrationResponse from datadog_api_client.v2.model.get_app_response import GetAppResponse @@ -2726,6 +2758,7 @@ from datadog_api_client.v2.model.list_apps_response_meta import ListAppsResponseMeta from datadog_api_client.v2.model.list_apps_response_meta_page import ListAppsResponseMetaPage from datadog_api_client.v2.model.list_assets_sbo_ms_response import ListAssetsSBOMsResponse +from datadog_api_client.v2.model.list_campaigns_response import ListCampaignsResponse from datadog_api_client.v2.model.list_connections_response import ListConnectionsResponse from datadog_api_client.v2.model.list_connections_response_data import ListConnectionsResponseData from datadog_api_client.v2.model.list_connections_response_data_attributes import ListConnectionsResponseDataAttributes @@ -2736,6 +2769,7 @@ ListConnectionsResponseDataAttributesConnectionsItemsJoin, ) from datadog_api_client.v2.model.list_connections_response_data_type import ListConnectionsResponseDataType +from datadog_api_client.v2.model.list_default_rules_response import ListDefaultRulesResponse from datadog_api_client.v2.model.list_deployment_rule_response_data import ListDeploymentRuleResponseData from datadog_api_client.v2.model.list_deployment_rules_data_type import ListDeploymentRulesDataType from datadog_api_client.v2.model.list_deployment_rules_response_data_attributes import ( @@ -2748,6 +2782,8 @@ from datadog_api_client.v2.model.list_entity_catalog_response import ListEntityCatalogResponse from datadog_api_client.v2.model.list_entity_catalog_response_included_item import ListEntityCatalogResponseIncludedItem from datadog_api_client.v2.model.list_entity_catalog_response_links import ListEntityCatalogResponseLinks +from datadog_api_client.v2.model.list_facets_response import ListFacetsResponse +from datadog_api_client.v2.model.list_facets_response_meta import ListFacetsResponseMeta from datadog_api_client.v2.model.list_findings_meta import ListFindingsMeta from datadog_api_client.v2.model.list_findings_page import ListFindingsPage from datadog_api_client.v2.model.list_findings_response import ListFindingsResponse @@ -2764,6 +2800,8 @@ from datadog_api_client.v2.model.list_rules_response import ListRulesResponse from datadog_api_client.v2.model.list_rules_response_data_item import ListRulesResponseDataItem from datadog_api_client.v2.model.list_rules_response_links import ListRulesResponseLinks +from datadog_api_client.v2.model.list_scorecards_response import ListScorecardsResponse +from datadog_api_client.v2.model.list_scores_response import ListScoresResponse from datadog_api_client.v2.model.list_security_findings_response import ListSecurityFindingsResponse from datadog_api_client.v2.model.list_tags_response import ListTagsResponse from datadog_api_client.v2.model.list_tags_response_data import ListTagsResponseData @@ -4008,6 +4046,7 @@ from datadog_api_client.v2.model.output_schema_parameters import OutputSchemaParameters from datadog_api_client.v2.model.output_schema_parameters_type import OutputSchemaParametersType from datadog_api_client.v2.model.page_urgency import PageUrgency +from datadog_api_client.v2.model.paginated_response_meta import PaginatedResponseMeta from datadog_api_client.v2.model.pagination import Pagination from datadog_api_client.v2.model.parameter import Parameter from datadog_api_client.v2.model.partial_api_key import PartialAPIKey @@ -4677,6 +4716,12 @@ from datadog_api_client.v2.model.schedule_user import ScheduleUser from datadog_api_client.v2.model.schedule_user_attributes import ScheduleUserAttributes from datadog_api_client.v2.model.schedule_user_type import ScheduleUserType +from datadog_api_client.v2.model.score_response_attributes import ScoreResponseAttributes +from datadog_api_client.v2.model.score_response_data import ScoreResponseData +from datadog_api_client.v2.model.score_type import ScoreType +from datadog_api_client.v2.model.scorecard_list_response_attributes import ScorecardListResponseAttributes +from datadog_api_client.v2.model.scorecard_list_response_data import ScorecardListResponseData +from datadog_api_client.v2.model.scorecard_list_type import ScorecardListType from datadog_api_client.v2.model.scorecard_type import ScorecardType from datadog_api_client.v2.model.search_issues_include_query_parameter_item import SearchIssuesIncludeQueryParameterItem from datadog_api_client.v2.model.seat_assignments_data_type import SeatAssignmentsDataType @@ -5245,6 +5290,10 @@ from datadog_api_client.v2.model.service_now_users_response import ServiceNowUsersResponse from datadog_api_client.v2.model.session_id_array import SessionIdArray from datadog_api_client.v2.model.session_id_data import SessionIdData +from datadog_api_client.v2.model.setup_rules_request import SetupRulesRequest +from datadog_api_client.v2.model.setup_rules_request_attributes import SetupRulesRequestAttributes +from datadog_api_client.v2.model.setup_rules_request_data import SetupRulesRequestData +from datadog_api_client.v2.model.setup_rules_request_data_type import SetupRulesRequestDataType from datadog_api_client.v2.model.shift import Shift from datadog_api_client.v2.model.shift_data import ShiftData from datadog_api_client.v2.model.shift_data_attributes import ShiftDataAttributes @@ -5281,6 +5330,7 @@ from datadog_api_client.v2.model.single_aggregated_dns_response_data_type import SingleAggregatedDnsResponseDataType from datadog_api_client.v2.model.slack_integration_metadata import SlackIntegrationMetadata from datadog_api_client.v2.model.slack_integration_metadata_channel_item import SlackIntegrationMetadataChannelItem +from datadog_api_client.v2.model.slack_routing_options import SlackRoutingOptions from datadog_api_client.v2.model.slack_trigger_wrapper import SlackTriggerWrapper from datadog_api_client.v2.model.slo_report_create_request import SloReportCreateRequest from datadog_api_client.v2.model.slo_report_create_request_attributes import SloReportCreateRequestAttributes @@ -5817,6 +5867,9 @@ from datadog_api_client.v2.model.update_apps_datastore_request_data_attributes import ( UpdateAppsDatastoreRequestDataAttributes, ) +from datadog_api_client.v2.model.update_campaign_request import UpdateCampaignRequest +from datadog_api_client.v2.model.update_campaign_request_attributes import UpdateCampaignRequestAttributes +from datadog_api_client.v2.model.update_campaign_request_data import UpdateCampaignRequestData from datadog_api_client.v2.model.update_connection_request import UpdateConnectionRequest from datadog_api_client.v2.model.update_connection_request_data import UpdateConnectionRequestData from datadog_api_client.v2.model.update_connection_request_data_attributes import UpdateConnectionRequestDataAttributes @@ -6562,6 +6615,11 @@ "CSMAgentsType", "CVSS", "CalculatedField", + "CampaignResponse", + "CampaignResponseAttributes", + "CampaignResponseData", + "CampaignStatus", + "CampaignType", "CancelDataDeletionResponseBody", "Case", "Case3rdPartyTicketStatus", @@ -6858,6 +6916,9 @@ "CreateAttachmentRequestData", "CreateAttachmentRequestDataAttributes", "CreateAttachmentRequestDataAttributesAttachment", + "CreateCampaignRequest", + "CreateCampaignRequestAttributes", + "CreateCampaignRequestData", "CreateCaseRequestArray", "CreateCaseRequestData", "CreateCaseRequestDataAttributes", @@ -7174,6 +7235,9 @@ "DatastorePrimaryKeyGenerationStrategy", "DatastoreTrigger", "DatastoreTriggerWrapper", + "DefaultRuleResponseAttributes", + "DefaultRuleResponseData", + "DefaultRuleType", "Degradation", "DegradationArray", "DegradationArrayIncluded", @@ -7291,6 +7355,7 @@ "EntityAttributes", "EntityData", "EntityMeta", + "EntityOwnerDestination", "EntityRelationships", "EntityResponseArray", "EntityResponseDataAttributes", @@ -7470,6 +7535,10 @@ "FacetInfoResponseDataAttributesResultRange", "FacetInfoResponseDataAttributesResultValuesItems", "FacetInfoResponseDataType", + "FacetItem", + "FacetResponseAttributes", + "FacetResponseData", + "FacetType", "FastlyAPIKey", "FastlyAPIKeyType", "FastlyAPIKeyUpdate", @@ -7663,6 +7732,14 @@ "GeminiIntegration", "GeminiIntegrationType", "GeminiIntegrationUpdate", + "GenerateCampaignReportRequest", + "GenerateCampaignReportRequestAttributes", + "GenerateCampaignReportRequestData", + "GenerateCampaignReportRequestDataType", + "GenerateCampaignTeamReportsRequest", + "GenerateCampaignTeamReportsRequestAttributes", + "GenerateCampaignTeamReportsRequestData", + "GenerateCampaignTeamReportsRequestDataType", "GetActionConnectionResponse", "GetAppKeyRegistrationResponse", "GetAppResponse", @@ -8133,12 +8210,14 @@ "ListAppsResponseMeta", "ListAppsResponseMetaPage", "ListAssetsSBOMsResponse", + "ListCampaignsResponse", "ListConnectionsResponse", "ListConnectionsResponseData", "ListConnectionsResponseDataAttributes", "ListConnectionsResponseDataAttributesConnectionsItems", "ListConnectionsResponseDataAttributesConnectionsItemsJoin", "ListConnectionsResponseDataType", + "ListDefaultRulesResponse", "ListDeploymentRuleResponseData", "ListDeploymentRulesDataType", "ListDeploymentRulesResponseDataAttributes", @@ -8149,6 +8228,8 @@ "ListEntityCatalogResponse", "ListEntityCatalogResponseIncludedItem", "ListEntityCatalogResponseLinks", + "ListFacetsResponse", + "ListFacetsResponseMeta", "ListFindingsMeta", "ListFindingsPage", "ListFindingsResponse", @@ -8165,6 +8246,8 @@ "ListRulesResponse", "ListRulesResponseDataItem", "ListRulesResponseLinks", + "ListScorecardsResponse", + "ListScoresResponse", "ListSecurityFindingsResponse", "ListTagsResponse", "ListTagsResponseData", @@ -8859,6 +8942,7 @@ "OutputSchemaParameters", "OutputSchemaParametersType", "PageUrgency", + "PaginatedResponseMeta", "Pagination", "Parameter", "PartialAPIKey", @@ -9398,6 +9482,12 @@ "ScheduleUser", "ScheduleUserAttributes", "ScheduleUserType", + "ScoreResponseAttributes", + "ScoreResponseData", + "ScoreType", + "ScorecardListResponseAttributes", + "ScorecardListResponseData", + "ScorecardListType", "ScorecardType", "SearchIssuesIncludeQueryParameterItem", "SeatAssignmentsDataType", @@ -9758,6 +9848,10 @@ "ServiceNowUsersResponse", "SessionIdArray", "SessionIdData", + "SetupRulesRequest", + "SetupRulesRequestAttributes", + "SetupRulesRequestData", + "SetupRulesRequestDataType", "Shift", "ShiftData", "ShiftDataAttributes", @@ -9780,6 +9874,7 @@ "SingleAggregatedDnsResponseDataType", "SlackIntegrationMetadata", "SlackIntegrationMetadataChannelItem", + "SlackRoutingOptions", "SlackTriggerWrapper", "SloReportCreateRequest", "SloReportCreateRequestAttributes", @@ -10182,6 +10277,9 @@ "UpdateAppsDatastoreRequest", "UpdateAppsDatastoreRequestData", "UpdateAppsDatastoreRequestDataAttributes", + "UpdateCampaignRequest", + "UpdateCampaignRequestAttributes", + "UpdateCampaignRequestData", "UpdateConnectionRequest", "UpdateConnectionRequestData", "UpdateConnectionRequestDataAttributes", diff --git a/tests/v2/features/service_scorecards.feature b/tests/v2/features/service_scorecards.feature index 387f04cf71..c9a57e036c 100644 --- a/tests/v2/features/service_scorecards.feature +++ b/tests/v2/features/service_scorecards.feature @@ -10,6 +10,49 @@ Feature: Service Scorecards And a valid "appKeyAuth" key in the system And an instance of "ServiceScorecards" API + @generated @skip @team:DataDog/service-catalog + Scenario: Associate workflow with rule returns "Bad Request" response + Given operation "UpdateScorecardRuleWorkflow" enabled + And new "UpdateScorecardRuleWorkflow" request + And request contains "rule_id" parameter from "REPLACE.ME" + And request contains "workflow_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Associate workflow with rule returns "No Content" response + Given operation "UpdateScorecardRuleWorkflow" enabled + And new "UpdateScorecardRuleWorkflow" request + And request contains "rule_id" parameter from "REPLACE.ME" + And request contains "workflow_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/service-catalog + Scenario: Associate workflow with rule returns "Not Found" response + Given operation "UpdateScorecardRuleWorkflow" enabled + And new "UpdateScorecardRuleWorkflow" request + And request contains "rule_id" parameter from "REPLACE.ME" + And request contains "workflow_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/service-catalog + Scenario: Create a new campaign returns "Bad Request" response + Given operation "CreateScorecardCampaign" enabled + And new "CreateScorecardCampaign" request + And body with value {"data": {"attributes": {"description": "Campaign to improve security posture for Q1 2024.", "due_date": "2024-03-31T23:59:59Z", "entity_scope": "kind:service AND team:platform", "guidance": "Please ensure all services pass the security requirements.", "key": "q1-security-2024", "name": "Q1 Security Campaign", "owner_id": "550e8400-e29b-41d4-a716-446655440000", "rule_ids": ["q8MQxk8TCqrHnWkx", "r9NRyl9UDrsIoXly"], "start_date": "2024-01-01T00:00:00Z", "status": "in_progress"}, "type": "campaign"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Create a new campaign returns "Created" response + Given operation "CreateScorecardCampaign" enabled + And new "CreateScorecardCampaign" request + And body with value {"data": {"attributes": {"description": "Campaign to improve security posture for Q1 2024.", "due_date": "2024-03-31T23:59:59Z", "entity_scope": "kind:service AND team:platform", "guidance": "Please ensure all services pass the security requirements.", "key": "q1-security-2024", "name": "Q1 Security Campaign", "owner_id": "550e8400-e29b-41d4-a716-446655440000", "rule_ids": ["q8MQxk8TCqrHnWkx", "r9NRyl9UDrsIoXly"], "start_date": "2024-01-01T00:00:00Z", "status": "in_progress"}, "type": "campaign"}} + When the request is sent + Then the response status is 201 Created + @team:DataDog/service-catalog Scenario: Create a new rule returns "Bad Request" response Given operation "CreateScorecardRule" enabled @@ -46,6 +89,30 @@ Feature: Service Scorecards When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/service-catalog + Scenario: Delete a campaign returns "Bad Request" response + Given operation "DeleteScorecardCampaign" enabled + And new "DeleteScorecardCampaign" request + And request contains "campaign_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Delete a campaign returns "No Content" response + Given operation "DeleteScorecardCampaign" enabled + And new "DeleteScorecardCampaign" request + And request contains "campaign_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/service-catalog + Scenario: Delete a campaign returns "Not Found" response + Given operation "DeleteScorecardCampaign" enabled + And new "DeleteScorecardCampaign" request + And request contains "campaign_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/service-catalog Scenario: Delete a rule returns "Bad Request" response Given operation "DeleteScorecardRule" enabled @@ -71,6 +138,122 @@ Feature: Service Scorecards When the request is sent Then the response status is 204 OK + @generated @skip @team:DataDog/service-catalog + Scenario: Delete rule workflow returns "Bad Request" response + Given operation "DeleteScorecardRuleWorkflow" enabled + And new "DeleteScorecardRuleWorkflow" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Delete rule workflow returns "No Content" response + Given operation "DeleteScorecardRuleWorkflow" enabled + And new "DeleteScorecardRuleWorkflow" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/service-catalog + Scenario: Delete rule workflow returns "Not Found" response + Given operation "DeleteScorecardRuleWorkflow" enabled + And new "DeleteScorecardRuleWorkflow" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/service-catalog + Scenario: Generate campaign report returns "Accepted" response + Given operation "GenerateScorecardCampaignReport" enabled + And new "GenerateScorecardCampaignReport" request + And request contains "campaign_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"slack": {"channel_id": "C024BDQ4N", "channel_name": "service-scorecards", "workspace_id": "T024BDQ4N", "workspace_name": "datadog-workspace"}}, "type": "campaign-report"}} + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:DataDog/service-catalog + Scenario: Generate campaign report returns "Bad Request" response + Given operation "GenerateScorecardCampaignReport" enabled + And new "GenerateScorecardCampaignReport" request + And request contains "campaign_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"slack": {"channel_id": "C024BDQ4N", "channel_name": "service-scorecards", "workspace_id": "T024BDQ4N", "workspace_name": "datadog-workspace"}}, "type": "campaign-report"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Generate campaign report returns "Not Found" response + Given operation "GenerateScorecardCampaignReport" enabled + And new "GenerateScorecardCampaignReport" request + And request contains "campaign_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"slack": {"channel_id": "C024BDQ4N", "channel_name": "service-scorecards", "workspace_id": "T024BDQ4N", "workspace_name": "datadog-workspace"}}, "type": "campaign-report"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/service-catalog + Scenario: Generate team-specific campaign reports returns "Accepted" response + Given operation "GenerateScorecardCampaignTeamReports" enabled + And new "GenerateScorecardCampaignTeamReports" request + And request contains "campaign_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"entity_owners": [{"slack": {"channel_id": "C024BDQ4N", "workspace_id": "T024BDQ4N"}, "team_id": "550e8400-e29b-41d4-a716-446655440000"}]}, "type": "campaign-team-report"}} + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:DataDog/service-catalog + Scenario: Generate team-specific campaign reports returns "Bad Request" response + Given operation "GenerateScorecardCampaignTeamReports" enabled + And new "GenerateScorecardCampaignTeamReports" request + And request contains "campaign_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"entity_owners": [{"slack": {"channel_id": "C024BDQ4N", "workspace_id": "T024BDQ4N"}, "team_id": "550e8400-e29b-41d4-a716-446655440000"}]}, "type": "campaign-team-report"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Generate team-specific campaign reports returns "Not Found" response + Given operation "GenerateScorecardCampaignTeamReports" enabled + And new "GenerateScorecardCampaignTeamReports" request + And request contains "campaign_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"entity_owners": [{"slack": {"channel_id": "C024BDQ4N", "workspace_id": "T024BDQ4N"}, "team_id": "550e8400-e29b-41d4-a716-446655440000"}]}, "type": "campaign-team-report"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/service-catalog + Scenario: Get a campaign returns "Bad Request" response + Given operation "GetScorecardCampaign" enabled + And new "GetScorecardCampaign" request + And request contains "campaign_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Get a campaign returns "Not Found" response + Given operation "GetScorecardCampaign" enabled + And new "GetScorecardCampaign" request + And request contains "campaign_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/service-catalog + Scenario: Get a campaign returns "OK" response + Given operation "GetScorecardCampaign" enabled + And new "GetScorecardCampaign" request + And request contains "campaign_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/service-catalog + Scenario: List all campaigns returns "Bad Request" response + Given operation "ListScorecardCampaigns" enabled + And new "ListScorecardCampaigns" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: List all campaigns returns "OK" response + Given operation "ListScorecardCampaigns" enabled + And new "ListScorecardCampaigns" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/service-catalog Scenario: List all rule outcomes returns "Bad Request" response Given operation "ListScorecardOutcomes" enabled @@ -121,6 +304,74 @@ Feature: Service Scorecards Then the response status is 200 OK And the response has 4 items + @generated @skip @team:DataDog/service-catalog + Scenario: List all scorecards returns "OK" response + Given operation "ListScorecards" enabled + And new "ListScorecards" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/service-catalog + Scenario: List default rules returns "OK" response + Given operation "ListScorecardDefaultRules" enabled + And new "ListScorecardDefaultRules" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/service-catalog + Scenario: List entity facets returns "Bad Request" response + Given operation "ListScorecardFacets" enabled + And new "ListScorecardFacets" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: List entity facets returns "OK" response + Given operation "ListScorecardFacets" enabled + And new "ListScorecardFacets" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/service-catalog + Scenario: List scores by aggregation returns "Bad Request" response + Given operation "ListScorecardScores" enabled + And new "ListScorecardScores" request + And request contains "aggregation" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: List scores by aggregation returns "OK" response + Given operation "ListScorecardScores" enabled + And new "ListScorecardScores" request + And request contains "aggregation" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/service-catalog + Scenario: Set up rules for organization returns "Bad Request" response + Given operation "SetupScorecardRules" enabled + And new "SetupScorecardRules" request + And body with value {"data": {"attributes": {"disabled_default_rules": ["q8MQxk8TCqrHnWkx", "r9NRyl9UDrsIoXly"]}, "type": "setup"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Set up rules for organization returns "No Content" response + Given operation "SetupScorecardRules" enabled + And new "SetupScorecardRules" request + And body with value {"data": {"attributes": {"disabled_default_rules": ["q8MQxk8TCqrHnWkx", "r9NRyl9UDrsIoXly"]}, "type": "setup"}} + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/service-catalog + Scenario: Set up rules for organization returns "Not Found" response + Given operation "SetupScorecardRules" enabled + And new "SetupScorecardRules" request + And body with value {"data": {"attributes": {"disabled_default_rules": ["q8MQxk8TCqrHnWkx", "r9NRyl9UDrsIoXly"]}, "type": "setup"}} + When the request is sent + Then the response status is 404 Not Found + @team:DataDog/service-catalog Scenario: Update Scorecard outcomes asynchronously returns "Accepted" response Given operation "UpdateScorecardOutcomesAsync" enabled @@ -150,6 +401,33 @@ Feature: Service Scorecards Then the response status is 409 Conflict And the response "errors" has length 1 + @generated @skip @team:DataDog/service-catalog + Scenario: Update a campaign returns "Bad Request" response + Given operation "UpdateScorecardCampaign" enabled + And new "UpdateScorecardCampaign" request + And request contains "campaign_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Campaign to improve security posture for Q1 2024.", "due_date": "2024-03-31T23:59:59Z", "entity_scope": "kind:service AND team:platform", "guidance": "Please ensure all services pass the security requirements.", "key": "q1-security-2024", "name": "Q1 Security Campaign", "owner_id": "550e8400-e29b-41d4-a716-446655440000", "rule_ids": ["q8MQxk8TCqrHnWkx", "r9NRyl9UDrsIoXly"], "start_date": "2024-01-01T00:00:00Z", "status": "in_progress"}, "type": "campaign"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Update a campaign returns "Not Found" response + Given operation "UpdateScorecardCampaign" enabled + And new "UpdateScorecardCampaign" request + And request contains "campaign_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Campaign to improve security posture for Q1 2024.", "due_date": "2024-03-31T23:59:59Z", "entity_scope": "kind:service AND team:platform", "guidance": "Please ensure all services pass the security requirements.", "key": "q1-security-2024", "name": "Q1 Security Campaign", "owner_id": "550e8400-e29b-41d4-a716-446655440000", "rule_ids": ["q8MQxk8TCqrHnWkx", "r9NRyl9UDrsIoXly"], "start_date": "2024-01-01T00:00:00Z", "status": "in_progress"}, "type": "campaign"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/service-catalog + Scenario: Update a campaign returns "OK" response + Given operation "UpdateScorecardCampaign" enabled + And new "UpdateScorecardCampaign" request + And request contains "campaign_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Campaign to improve security posture for Q1 2024.", "due_date": "2024-03-31T23:59:59Z", "entity_scope": "kind:service AND team:platform", "guidance": "Please ensure all services pass the security requirements.", "key": "q1-security-2024", "name": "Q1 Security Campaign", "owner_id": "550e8400-e29b-41d4-a716-446655440000", "rule_ids": ["q8MQxk8TCqrHnWkx", "r9NRyl9UDrsIoXly"], "start_date": "2024-01-01T00:00:00Z", "status": "in_progress"}, "type": "campaign"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/service-catalog Scenario: Update an existing rule returns "Bad Request" response Given operation "UpdateScorecardRule" enabled diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index b5703b05a0..69f2547d20 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -4249,6 +4249,60 @@ "type": "idempotent" } }, + "ListScorecardCampaigns": { + "tag": "Service Scorecards", + "undo": { + "type": "safe" + } + }, + "CreateScorecardCampaign": { + "tag": "Service Scorecards", + "undo": { + "type": "unsafe" + } + }, + "DeleteScorecardCampaign": { + "tag": "Service Scorecards", + "undo": { + "type": "idempotent" + } + }, + "GetScorecardCampaign": { + "tag": "Service Scorecards", + "undo": { + "type": "safe" + } + }, + "UpdateScorecardCampaign": { + "tag": "Service Scorecards", + "undo": { + "type": "idempotent" + } + }, + "GenerateScorecardCampaignTeamReports": { + "tag": "Service Scorecards", + "undo": { + "type": "unsafe" + } + }, + "GenerateScorecardCampaignReport": { + "tag": "Service Scorecards", + "undo": { + "type": "unsafe" + } + }, + "ListScorecardDefaultRules": { + "tag": "Service Scorecards", + "undo": { + "type": "safe" + } + }, + "ListScorecardFacets": { + "tag": "Service Scorecards", + "undo": { + "type": "safe" + } + }, "ListScorecardOutcomes": { "tag": "Service Scorecards", "undo": { @@ -4298,6 +4352,36 @@ "type": "idempotent" } }, + "DeleteScorecardRuleWorkflow": { + "tag": "Service Scorecards", + "undo": { + "type": "idempotent" + } + }, + "UpdateScorecardRuleWorkflow": { + "tag": "Service Scorecards", + "undo": { + "type": "idempotent" + } + }, + "ListScorecards": { + "tag": "Service Scorecards", + "undo": { + "type": "safe" + } + }, + "ListScorecardScores": { + "tag": "Service Scorecards", + "undo": { + "type": "safe" + } + }, + "SetupScorecardRules": { + "tag": "Service Scorecards", + "undo": { + "type": "unsafe" + } + }, "UnassignSeatsUser": { "tag": "Seats", "undo": {