diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml
index e301432aca7..498aa61fee3 100644
--- a/.generator/schemas/v2/openapi.yaml
+++ b/.generator/schemas/v2/openapi.yaml
@@ -9220,6 +9220,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:
@@ -13503,6 +13607,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:
@@ -18877,6 +19054,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:
@@ -20642,6 +20875,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"
@@ -23259,6 +23505,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:
@@ -26552,6 +26858,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:
@@ -33336,6 +33718,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:
@@ -33434,6 +33832,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:
@@ -33545,6 +33956,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:
@@ -33722,6 +34160,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:
@@ -44402,6 +44869,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:
@@ -52098,6 +52594,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.
@@ -58182,6 +58804,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:
@@ -58570,6 +59230,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:
@@ -64532,6 +65212,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:
@@ -91813,6 +92568,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.
@@ -91841,21 +93066,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
@@ -91901,7 +93126,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:
@@ -91934,7 +93159,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:
@@ -91970,7 +93195,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:
@@ -92062,7 +93287,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:
@@ -92097,7 +93322,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}:
@@ -92125,7 +93350,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:
@@ -92162,7 +93387,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/security-entities/risk-scores:
diff --git a/examples/v2/service-scorecards/CreateScorecardCampaign.java b/examples/v2/service-scorecards/CreateScorecardCampaign.java
new file mode 100644
index 00000000000..207df8819a5
--- /dev/null
+++ b/examples/v2/service-scorecards/CreateScorecardCampaign.java
@@ -0,0 +1,50 @@
+// Create a new campaign returns "Created" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ServiceScorecardsApi;
+import com.datadog.api.client.v2.model.CampaignResponse;
+import com.datadog.api.client.v2.model.CampaignStatus;
+import com.datadog.api.client.v2.model.CampaignType;
+import com.datadog.api.client.v2.model.CreateCampaignRequest;
+import com.datadog.api.client.v2.model.CreateCampaignRequestAttributes;
+import com.datadog.api.client.v2.model.CreateCampaignRequestData;
+import java.time.OffsetDateTime;
+import java.util.Arrays;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.createScorecardCampaign", true);
+ ServiceScorecardsApi apiInstance = new ServiceScorecardsApi(defaultClient);
+
+ CreateCampaignRequest body =
+ new CreateCampaignRequest()
+ .data(
+ new CreateCampaignRequestData()
+ .attributes(
+ new CreateCampaignRequestAttributes()
+ .description("Campaign to improve security posture for Q1 2024.")
+ .dueDate(OffsetDateTime.parse("2024-03-31T23:59:59Z"))
+ .entityScope("kind:service AND team:platform")
+ .guidance("Please ensure all services pass the security requirements.")
+ .key("q1-security-2024")
+ .name("Q1 Security Campaign")
+ .ownerId("550e8400-e29b-41d4-a716-446655440000")
+ .ruleIds(Arrays.asList("q8MQxk8TCqrHnWkx", "r9NRyl9UDrsIoXly"))
+ .startDate(OffsetDateTime.parse("2024-01-01T00:00:00Z"))
+ .status(CampaignStatus.IN_PROGRESS))
+ .type(CampaignType.CAMPAIGN));
+
+ try {
+ CampaignResponse result = apiInstance.createScorecardCampaign(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ServiceScorecardsApi#createScorecardCampaign");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/service-scorecards/DeleteScorecardCampaign.java b/examples/v2/service-scorecards/DeleteScorecardCampaign.java
new file mode 100644
index 00000000000..28aa888f64d
--- /dev/null
+++ b/examples/v2/service-scorecards/DeleteScorecardCampaign.java
@@ -0,0 +1,23 @@
+// Delete a campaign returns "No Content" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ServiceScorecardsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.deleteScorecardCampaign", true);
+ ServiceScorecardsApi apiInstance = new ServiceScorecardsApi(defaultClient);
+
+ try {
+ apiInstance.deleteScorecardCampaign("c10ODp0VCrrIpXmz");
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ServiceScorecardsApi#deleteScorecardCampaign");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/service-scorecards/DeleteScorecardRuleWorkflow.java b/examples/v2/service-scorecards/DeleteScorecardRuleWorkflow.java
new file mode 100644
index 00000000000..9f78fd9aa45
--- /dev/null
+++ b/examples/v2/service-scorecards/DeleteScorecardRuleWorkflow.java
@@ -0,0 +1,23 @@
+// Delete rule workflow returns "No Content" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ServiceScorecardsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.deleteScorecardRuleWorkflow", true);
+ ServiceScorecardsApi apiInstance = new ServiceScorecardsApi(defaultClient);
+
+ try {
+ apiInstance.deleteScorecardRuleWorkflow("rule_id");
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ServiceScorecardsApi#deleteScorecardRuleWorkflow");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/service-scorecards/GenerateScorecardCampaignReport.java b/examples/v2/service-scorecards/GenerateScorecardCampaignReport.java
new file mode 100644
index 00000000000..b07ca68dd51
--- /dev/null
+++ b/examples/v2/service-scorecards/GenerateScorecardCampaignReport.java
@@ -0,0 +1,43 @@
+// Generate campaign report returns "Accepted" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ServiceScorecardsApi;
+import com.datadog.api.client.v2.model.GenerateCampaignReportRequest;
+import com.datadog.api.client.v2.model.GenerateCampaignReportRequestAttributes;
+import com.datadog.api.client.v2.model.GenerateCampaignReportRequestData;
+import com.datadog.api.client.v2.model.GenerateCampaignReportRequestDataType;
+import com.datadog.api.client.v2.model.SlackRoutingOptions;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.generateScorecardCampaignReport", true);
+ ServiceScorecardsApi apiInstance = new ServiceScorecardsApi(defaultClient);
+
+ GenerateCampaignReportRequest body =
+ new GenerateCampaignReportRequest()
+ .data(
+ new GenerateCampaignReportRequestData()
+ .attributes(
+ new GenerateCampaignReportRequestAttributes()
+ .slack(
+ new SlackRoutingOptions()
+ .channelId("C024BDQ4N")
+ .channelName("service-scorecards")
+ .workspaceId("T024BDQ4N")
+ .workspaceName("datadog-workspace")))
+ .type(GenerateCampaignReportRequestDataType.CAMPAIGN_REPORT));
+
+ try {
+ apiInstance.generateScorecardCampaignReport("c10ODp0VCrrIpXmz", body);
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling ServiceScorecardsApi#generateScorecardCampaignReport");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/service-scorecards/GenerateScorecardCampaignTeamReports.java b/examples/v2/service-scorecards/GenerateScorecardCampaignTeamReports.java
new file mode 100644
index 00000000000..5e01a114b38
--- /dev/null
+++ b/examples/v2/service-scorecards/GenerateScorecardCampaignTeamReports.java
@@ -0,0 +1,47 @@
+// Generate team-specific campaign reports returns "Accepted" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ServiceScorecardsApi;
+import com.datadog.api.client.v2.model.EntityOwnerDestination;
+import com.datadog.api.client.v2.model.GenerateCampaignTeamReportsRequest;
+import com.datadog.api.client.v2.model.GenerateCampaignTeamReportsRequestAttributes;
+import com.datadog.api.client.v2.model.GenerateCampaignTeamReportsRequestData;
+import com.datadog.api.client.v2.model.GenerateCampaignTeamReportsRequestDataType;
+import com.datadog.api.client.v2.model.SlackRoutingOptions;
+import java.util.Collections;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.generateScorecardCampaignTeamReports", true);
+ ServiceScorecardsApi apiInstance = new ServiceScorecardsApi(defaultClient);
+
+ GenerateCampaignTeamReportsRequest body =
+ new GenerateCampaignTeamReportsRequest()
+ .data(
+ new GenerateCampaignTeamReportsRequestData()
+ .attributes(
+ new GenerateCampaignTeamReportsRequestAttributes()
+ .entityOwners(
+ Collections.singletonList(
+ new EntityOwnerDestination()
+ .slack(
+ new SlackRoutingOptions()
+ .channelId("C024BDQ4N")
+ .workspaceId("T024BDQ4N"))
+ .teamId("550e8400-e29b-41d4-a716-446655440000"))))
+ .type(GenerateCampaignTeamReportsRequestDataType.CAMPAIGN_TEAM_REPORT));
+
+ try {
+ apiInstance.generateScorecardCampaignTeamReports("c10ODp0VCrrIpXmz", body);
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling ServiceScorecardsApi#generateScorecardCampaignTeamReports");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/service-scorecards/GetScorecardCampaign.java b/examples/v2/service-scorecards/GetScorecardCampaign.java
new file mode 100644
index 00000000000..b2958b5d205
--- /dev/null
+++ b/examples/v2/service-scorecards/GetScorecardCampaign.java
@@ -0,0 +1,25 @@
+// Get a campaign returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ServiceScorecardsApi;
+import com.datadog.api.client.v2.model.CampaignResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.getScorecardCampaign", true);
+ ServiceScorecardsApi apiInstance = new ServiceScorecardsApi(defaultClient);
+
+ try {
+ CampaignResponse result = apiInstance.getScorecardCampaign("c10ODp0VCrrIpXmz");
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ServiceScorecardsApi#getScorecardCampaign");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/service-scorecards/ListScorecardCampaigns.java b/examples/v2/service-scorecards/ListScorecardCampaigns.java
new file mode 100644
index 00000000000..e0f1125fdf2
--- /dev/null
+++ b/examples/v2/service-scorecards/ListScorecardCampaigns.java
@@ -0,0 +1,25 @@
+// List all campaigns returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ServiceScorecardsApi;
+import com.datadog.api.client.v2.model.ListCampaignsResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.listScorecardCampaigns", true);
+ ServiceScorecardsApi apiInstance = new ServiceScorecardsApi(defaultClient);
+
+ try {
+ ListCampaignsResponse result = apiInstance.listScorecardCampaigns();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ServiceScorecardsApi#listScorecardCampaigns");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/service-scorecards/ListScorecardDefaultRules.java b/examples/v2/service-scorecards/ListScorecardDefaultRules.java
new file mode 100644
index 00000000000..c5f396d7b4f
--- /dev/null
+++ b/examples/v2/service-scorecards/ListScorecardDefaultRules.java
@@ -0,0 +1,25 @@
+// List default rules returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ServiceScorecardsApi;
+import com.datadog.api.client.v2.model.ListDefaultRulesResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.listScorecardDefaultRules", true);
+ ServiceScorecardsApi apiInstance = new ServiceScorecardsApi(defaultClient);
+
+ try {
+ ListDefaultRulesResponse result = apiInstance.listScorecardDefaultRules();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ServiceScorecardsApi#listScorecardDefaultRules");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/service-scorecards/ListScorecardFacets.java b/examples/v2/service-scorecards/ListScorecardFacets.java
new file mode 100644
index 00000000000..9645a8188b6
--- /dev/null
+++ b/examples/v2/service-scorecards/ListScorecardFacets.java
@@ -0,0 +1,25 @@
+// List entity facets returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ServiceScorecardsApi;
+import com.datadog.api.client.v2.model.ListFacetsResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.listScorecardFacets", true);
+ ServiceScorecardsApi apiInstance = new ServiceScorecardsApi(defaultClient);
+
+ try {
+ ListFacetsResponse result = apiInstance.listScorecardFacets();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ServiceScorecardsApi#listScorecardFacets");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/service-scorecards/ListScorecardScores.java b/examples/v2/service-scorecards/ListScorecardScores.java
new file mode 100644
index 00000000000..7d561d219e0
--- /dev/null
+++ b/examples/v2/service-scorecards/ListScorecardScores.java
@@ -0,0 +1,25 @@
+// List scores by aggregation returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ServiceScorecardsApi;
+import com.datadog.api.client.v2.model.ListScoresResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.listScorecardScores", true);
+ ServiceScorecardsApi apiInstance = new ServiceScorecardsApi(defaultClient);
+
+ try {
+ ListScoresResponse result = apiInstance.listScorecardScores("by-entity");
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ServiceScorecardsApi#listScorecardScores");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/service-scorecards/ListScorecards.java b/examples/v2/service-scorecards/ListScorecards.java
new file mode 100644
index 00000000000..9f53ae56cad
--- /dev/null
+++ b/examples/v2/service-scorecards/ListScorecards.java
@@ -0,0 +1,25 @@
+// List all scorecards returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ServiceScorecardsApi;
+import com.datadog.api.client.v2.model.ListScorecardsResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.listScorecards", true);
+ ServiceScorecardsApi apiInstance = new ServiceScorecardsApi(defaultClient);
+
+ try {
+ ListScorecardsResponse result = apiInstance.listScorecards();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ServiceScorecardsApi#listScorecards");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/service-scorecards/SetupScorecardRules.java b/examples/v2/service-scorecards/SetupScorecardRules.java
new file mode 100644
index 00000000000..1a529d247d8
--- /dev/null
+++ b/examples/v2/service-scorecards/SetupScorecardRules.java
@@ -0,0 +1,38 @@
+// Set up rules for organization returns "No Content" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ServiceScorecardsApi;
+import com.datadog.api.client.v2.model.SetupRulesRequest;
+import com.datadog.api.client.v2.model.SetupRulesRequestAttributes;
+import com.datadog.api.client.v2.model.SetupRulesRequestData;
+import com.datadog.api.client.v2.model.SetupRulesRequestDataType;
+import java.util.Arrays;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.setupScorecardRules", true);
+ ServiceScorecardsApi apiInstance = new ServiceScorecardsApi(defaultClient);
+
+ SetupRulesRequest body =
+ new SetupRulesRequest()
+ .data(
+ new SetupRulesRequestData()
+ .attributes(
+ new SetupRulesRequestAttributes()
+ .disabledDefaultRules(
+ Arrays.asList("q8MQxk8TCqrHnWkx", "r9NRyl9UDrsIoXly")))
+ .type(SetupRulesRequestDataType.SETUP));
+
+ try {
+ apiInstance.setupScorecardRules(body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ServiceScorecardsApi#setupScorecardRules");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/service-scorecards/UpdateScorecardCampaign.java b/examples/v2/service-scorecards/UpdateScorecardCampaign.java
new file mode 100644
index 00000000000..3f5401e7379
--- /dev/null
+++ b/examples/v2/service-scorecards/UpdateScorecardCampaign.java
@@ -0,0 +1,49 @@
+// Update a campaign returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ServiceScorecardsApi;
+import com.datadog.api.client.v2.model.CampaignResponse;
+import com.datadog.api.client.v2.model.CampaignType;
+import com.datadog.api.client.v2.model.UpdateCampaignRequest;
+import com.datadog.api.client.v2.model.UpdateCampaignRequestAttributes;
+import com.datadog.api.client.v2.model.UpdateCampaignRequestData;
+import java.time.OffsetDateTime;
+import java.util.Arrays;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.updateScorecardCampaign", true);
+ ServiceScorecardsApi apiInstance = new ServiceScorecardsApi(defaultClient);
+
+ UpdateCampaignRequest body =
+ new UpdateCampaignRequest()
+ .data(
+ new UpdateCampaignRequestData()
+ .attributes(
+ new UpdateCampaignRequestAttributes()
+ .description("Campaign to improve security posture for Q1 2024.")
+ .dueDate(OffsetDateTime.parse("2024-03-31T23:59:59Z"))
+ .entityScope("kind:service AND team:platform")
+ .guidance("Please ensure all services pass the security requirements.")
+ .key("q1-security-2024")
+ .name("Q1 Security Campaign")
+ .ownerId("550e8400-e29b-41d4-a716-446655440000")
+ .ruleIds(Arrays.asList("q8MQxk8TCqrHnWkx", "r9NRyl9UDrsIoXly"))
+ .startDate(OffsetDateTime.parse("2024-01-01T00:00:00Z"))
+ .status("in_progress"))
+ .type(CampaignType.CAMPAIGN));
+
+ try {
+ CampaignResponse result = apiInstance.updateScorecardCampaign("c10ODp0VCrrIpXmz", body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ServiceScorecardsApi#updateScorecardCampaign");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/service-scorecards/UpdateScorecardRuleWorkflow.java b/examples/v2/service-scorecards/UpdateScorecardRuleWorkflow.java
new file mode 100644
index 00000000000..2876e9793bd
--- /dev/null
+++ b/examples/v2/service-scorecards/UpdateScorecardRuleWorkflow.java
@@ -0,0 +1,23 @@
+// Associate workflow with rule returns "No Content" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ServiceScorecardsApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.updateScorecardRuleWorkflow", true);
+ ServiceScorecardsApi apiInstance = new ServiceScorecardsApi(defaultClient);
+
+ try {
+ apiInstance.updateScorecardRuleWorkflow("rule_id", "550e8400-e29b-41d4-a716-446655440000");
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ServiceScorecardsApi#updateScorecardRuleWorkflow");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java
index e1945840a66..e92a2356963 100644
--- a/src/main/java/com/datadog/api/client/ApiClient.java
+++ b/src/main/java/com/datadog/api/client/ApiClient.java
@@ -910,13 +910,27 @@ public class ApiClient {
put("v2.queryEventFilteredUsers", false);
put("v2.queryUsers", false);
put("v2.updateConnection", false);
+ put("v2.createScorecardCampaign", false);
put("v2.createScorecardOutcomesBatch", false);
put("v2.createScorecardRule", false);
+ put("v2.deleteScorecardCampaign", false);
put("v2.deleteScorecardRule", false);
+ put("v2.deleteScorecardRuleWorkflow", false);
+ put("v2.generateScorecardCampaignReport", false);
+ put("v2.generateScorecardCampaignTeamReports", false);
+ put("v2.getScorecardCampaign", false);
+ put("v2.listScorecardCampaigns", false);
+ put("v2.listScorecardDefaultRules", false);
+ put("v2.listScorecardFacets", false);
put("v2.listScorecardOutcomes", false);
put("v2.listScorecardRules", false);
+ put("v2.listScorecards", false);
+ put("v2.listScorecardScores", false);
+ put("v2.setupScorecardRules", false);
+ put("v2.updateScorecardCampaign", false);
put("v2.updateScorecardOutcomesAsync", false);
put("v2.updateScorecardRule", false);
+ put("v2.updateScorecardRuleWorkflow", false);
put("v2.listEntityRiskScores", false);
put("v2.createIncidentService", false);
put("v2.deleteIncidentService", false);
diff --git a/src/main/java/com/datadog/api/client/v2/api/ServiceScorecardsApi.java b/src/main/java/com/datadog/api/client/v2/api/ServiceScorecardsApi.java
index fd74c5fff55..98588b9f3d6 100644
--- a/src/main/java/com/datadog/api/client/v2/api/ServiceScorecardsApi.java
+++ b/src/main/java/com/datadog/api/client/v2/api/ServiceScorecardsApi.java
@@ -5,14 +5,25 @@
import com.datadog.api.client.ApiResponse;
import com.datadog.api.client.PaginationIterable;
import com.datadog.api.client.Pair;
+import com.datadog.api.client.v2.model.CampaignResponse;
+import com.datadog.api.client.v2.model.CreateCampaignRequest;
import com.datadog.api.client.v2.model.CreateRuleRequest;
import com.datadog.api.client.v2.model.CreateRuleResponse;
+import com.datadog.api.client.v2.model.GenerateCampaignReportRequest;
+import com.datadog.api.client.v2.model.GenerateCampaignTeamReportsRequest;
+import com.datadog.api.client.v2.model.ListCampaignsResponse;
+import com.datadog.api.client.v2.model.ListDefaultRulesResponse;
+import com.datadog.api.client.v2.model.ListFacetsResponse;
import com.datadog.api.client.v2.model.ListRulesResponse;
import com.datadog.api.client.v2.model.ListRulesResponseDataItem;
+import com.datadog.api.client.v2.model.ListScorecardsResponse;
+import com.datadog.api.client.v2.model.ListScoresResponse;
import com.datadog.api.client.v2.model.OutcomesBatchRequest;
import com.datadog.api.client.v2.model.OutcomesBatchResponse;
import com.datadog.api.client.v2.model.OutcomesResponse;
import com.datadog.api.client.v2.model.OutcomesResponseDataItem;
+import com.datadog.api.client.v2.model.SetupRulesRequest;
+import com.datadog.api.client.v2.model.UpdateCampaignRequest;
import com.datadog.api.client.v2.model.UpdateOutcomesAsyncRequest;
import com.datadog.api.client.v2.model.UpdateRuleRequest;
import com.datadog.api.client.v2.model.UpdateRuleResponse;
@@ -56,6 +67,155 @@ public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
+ /**
+ * Create a new campaign.
+ *
+ *
See {@link #createScorecardCampaignWithHttpInfo}.
+ *
+ * @param body Campaign data. (required)
+ * @return CampaignResponse
+ * @throws ApiException if fails to make API call
+ */
+ public CampaignResponse createScorecardCampaign(CreateCampaignRequest body) throws ApiException {
+ return createScorecardCampaignWithHttpInfo(body).getData();
+ }
+
+ /**
+ * Create a new campaign.
+ *
+ *
See {@link #createScorecardCampaignWithHttpInfoAsync}.
+ *
+ * @param body Campaign data. (required)
+ * @return CompletableFuture<CampaignResponse>
+ */
+ public CompletableFuture createScorecardCampaignAsync(
+ CreateCampaignRequest body) {
+ return createScorecardCampaignWithHttpInfoAsync(body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Creates a new scorecard campaign.
+ *
+ * @param body Campaign data. (required)
+ * @return ApiResponse<CampaignResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 201 | Created | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse createScorecardCampaignWithHttpInfo(
+ CreateCampaignRequest body) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "createScorecardCampaign";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'body' when calling createScorecardCampaign");
+ }
+ // create path and map variables
+ String localVarPath = "/api/v2/scorecard/campaigns";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.ServiceScorecardsApi.createScorecardCampaign",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Create a new campaign.
+ *
+ * See {@link #createScorecardCampaignWithHttpInfo}.
+ *
+ * @param body Campaign data. (required)
+ * @return CompletableFuture<ApiResponse<CampaignResponse>>
+ */
+ public CompletableFuture> createScorecardCampaignWithHttpInfoAsync(
+ CreateCampaignRequest body) {
+ // Check if unstable operation is enabled
+ String operationId = "createScorecardCampaign";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'body' when calling createScorecardCampaign"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath = "/api/v2/scorecard/campaigns";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.ServiceScorecardsApi.createScorecardCampaign",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
/**
* Create outcomes batch.
*
@@ -355,6 +515,161 @@ public CompletableFuture> createScorecardRuleWit
new GenericType() {});
}
+ /**
+ * Delete a campaign.
+ *
+ * See {@link #deleteScorecardCampaignWithHttpInfo}.
+ *
+ * @param campaignId Campaign ID or key. (required)
+ * @throws ApiException if fails to make API call
+ */
+ public void deleteScorecardCampaign(String campaignId) throws ApiException {
+ deleteScorecardCampaignWithHttpInfo(campaignId);
+ }
+
+ /**
+ * Delete a campaign.
+ *
+ *
See {@link #deleteScorecardCampaignWithHttpInfoAsync}.
+ *
+ * @param campaignId Campaign ID or key. (required)
+ * @return CompletableFuture
+ */
+ public CompletableFuture deleteScorecardCampaignAsync(String campaignId) {
+ return deleteScorecardCampaignWithHttpInfoAsync(campaignId)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Deletes a single campaign by ID or key.
+ *
+ * @param campaignId Campaign ID or key. (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 204 | No Content | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 404 | Not Found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse deleteScorecardCampaignWithHttpInfo(String campaignId)
+ throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "deleteScorecardCampaign";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'campaignId' is set
+ if (campaignId == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'campaignId' when calling deleteScorecardCampaign");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/scorecard/campaigns/{campaign_id}"
+ .replaceAll(
+ "\\{" + "campaign_id" + "\\}", apiClient.escapeString(campaignId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.ServiceScorecardsApi.deleteScorecardCampaign",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "DELETE",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Delete a campaign.
+ *
+ * See {@link #deleteScorecardCampaignWithHttpInfo}.
+ *
+ * @param campaignId Campaign ID or key. (required)
+ * @return CompletableFuture<ApiResponse<Void>>
+ */
+ public CompletableFuture> deleteScorecardCampaignWithHttpInfoAsync(
+ String campaignId) {
+ // Check if unstable operation is enabled
+ String operationId = "deleteScorecardCampaign";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'campaignId' is set
+ if (campaignId == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'campaignId' when calling deleteScorecardCampaign"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/scorecard/campaigns/{campaign_id}"
+ .replaceAll(
+ "\\{" + "campaign_id" + "\\}", apiClient.escapeString(campaignId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.ServiceScorecardsApi.deleteScorecardCampaign",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "DELETE",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
/**
* Delete a rule.
*
@@ -505,186 +820,2211 @@ public CompletableFuture> deleteScorecardRuleWithHttpInfoAsync
null);
}
- /** Manage optional parameters to listScorecardOutcomes. */
- public static class ListScorecardOutcomesOptionalParameters {
- private Long pageSize;
- private Long pageOffset;
- private String include;
- private String fieldsOutcome;
- private String fieldsRule;
- private String filterOutcomeServiceName;
- private String filterOutcomeState;
- private Boolean filterRuleEnabled;
- private String filterRuleId;
- private String filterRuleName;
+ /**
+ * Delete rule workflow.
+ *
+ * See {@link #deleteScorecardRuleWorkflowWithHttpInfo}.
+ *
+ * @param ruleId The ID of the rule. (required)
+ * @throws ApiException if fails to make API call
+ */
+ public void deleteScorecardRuleWorkflow(String ruleId) throws ApiException {
+ deleteScorecardRuleWorkflowWithHttpInfo(ruleId);
+ }
- /**
- * Set pageSize.
- *
- * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default
- * to 10)
+ /**
+ * Delete rule workflow.
+ *
+ *
See {@link #deleteScorecardRuleWorkflowWithHttpInfoAsync}.
+ *
+ * @param ruleId The ID of the rule. (required)
+ * @return CompletableFuture
+ */
+ public CompletableFuture deleteScorecardRuleWorkflowAsync(String ruleId) {
+ return deleteScorecardRuleWorkflowWithHttpInfoAsync(ruleId)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Removes workflow association from a scorecard rule.
+ *
+ * @param ruleId The ID of the rule. (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 204 | No Content | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 404 | Not Found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse deleteScorecardRuleWorkflowWithHttpInfo(String ruleId)
+ throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "deleteScorecardRuleWorkflow";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'ruleId' is set
+ if (ruleId == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'ruleId' when calling deleteScorecardRuleWorkflow");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/scorecard/rules/{rule_id}/workflow"
+ .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.ServiceScorecardsApi.deleteScorecardRuleWorkflow",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "DELETE",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Delete rule workflow.
+ *
+ * See {@link #deleteScorecardRuleWorkflowWithHttpInfo}.
+ *
+ * @param ruleId The ID of the rule. (required)
+ * @return CompletableFuture<ApiResponse<Void>>
+ */
+ public CompletableFuture> deleteScorecardRuleWorkflowWithHttpInfoAsync(
+ String ruleId) {
+ // Check if unstable operation is enabled
+ String operationId = "deleteScorecardRuleWorkflow";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'ruleId' is set
+ if (ruleId == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'ruleId' when calling deleteScorecardRuleWorkflow"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/scorecard/rules/{rule_id}/workflow"
+ .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.ServiceScorecardsApi.deleteScorecardRuleWorkflow",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "DELETE",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Generate campaign report.
+ *
+ * See {@link #generateScorecardCampaignReportWithHttpInfo}.
+ *
+ * @param campaignId Campaign ID. (required)
+ * @param body Report generation request. (required)
+ * @throws ApiException if fails to make API call
+ */
+ public void generateScorecardCampaignReport(String campaignId, GenerateCampaignReportRequest body)
+ throws ApiException {
+ generateScorecardCampaignReportWithHttpInfo(campaignId, body);
+ }
+
+ /**
+ * Generate campaign report.
+ *
+ *
See {@link #generateScorecardCampaignReportWithHttpInfoAsync}.
+ *
+ * @param campaignId Campaign ID. (required)
+ * @param body Report generation request. (required)
+ * @return CompletableFuture
+ */
+ public CompletableFuture generateScorecardCampaignReportAsync(
+ String campaignId, GenerateCampaignReportRequest body) {
+ return generateScorecardCampaignReportWithHttpInfoAsync(campaignId, body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Generates and sends a campaign report to Slack.
+ *
+ * @param campaignId Campaign ID. (required)
+ * @param body Report generation request. (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 202 | Accepted | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 404 | Not Found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse generateScorecardCampaignReportWithHttpInfo(
+ String campaignId, GenerateCampaignReportRequest body) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "generateScorecardCampaignReport";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'campaignId' is set
+ if (campaignId == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'campaignId' when calling"
+ + " generateScorecardCampaignReport");
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'body' when calling generateScorecardCampaignReport");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/scorecard/campaigns/{campaign_id}/report"
+ .replaceAll(
+ "\\{" + "campaign_id" + "\\}", apiClient.escapeString(campaignId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.ServiceScorecardsApi.generateScorecardCampaignReport",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Generate campaign report.
+ *
+ * See {@link #generateScorecardCampaignReportWithHttpInfo}.
+ *
+ * @param campaignId Campaign ID. (required)
+ * @param body Report generation request. (required)
+ * @return CompletableFuture<ApiResponse<Void>>
+ */
+ public CompletableFuture> generateScorecardCampaignReportWithHttpInfoAsync(
+ String campaignId, GenerateCampaignReportRequest body) {
+ // Check if unstable operation is enabled
+ String operationId = "generateScorecardCampaignReport";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'campaignId' is set
+ if (campaignId == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'campaignId' when calling"
+ + " generateScorecardCampaignReport"));
+ return result;
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'body' when calling"
+ + " generateScorecardCampaignReport"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/scorecard/campaigns/{campaign_id}/report"
+ .replaceAll(
+ "\\{" + "campaign_id" + "\\}", apiClient.escapeString(campaignId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.ServiceScorecardsApi.generateScorecardCampaignReport",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Generate team-specific campaign reports.
+ *
+ * See {@link #generateScorecardCampaignTeamReportsWithHttpInfo}.
+ *
+ * @param campaignId Campaign ID. (required)
+ * @param body Team report generation request. (required)
+ * @throws ApiException if fails to make API call
+ */
+ public void generateScorecardCampaignTeamReports(
+ String campaignId, GenerateCampaignTeamReportsRequest body) throws ApiException {
+ generateScorecardCampaignTeamReportsWithHttpInfo(campaignId, body);
+ }
+
+ /**
+ * Generate team-specific campaign reports.
+ *
+ *
See {@link #generateScorecardCampaignTeamReportsWithHttpInfoAsync}.
+ *
+ * @param campaignId Campaign ID. (required)
+ * @param body Team report generation request. (required)
+ * @return CompletableFuture
+ */
+ public CompletableFuture generateScorecardCampaignTeamReportsAsync(
+ String campaignId, GenerateCampaignTeamReportsRequest body) {
+ return generateScorecardCampaignTeamReportsWithHttpInfoAsync(campaignId, body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Generates and sends team-specific campaign reports to Slack.
+ *
+ * @param campaignId Campaign ID. (required)
+ * @param body Team report generation request. (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 202 | Accepted | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 404 | Not Found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse generateScorecardCampaignTeamReportsWithHttpInfo(
+ String campaignId, GenerateCampaignTeamReportsRequest body) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "generateScorecardCampaignTeamReports";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'campaignId' is set
+ if (campaignId == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'campaignId' when calling"
+ + " generateScorecardCampaignTeamReports");
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'body' when calling"
+ + " generateScorecardCampaignTeamReports");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/scorecard/campaigns/{campaign_id}/entity-owner-report"
+ .replaceAll(
+ "\\{" + "campaign_id" + "\\}", apiClient.escapeString(campaignId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.ServiceScorecardsApi.generateScorecardCampaignTeamReports",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Generate team-specific campaign reports.
+ *
+ * See {@link #generateScorecardCampaignTeamReportsWithHttpInfo}.
+ *
+ * @param campaignId Campaign ID. (required)
+ * @param body Team report generation request. (required)
+ * @return CompletableFuture<ApiResponse<Void>>
+ */
+ public CompletableFuture> generateScorecardCampaignTeamReportsWithHttpInfoAsync(
+ String campaignId, GenerateCampaignTeamReportsRequest body) {
+ // Check if unstable operation is enabled
+ String operationId = "generateScorecardCampaignTeamReports";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'campaignId' is set
+ if (campaignId == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'campaignId' when calling"
+ + " generateScorecardCampaignTeamReports"));
+ return result;
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'body' when calling"
+ + " generateScorecardCampaignTeamReports"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/scorecard/campaigns/{campaign_id}/entity-owner-report"
+ .replaceAll(
+ "\\{" + "campaign_id" + "\\}", apiClient.escapeString(campaignId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.ServiceScorecardsApi.generateScorecardCampaignTeamReports",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /** Manage optional parameters to getScorecardCampaign. */
+ public static class GetScorecardCampaignOptionalParameters {
+ private String include;
+ private Boolean includeMeta;
+
+ /**
+ * Set include.
+ *
+ * @param include Include related data (for example, scores). (optional)
+ * @return GetScorecardCampaignOptionalParameters
+ */
+ public GetScorecardCampaignOptionalParameters include(String include) {
+ this.include = include;
+ return this;
+ }
+
+ /**
+ * Set includeMeta.
+ *
+ * @param includeMeta Include metadata (entity and rule counts). (optional)
+ * @return GetScorecardCampaignOptionalParameters
+ */
+ public GetScorecardCampaignOptionalParameters includeMeta(Boolean includeMeta) {
+ this.includeMeta = includeMeta;
+ return this;
+ }
+ }
+
+ /**
+ * Get a campaign.
+ *
+ * See {@link #getScorecardCampaignWithHttpInfo}.
+ *
+ * @param campaignId Campaign ID or key. (required)
+ * @return CampaignResponse
+ * @throws ApiException if fails to make API call
+ */
+ public CampaignResponse getScorecardCampaign(String campaignId) throws ApiException {
+ return getScorecardCampaignWithHttpInfo(
+ campaignId, new GetScorecardCampaignOptionalParameters())
+ .getData();
+ }
+
+ /**
+ * Get a campaign.
+ *
+ *
See {@link #getScorecardCampaignWithHttpInfoAsync}.
+ *
+ * @param campaignId Campaign ID or key. (required)
+ * @return CompletableFuture<CampaignResponse>
+ */
+ public CompletableFuture getScorecardCampaignAsync(String campaignId) {
+ return getScorecardCampaignWithHttpInfoAsync(
+ campaignId, new GetScorecardCampaignOptionalParameters())
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Get a campaign.
+ *
+ * See {@link #getScorecardCampaignWithHttpInfo}.
+ *
+ * @param campaignId Campaign ID or key. (required)
+ * @param parameters Optional parameters for the request.
+ * @return CampaignResponse
+ * @throws ApiException if fails to make API call
+ */
+ public CampaignResponse getScorecardCampaign(
+ String campaignId, GetScorecardCampaignOptionalParameters parameters) throws ApiException {
+ return getScorecardCampaignWithHttpInfo(campaignId, parameters).getData();
+ }
+
+ /**
+ * Get a campaign.
+ *
+ *
See {@link #getScorecardCampaignWithHttpInfoAsync}.
+ *
+ * @param campaignId Campaign ID or key. (required)
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<CampaignResponse>
+ */
+ public CompletableFuture getScorecardCampaignAsync(
+ String campaignId, GetScorecardCampaignOptionalParameters parameters) {
+ return getScorecardCampaignWithHttpInfoAsync(campaignId, parameters)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Fetches a single campaign by ID or key.
+ *
+ * @param campaignId Campaign ID or key. (required)
+ * @param parameters Optional parameters for the request.
+ * @return ApiResponse<CampaignResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 404 | Not Found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse getScorecardCampaignWithHttpInfo(
+ String campaignId, GetScorecardCampaignOptionalParameters parameters) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "getScorecardCampaign";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'campaignId' is set
+ if (campaignId == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'campaignId' when calling getScorecardCampaign");
+ }
+ String include = parameters.include;
+ Boolean includeMeta = parameters.includeMeta;
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/scorecard/campaigns/{campaign_id}"
+ .replaceAll(
+ "\\{" + "campaign_id" + "\\}", apiClient.escapeString(campaignId.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "include_meta", includeMeta));
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.ServiceScorecardsApi.getScorecardCampaign",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Get a campaign.
+ *
+ * See {@link #getScorecardCampaignWithHttpInfo}.
+ *
+ * @param campaignId Campaign ID or key. (required)
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<ApiResponse<CampaignResponse>>
+ */
+ public CompletableFuture> getScorecardCampaignWithHttpInfoAsync(
+ String campaignId, GetScorecardCampaignOptionalParameters parameters) {
+ // Check if unstable operation is enabled
+ String operationId = "getScorecardCampaign";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'campaignId' is set
+ if (campaignId == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'campaignId' when calling getScorecardCampaign"));
+ return result;
+ }
+ String include = parameters.include;
+ Boolean includeMeta = parameters.includeMeta;
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/scorecard/campaigns/{campaign_id}"
+ .replaceAll(
+ "\\{" + "campaign_id" + "\\}", apiClient.escapeString(campaignId.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "include_meta", includeMeta));
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.ServiceScorecardsApi.getScorecardCampaign",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /** Manage optional parameters to listScorecardCampaigns. */
+ public static class ListScorecardCampaignsOptionalParameters {
+ private Long pageLimit;
+ private Long pageOffset;
+ private String filterCampaignName;
+ private String filterCampaignStatus;
+ private String filterCampaignOwner;
+
+ /**
+ * Set pageLimit.
+ *
+ * @param pageLimit Maximum number of campaigns to return. (optional, default to 10)
+ * @return ListScorecardCampaignsOptionalParameters
+ */
+ public ListScorecardCampaignsOptionalParameters pageLimit(Long pageLimit) {
+ this.pageLimit = pageLimit;
+ return this;
+ }
+
+ /**
+ * Set pageOffset.
+ *
+ * @param pageOffset Offset for pagination. (optional, default to 0)
+ * @return ListScorecardCampaignsOptionalParameters
+ */
+ public ListScorecardCampaignsOptionalParameters pageOffset(Long pageOffset) {
+ this.pageOffset = pageOffset;
+ return this;
+ }
+
+ /**
+ * Set filterCampaignName.
+ *
+ * @param filterCampaignName Filter campaigns by name (full-text search). (optional)
+ * @return ListScorecardCampaignsOptionalParameters
+ */
+ public ListScorecardCampaignsOptionalParameters filterCampaignName(String filterCampaignName) {
+ this.filterCampaignName = filterCampaignName;
+ return this;
+ }
+
+ /**
+ * Set filterCampaignStatus.
+ *
+ * @param filterCampaignStatus Filter campaigns by status. (optional)
+ * @return ListScorecardCampaignsOptionalParameters
+ */
+ public ListScorecardCampaignsOptionalParameters filterCampaignStatus(
+ String filterCampaignStatus) {
+ this.filterCampaignStatus = filterCampaignStatus;
+ return this;
+ }
+
+ /**
+ * Set filterCampaignOwner.
+ *
+ * @param filterCampaignOwner Filter campaigns by owner UUID. (optional)
+ * @return ListScorecardCampaignsOptionalParameters
+ */
+ public ListScorecardCampaignsOptionalParameters filterCampaignOwner(
+ String filterCampaignOwner) {
+ this.filterCampaignOwner = filterCampaignOwner;
+ return this;
+ }
+ }
+
+ /**
+ * List all campaigns.
+ *
+ * See {@link #listScorecardCampaignsWithHttpInfo}.
+ *
+ * @return ListCampaignsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public ListCampaignsResponse listScorecardCampaigns() throws ApiException {
+ return listScorecardCampaignsWithHttpInfo(new ListScorecardCampaignsOptionalParameters())
+ .getData();
+ }
+
+ /**
+ * List all campaigns.
+ *
+ *
See {@link #listScorecardCampaignsWithHttpInfoAsync}.
+ *
+ * @return CompletableFuture<ListCampaignsResponse>
+ */
+ public CompletableFuture listScorecardCampaignsAsync() {
+ return listScorecardCampaignsWithHttpInfoAsync(new ListScorecardCampaignsOptionalParameters())
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * List all campaigns.
+ *
+ * See {@link #listScorecardCampaignsWithHttpInfo}.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return ListCampaignsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public ListCampaignsResponse listScorecardCampaigns(
+ ListScorecardCampaignsOptionalParameters parameters) throws ApiException {
+ return listScorecardCampaignsWithHttpInfo(parameters).getData();
+ }
+
+ /**
+ * List all campaigns.
+ *
+ *
See {@link #listScorecardCampaignsWithHttpInfoAsync}.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<ListCampaignsResponse>
+ */
+ public CompletableFuture listScorecardCampaignsAsync(
+ ListScorecardCampaignsOptionalParameters parameters) {
+ return listScorecardCampaignsWithHttpInfoAsync(parameters)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Fetches all scorecard campaigns.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return ApiResponse<ListCampaignsResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse listScorecardCampaignsWithHttpInfo(
+ ListScorecardCampaignsOptionalParameters parameters) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "listScorecardCampaigns";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+ Long pageLimit = parameters.pageLimit;
+ Long pageOffset = parameters.pageOffset;
+ String filterCampaignName = parameters.filterCampaignName;
+ String filterCampaignStatus = parameters.filterCampaignStatus;
+ String filterCampaignOwner = parameters.filterCampaignOwner;
+ // create path and map variables
+ String localVarPath = "/api/v2/scorecard/campaigns";
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[campaign][name]", filterCampaignName));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[campaign][status]", filterCampaignStatus));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[campaign][owner]", filterCampaignOwner));
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.ServiceScorecardsApi.listScorecardCampaigns",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * List all campaigns.
+ *
+ * See {@link #listScorecardCampaignsWithHttpInfo}.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<ApiResponse<ListCampaignsResponse>>
+ */
+ public CompletableFuture>
+ listScorecardCampaignsWithHttpInfoAsync(ListScorecardCampaignsOptionalParameters parameters) {
+ // Check if unstable operation is enabled
+ String operationId = "listScorecardCampaigns";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+ Long pageLimit = parameters.pageLimit;
+ Long pageOffset = parameters.pageOffset;
+ String filterCampaignName = parameters.filterCampaignName;
+ String filterCampaignStatus = parameters.filterCampaignStatus;
+ String filterCampaignOwner = parameters.filterCampaignOwner;
+ // create path and map variables
+ String localVarPath = "/api/v2/scorecard/campaigns";
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[campaign][name]", filterCampaignName));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[campaign][status]", filterCampaignStatus));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[campaign][owner]", filterCampaignOwner));
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.ServiceScorecardsApi.listScorecardCampaigns",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * List default rules.
+ *
+ * See {@link #listScorecardDefaultRulesWithHttpInfo}.
+ *
+ * @return ListDefaultRulesResponse
+ * @throws ApiException if fails to make API call
+ */
+ public ListDefaultRulesResponse listScorecardDefaultRules() throws ApiException {
+ return listScorecardDefaultRulesWithHttpInfo().getData();
+ }
+
+ /**
+ * List default rules.
+ *
+ *
See {@link #listScorecardDefaultRulesWithHttpInfoAsync}.
+ *
+ * @return CompletableFuture<ListDefaultRulesResponse>
+ */
+ public CompletableFuture listScorecardDefaultRulesAsync() {
+ return listScorecardDefaultRulesWithHttpInfoAsync()
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Fetches all default scorecard rules available for the organization.
+ *
+ * @return ApiResponse<ListDefaultRulesResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 403 | Forbidden | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse listScorecardDefaultRulesWithHttpInfo()
+ throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "listScorecardDefaultRules";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+ // create path and map variables
+ String localVarPath = "/api/v2/scorecard/default-rules";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.ServiceScorecardsApi.listScorecardDefaultRules",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * List default rules.
+ *
+ * See {@link #listScorecardDefaultRulesWithHttpInfo}.
+ *
+ * @return CompletableFuture<ApiResponse<ListDefaultRulesResponse>>
+ */
+ public CompletableFuture>
+ listScorecardDefaultRulesWithHttpInfoAsync() {
+ // Check if unstable operation is enabled
+ String operationId = "listScorecardDefaultRules";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+ // create path and map variables
+ String localVarPath = "/api/v2/scorecard/default-rules";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.ServiceScorecardsApi.listScorecardDefaultRules",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /** Manage optional parameters to listScorecardFacets. */
+ public static class ListScorecardFacetsOptionalParameters {
+ private String filterEntityQuery;
+
+ /**
+ * Set filterEntityQuery.
+ *
+ * @param filterEntityQuery Entity query filter. (optional)
+ * @return ListScorecardFacetsOptionalParameters
+ */
+ public ListScorecardFacetsOptionalParameters filterEntityQuery(String filterEntityQuery) {
+ this.filterEntityQuery = filterEntityQuery;
+ return this;
+ }
+ }
+
+ /**
+ * List entity facets.
+ *
+ * See {@link #listScorecardFacetsWithHttpInfo}.
+ *
+ * @return ListFacetsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public ListFacetsResponse listScorecardFacets() throws ApiException {
+ return listScorecardFacetsWithHttpInfo(new ListScorecardFacetsOptionalParameters()).getData();
+ }
+
+ /**
+ * List entity facets.
+ *
+ *
See {@link #listScorecardFacetsWithHttpInfoAsync}.
+ *
+ * @return CompletableFuture<ListFacetsResponse>
+ */
+ public CompletableFuture listScorecardFacetsAsync() {
+ return listScorecardFacetsWithHttpInfoAsync(new ListScorecardFacetsOptionalParameters())
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * List entity facets.
+ *
+ * See {@link #listScorecardFacetsWithHttpInfo}.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return ListFacetsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public ListFacetsResponse listScorecardFacets(ListScorecardFacetsOptionalParameters parameters)
+ throws ApiException {
+ return listScorecardFacetsWithHttpInfo(parameters).getData();
+ }
+
+ /**
+ * List entity facets.
+ *
+ *
See {@link #listScorecardFacetsWithHttpInfoAsync}.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<ListFacetsResponse>
+ */
+ public CompletableFuture listScorecardFacetsAsync(
+ ListScorecardFacetsOptionalParameters parameters) {
+ return listScorecardFacetsWithHttpInfoAsync(parameters)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Fetches facets for scorecard entities with counts.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return ApiResponse<ListFacetsResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse listScorecardFacetsWithHttpInfo(
+ ListScorecardFacetsOptionalParameters parameters) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "listScorecardFacets";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+ String filterEntityQuery = parameters.filterEntityQuery;
+ // create path and map variables
+ String localVarPath = "/api/v2/scorecard/facets";
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[entity][query]", filterEntityQuery));
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.ServiceScorecardsApi.listScorecardFacets",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * List entity facets.
+ *
+ * See {@link #listScorecardFacetsWithHttpInfo}.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<ApiResponse<ListFacetsResponse>>
+ */
+ public CompletableFuture> listScorecardFacetsWithHttpInfoAsync(
+ ListScorecardFacetsOptionalParameters parameters) {
+ // Check if unstable operation is enabled
+ String operationId = "listScorecardFacets";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+ String filterEntityQuery = parameters.filterEntityQuery;
+ // create path and map variables
+ String localVarPath = "/api/v2/scorecard/facets";
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[entity][query]", filterEntityQuery));
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.ServiceScorecardsApi.listScorecardFacets",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /** Manage optional parameters to listScorecardOutcomes. */
+ public static class ListScorecardOutcomesOptionalParameters {
+ private Long pageSize;
+ private Long pageOffset;
+ private String include;
+ private String fieldsOutcome;
+ private String fieldsRule;
+ private String filterOutcomeServiceName;
+ private String filterOutcomeState;
+ private Boolean filterRuleEnabled;
+ private String filterRuleId;
+ private String filterRuleName;
+
+ /**
+ * Set pageSize.
+ *
+ * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default
+ * to 10)
+ * @return ListScorecardOutcomesOptionalParameters
+ */
+ public ListScorecardOutcomesOptionalParameters pageSize(Long pageSize) {
+ this.pageSize = pageSize;
+ return this;
+ }
+
+ /**
+ * Set pageOffset.
+ *
+ * @param pageOffset Specific offset to use as the beginning of the returned page. (optional,
+ * default to 0)
+ * @return ListScorecardOutcomesOptionalParameters
+ */
+ public ListScorecardOutcomesOptionalParameters pageOffset(Long pageOffset) {
+ this.pageOffset = pageOffset;
+ return this;
+ }
+
+ /**
+ * Set include.
+ *
+ * @param include Include related rule details in the response. (optional)
+ * @return ListScorecardOutcomesOptionalParameters
+ */
+ public ListScorecardOutcomesOptionalParameters include(String include) {
+ this.include = include;
+ return this;
+ }
+
+ /**
+ * Set fieldsOutcome.
+ *
+ * @param fieldsOutcome Return only specified values in the outcome attributes. (optional)
+ * @return ListScorecardOutcomesOptionalParameters
+ */
+ public ListScorecardOutcomesOptionalParameters fieldsOutcome(String fieldsOutcome) {
+ this.fieldsOutcome = fieldsOutcome;
+ return this;
+ }
+
+ /**
+ * Set fieldsRule.
+ *
+ * @param fieldsRule Return only specified values in the included rule details. (optional)
+ * @return ListScorecardOutcomesOptionalParameters
+ */
+ public ListScorecardOutcomesOptionalParameters fieldsRule(String fieldsRule) {
+ this.fieldsRule = fieldsRule;
+ return this;
+ }
+
+ /**
+ * Set filterOutcomeServiceName.
+ *
+ * @param filterOutcomeServiceName Filter outcomes on a specific service name. (optional)
+ * @return ListScorecardOutcomesOptionalParameters
+ */
+ public ListScorecardOutcomesOptionalParameters filterOutcomeServiceName(
+ String filterOutcomeServiceName) {
+ this.filterOutcomeServiceName = filterOutcomeServiceName;
+ return this;
+ }
+
+ /**
+ * Set filterOutcomeState.
+ *
+ * @param filterOutcomeState Filter outcomes by a specific state. (optional)
+ * @return ListScorecardOutcomesOptionalParameters
+ */
+ public ListScorecardOutcomesOptionalParameters filterOutcomeState(String filterOutcomeState) {
+ this.filterOutcomeState = filterOutcomeState;
+ return this;
+ }
+
+ /**
+ * Set filterRuleEnabled.
+ *
+ * @param filterRuleEnabled Filter outcomes based on whether a rule is enabled or disabled.
+ * (optional)
+ * @return ListScorecardOutcomesOptionalParameters
+ */
+ public ListScorecardOutcomesOptionalParameters filterRuleEnabled(Boolean filterRuleEnabled) {
+ this.filterRuleEnabled = filterRuleEnabled;
+ return this;
+ }
+
+ /**
+ * Set filterRuleId.
+ *
+ * @param filterRuleId Filter outcomes based on rule ID. (optional)
+ * @return ListScorecardOutcomesOptionalParameters
+ */
+ public ListScorecardOutcomesOptionalParameters filterRuleId(String filterRuleId) {
+ this.filterRuleId = filterRuleId;
+ return this;
+ }
+
+ /**
+ * Set filterRuleName.
+ *
+ * @param filterRuleName Filter outcomes based on rule name. (optional)
* @return ListScorecardOutcomesOptionalParameters
*/
- public ListScorecardOutcomesOptionalParameters pageSize(Long pageSize) {
+ public ListScorecardOutcomesOptionalParameters filterRuleName(String filterRuleName) {
+ this.filterRuleName = filterRuleName;
+ return this;
+ }
+ }
+
+ /**
+ * List all rule outcomes.
+ *
+ * See {@link #listScorecardOutcomesWithHttpInfo}.
+ *
+ * @return OutcomesResponse
+ * @throws ApiException if fails to make API call
+ */
+ public OutcomesResponse listScorecardOutcomes() throws ApiException {
+ return listScorecardOutcomesWithHttpInfo(new ListScorecardOutcomesOptionalParameters())
+ .getData();
+ }
+
+ /**
+ * List all rule outcomes.
+ *
+ *
See {@link #listScorecardOutcomesWithHttpInfoAsync}.
+ *
+ * @return CompletableFuture<OutcomesResponse>
+ */
+ public CompletableFuture listScorecardOutcomesAsync() {
+ return listScorecardOutcomesWithHttpInfoAsync(new ListScorecardOutcomesOptionalParameters())
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * List all rule outcomes.
+ *
+ * See {@link #listScorecardOutcomesWithHttpInfo}.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return OutcomesResponse
+ * @throws ApiException if fails to make API call
+ */
+ public OutcomesResponse listScorecardOutcomes(ListScorecardOutcomesOptionalParameters parameters)
+ throws ApiException {
+ return listScorecardOutcomesWithHttpInfo(parameters).getData();
+ }
+
+ /**
+ * List all rule outcomes.
+ *
+ *
See {@link #listScorecardOutcomesWithHttpInfoAsync}.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<OutcomesResponse>
+ */
+ public CompletableFuture listScorecardOutcomesAsync(
+ ListScorecardOutcomesOptionalParameters parameters) {
+ return listScorecardOutcomesWithHttpInfoAsync(parameters)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * List all rule outcomes.
+ *
+ * See {@link #listScorecardOutcomesWithHttpInfo}.
+ *
+ * @return PaginationIterable<OutcomesResponseDataItem>
+ */
+ public PaginationIterable listScorecardOutcomesWithPagination() {
+ ListScorecardOutcomesOptionalParameters parameters =
+ new ListScorecardOutcomesOptionalParameters();
+ return listScorecardOutcomesWithPagination(parameters);
+ }
+
+ /**
+ * List all rule outcomes.
+ *
+ * See {@link #listScorecardOutcomesWithHttpInfo}.
+ *
+ * @return OutcomesResponse
+ */
+ public PaginationIterable listScorecardOutcomesWithPagination(
+ ListScorecardOutcomesOptionalParameters parameters) {
+ String resultsPath = "getData";
+ String valueGetterPath = "";
+ String valueSetterPath = "pageOffset";
+ Boolean valueSetterParamOptional = true;
+ Long limit;
+
+ if (parameters.pageSize == null) {
+ limit = 10l;
+ parameters.pageSize(limit);
+ } else {
+ limit = parameters.pageSize;
+ }
+
+ LinkedHashMap args = new LinkedHashMap();
+ args.put("optionalParams", parameters);
+
+ PaginationIterable iterator =
+ new PaginationIterable(
+ this,
+ "listScorecardOutcomes",
+ resultsPath,
+ valueGetterPath,
+ valueSetterPath,
+ valueSetterParamOptional,
+ true,
+ limit,
+ args);
+
+ return iterator;
+ }
+
+ /**
+ * Fetches all rule outcomes.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return ApiResponse<OutcomesResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse listScorecardOutcomesWithHttpInfo(
+ ListScorecardOutcomesOptionalParameters parameters) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "listScorecardOutcomes";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+ Long pageSize = parameters.pageSize;
+ Long pageOffset = parameters.pageOffset;
+ String include = parameters.include;
+ String fieldsOutcome = parameters.fieldsOutcome;
+ String fieldsRule = parameters.fieldsRule;
+ String filterOutcomeServiceName = parameters.filterOutcomeServiceName;
+ String filterOutcomeState = parameters.filterOutcomeState;
+ Boolean filterRuleEnabled = parameters.filterRuleEnabled;
+ String filterRuleId = parameters.filterRuleId;
+ String filterRuleName = parameters.filterRuleName;
+ // create path and map variables
+ String localVarPath = "/api/v2/scorecard/outcomes";
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "fields[outcome]", fieldsOutcome));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "fields[rule]", fieldsRule));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[outcome][service_name]", filterOutcomeServiceName));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[outcome][state]", filterOutcomeState));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[rule][enabled]", filterRuleEnabled));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[rule][id]", filterRuleId));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[rule][name]", filterRuleName));
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.ServiceScorecardsApi.listScorecardOutcomes",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * List all rule outcomes.
+ *
+ * See {@link #listScorecardOutcomesWithHttpInfo}.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<ApiResponse<OutcomesResponse>>
+ */
+ public CompletableFuture> listScorecardOutcomesWithHttpInfoAsync(
+ ListScorecardOutcomesOptionalParameters parameters) {
+ // Check if unstable operation is enabled
+ String operationId = "listScorecardOutcomes";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+ Long pageSize = parameters.pageSize;
+ Long pageOffset = parameters.pageOffset;
+ String include = parameters.include;
+ String fieldsOutcome = parameters.fieldsOutcome;
+ String fieldsRule = parameters.fieldsRule;
+ String filterOutcomeServiceName = parameters.filterOutcomeServiceName;
+ String filterOutcomeState = parameters.filterOutcomeState;
+ Boolean filterRuleEnabled = parameters.filterRuleEnabled;
+ String filterRuleId = parameters.filterRuleId;
+ String filterRuleName = parameters.filterRuleName;
+ // create path and map variables
+ String localVarPath = "/api/v2/scorecard/outcomes";
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "fields[outcome]", fieldsOutcome));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "fields[rule]", fieldsRule));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[outcome][service_name]", filterOutcomeServiceName));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[outcome][state]", filterOutcomeState));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[rule][enabled]", filterRuleEnabled));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[rule][id]", filterRuleId));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[rule][name]", filterRuleName));
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.ServiceScorecardsApi.listScorecardOutcomes",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /** Manage optional parameters to listScorecardRules. */
+ public static class ListScorecardRulesOptionalParameters {
+ private Long pageSize;
+ private Long pageOffset;
+ private String include;
+ private String filterRuleId;
+ private Boolean filterRuleEnabled;
+ private Boolean filterRuleCustom;
+ private String filterRuleName;
+ private String filterRuleDescription;
+ private String fieldsRule;
+ private String fieldsScorecard;
+
+ /**
+ * Set pageSize.
+ *
+ * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default
+ * to 10)
+ * @return ListScorecardRulesOptionalParameters
+ */
+ public ListScorecardRulesOptionalParameters pageSize(Long pageSize) {
this.pageSize = pageSize;
return this;
}
- /**
- * Set pageOffset.
- *
- * @param pageOffset Specific offset to use as the beginning of the returned page. (optional,
- * default to 0)
- * @return ListScorecardOutcomesOptionalParameters
- */
- public ListScorecardOutcomesOptionalParameters pageOffset(Long pageOffset) {
- this.pageOffset = pageOffset;
- return this;
- }
+ /**
+ * Set pageOffset.
+ *
+ * @param pageOffset Specific offset to use as the beginning of the returned page. (optional,
+ * default to 0)
+ * @return ListScorecardRulesOptionalParameters
+ */
+ public ListScorecardRulesOptionalParameters pageOffset(Long pageOffset) {
+ this.pageOffset = pageOffset;
+ return this;
+ }
+
+ /**
+ * Set include.
+ *
+ * @param include Include related scorecard details in the response. (optional)
+ * @return ListScorecardRulesOptionalParameters
+ */
+ public ListScorecardRulesOptionalParameters include(String include) {
+ this.include = include;
+ return this;
+ }
+
+ /**
+ * Set filterRuleId.
+ *
+ * @param filterRuleId Filter the rules on a rule ID. (optional)
+ * @return ListScorecardRulesOptionalParameters
+ */
+ public ListScorecardRulesOptionalParameters filterRuleId(String filterRuleId) {
+ this.filterRuleId = filterRuleId;
+ return this;
+ }
+
+ /**
+ * Set filterRuleEnabled.
+ *
+ * @param filterRuleEnabled Filter for enabled rules only. (optional)
+ * @return ListScorecardRulesOptionalParameters
+ */
+ public ListScorecardRulesOptionalParameters filterRuleEnabled(Boolean filterRuleEnabled) {
+ this.filterRuleEnabled = filterRuleEnabled;
+ return this;
+ }
+
+ /**
+ * Set filterRuleCustom.
+ *
+ * @param filterRuleCustom Filter for custom rules only. (optional)
+ * @return ListScorecardRulesOptionalParameters
+ */
+ public ListScorecardRulesOptionalParameters filterRuleCustom(Boolean filterRuleCustom) {
+ this.filterRuleCustom = filterRuleCustom;
+ return this;
+ }
+
+ /**
+ * Set filterRuleName.
+ *
+ * @param filterRuleName Filter rules on the rule name. (optional)
+ * @return ListScorecardRulesOptionalParameters
+ */
+ public ListScorecardRulesOptionalParameters filterRuleName(String filterRuleName) {
+ this.filterRuleName = filterRuleName;
+ return this;
+ }
+
+ /**
+ * Set filterRuleDescription.
+ *
+ * @param filterRuleDescription Filter rules on the rule description. (optional)
+ * @return ListScorecardRulesOptionalParameters
+ */
+ public ListScorecardRulesOptionalParameters filterRuleDescription(
+ String filterRuleDescription) {
+ this.filterRuleDescription = filterRuleDescription;
+ return this;
+ }
+
+ /**
+ * Set fieldsRule.
+ *
+ * @param fieldsRule Return only specific fields in the response for rule attributes. (optional)
+ * @return ListScorecardRulesOptionalParameters
+ */
+ public ListScorecardRulesOptionalParameters fieldsRule(String fieldsRule) {
+ this.fieldsRule = fieldsRule;
+ return this;
+ }
+
+ /**
+ * Set fieldsScorecard.
+ *
+ * @param fieldsScorecard Return only specific fields in the included response for scorecard
+ * attributes. (optional)
+ * @return ListScorecardRulesOptionalParameters
+ */
+ public ListScorecardRulesOptionalParameters fieldsScorecard(String fieldsScorecard) {
+ this.fieldsScorecard = fieldsScorecard;
+ return this;
+ }
+ }
+
+ /**
+ * List all rules.
+ *
+ * See {@link #listScorecardRulesWithHttpInfo}.
+ *
+ * @return ListRulesResponse
+ * @throws ApiException if fails to make API call
+ */
+ public ListRulesResponse listScorecardRules() throws ApiException {
+ return listScorecardRulesWithHttpInfo(new ListScorecardRulesOptionalParameters()).getData();
+ }
+
+ /**
+ * List all rules.
+ *
+ *
See {@link #listScorecardRulesWithHttpInfoAsync}.
+ *
+ * @return CompletableFuture<ListRulesResponse>
+ */
+ public CompletableFuture listScorecardRulesAsync() {
+ return listScorecardRulesWithHttpInfoAsync(new ListScorecardRulesOptionalParameters())
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * List all rules.
+ *
+ * See {@link #listScorecardRulesWithHttpInfo}.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return ListRulesResponse
+ * @throws ApiException if fails to make API call
+ */
+ public ListRulesResponse listScorecardRules(ListScorecardRulesOptionalParameters parameters)
+ throws ApiException {
+ return listScorecardRulesWithHttpInfo(parameters).getData();
+ }
+
+ /**
+ * List all rules.
+ *
+ *
See {@link #listScorecardRulesWithHttpInfoAsync}.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<ListRulesResponse>
+ */
+ public CompletableFuture listScorecardRulesAsync(
+ ListScorecardRulesOptionalParameters parameters) {
+ return listScorecardRulesWithHttpInfoAsync(parameters)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * List all rules.
+ *
+ * See {@link #listScorecardRulesWithHttpInfo}.
+ *
+ * @return PaginationIterable<ListRulesResponseDataItem>
+ */
+ public PaginationIterable listScorecardRulesWithPagination() {
+ ListScorecardRulesOptionalParameters parameters = new ListScorecardRulesOptionalParameters();
+ return listScorecardRulesWithPagination(parameters);
+ }
+
+ /**
+ * List all rules.
+ *
+ * See {@link #listScorecardRulesWithHttpInfo}.
+ *
+ * @return ListRulesResponse
+ */
+ public PaginationIterable listScorecardRulesWithPagination(
+ ListScorecardRulesOptionalParameters parameters) {
+ String resultsPath = "getData";
+ String valueGetterPath = "";
+ String valueSetterPath = "pageOffset";
+ Boolean valueSetterParamOptional = true;
+ Long limit;
+
+ if (parameters.pageSize == null) {
+ limit = 10l;
+ parameters.pageSize(limit);
+ } else {
+ limit = parameters.pageSize;
+ }
+
+ LinkedHashMap args = new LinkedHashMap();
+ args.put("optionalParams", parameters);
+
+ PaginationIterable iterator =
+ new PaginationIterable(
+ this,
+ "listScorecardRules",
+ resultsPath,
+ valueGetterPath,
+ valueSetterPath,
+ valueSetterParamOptional,
+ true,
+ limit,
+ args);
+
+ return iterator;
+ }
- /**
- * Set include.
- *
- * @param include Include related rule details in the response. (optional)
- * @return ListScorecardOutcomesOptionalParameters
- */
- public ListScorecardOutcomesOptionalParameters include(String include) {
- this.include = include;
- return this;
+ /**
+ * Fetch all rules.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return ApiResponse<ListRulesResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse listScorecardRulesWithHttpInfo(
+ ListScorecardRulesOptionalParameters parameters) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "listScorecardRules";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
}
+ Object localVarPostBody = null;
+ Long pageSize = parameters.pageSize;
+ Long pageOffset = parameters.pageOffset;
+ String include = parameters.include;
+ String filterRuleId = parameters.filterRuleId;
+ Boolean filterRuleEnabled = parameters.filterRuleEnabled;
+ Boolean filterRuleCustom = parameters.filterRuleCustom;
+ String filterRuleName = parameters.filterRuleName;
+ String filterRuleDescription = parameters.filterRuleDescription;
+ String fieldsRule = parameters.fieldsRule;
+ String fieldsScorecard = parameters.fieldsScorecard;
+ // create path and map variables
+ String localVarPath = "/api/v2/scorecard/rules";
- /**
- * Set fieldsOutcome.
- *
- * @param fieldsOutcome Return only specified values in the outcome attributes. (optional)
- * @return ListScorecardOutcomesOptionalParameters
- */
- public ListScorecardOutcomesOptionalParameters fieldsOutcome(String fieldsOutcome) {
- this.fieldsOutcome = fieldsOutcome;
- return this;
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[rule][id]", filterRuleId));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[rule][enabled]", filterRuleEnabled));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[rule][custom]", filterRuleCustom));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[rule][name]", filterRuleName));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[rule][description]", filterRuleDescription));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "fields[rule]", fieldsRule));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "fields[scorecard]", fieldsScorecard));
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.ServiceScorecardsApi.listScorecardRules",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * List all rules.
+ *
+ * See {@link #listScorecardRulesWithHttpInfo}.
+ *
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<ApiResponse<ListRulesResponse>>
+ */
+ public CompletableFuture> listScorecardRulesWithHttpInfoAsync(
+ ListScorecardRulesOptionalParameters parameters) {
+ // Check if unstable operation is enabled
+ String operationId = "listScorecardRules";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
}
+ Object localVarPostBody = null;
+ Long pageSize = parameters.pageSize;
+ Long pageOffset = parameters.pageOffset;
+ String include = parameters.include;
+ String filterRuleId = parameters.filterRuleId;
+ Boolean filterRuleEnabled = parameters.filterRuleEnabled;
+ Boolean filterRuleCustom = parameters.filterRuleCustom;
+ String filterRuleName = parameters.filterRuleName;
+ String filterRuleDescription = parameters.filterRuleDescription;
+ String fieldsRule = parameters.fieldsRule;
+ String fieldsScorecard = parameters.fieldsScorecard;
+ // create path and map variables
+ String localVarPath = "/api/v2/scorecard/rules";
- /**
- * Set fieldsRule.
- *
- * @param fieldsRule Return only specified values in the included rule details. (optional)
- * @return ListScorecardOutcomesOptionalParameters
- */
- public ListScorecardOutcomesOptionalParameters fieldsRule(String fieldsRule) {
- this.fieldsRule = fieldsRule;
- return this;
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[rule][id]", filterRuleId));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[rule][enabled]", filterRuleEnabled));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[rule][custom]", filterRuleCustom));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[rule][name]", filterRuleName));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "filter[rule][description]", filterRuleDescription));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "fields[rule]", fieldsRule));
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "fields[scorecard]", fieldsScorecard));
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.ServiceScorecardsApi.listScorecardRules",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
}
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /** Manage optional parameters to listScorecards. */
+ public static class ListScorecardsOptionalParameters {
+ private Long pageOffset;
+ private Long pageSize;
+ private String filterScorecardId;
+ private String filterScorecardName;
+ private String filterScorecardDescription;
/**
- * Set filterOutcomeServiceName.
+ * Set pageOffset.
*
- * @param filterOutcomeServiceName Filter the outcomes on a specific service name. (optional)
- * @return ListScorecardOutcomesOptionalParameters
+ * @param pageOffset Offset for pagination. (optional, default to 0)
+ * @return ListScorecardsOptionalParameters
*/
- public ListScorecardOutcomesOptionalParameters filterOutcomeServiceName(
- String filterOutcomeServiceName) {
- this.filterOutcomeServiceName = filterOutcomeServiceName;
+ public ListScorecardsOptionalParameters pageOffset(Long pageOffset) {
+ this.pageOffset = pageOffset;
return this;
}
/**
- * Set filterOutcomeState.
+ * Set pageSize.
*
- * @param filterOutcomeState Filter the outcomes by a specific state. (optional)
- * @return ListScorecardOutcomesOptionalParameters
+ * @param pageSize Maximum number of scorecards to return. (optional, default to 100)
+ * @return ListScorecardsOptionalParameters
*/
- public ListScorecardOutcomesOptionalParameters filterOutcomeState(String filterOutcomeState) {
- this.filterOutcomeState = filterOutcomeState;
+ public ListScorecardsOptionalParameters pageSize(Long pageSize) {
+ this.pageSize = pageSize;
return this;
}
/**
- * Set filterRuleEnabled.
+ * Set filterScorecardId.
*
- * @param filterRuleEnabled Filter outcomes on whether a rule is enabled/disabled. (optional)
- * @return ListScorecardOutcomesOptionalParameters
+ * @param filterScorecardId Filter by scorecard ID. (optional)
+ * @return ListScorecardsOptionalParameters
*/
- public ListScorecardOutcomesOptionalParameters filterRuleEnabled(Boolean filterRuleEnabled) {
- this.filterRuleEnabled = filterRuleEnabled;
+ public ListScorecardsOptionalParameters filterScorecardId(String filterScorecardId) {
+ this.filterScorecardId = filterScorecardId;
return this;
}
/**
- * Set filterRuleId.
+ * Set filterScorecardName.
*
- * @param filterRuleId Filter outcomes based on rule ID. (optional)
- * @return ListScorecardOutcomesOptionalParameters
+ * @param filterScorecardName Filter by scorecard name (partial match). (optional)
+ * @return ListScorecardsOptionalParameters
*/
- public ListScorecardOutcomesOptionalParameters filterRuleId(String filterRuleId) {
- this.filterRuleId = filterRuleId;
+ public ListScorecardsOptionalParameters filterScorecardName(String filterScorecardName) {
+ this.filterScorecardName = filterScorecardName;
return this;
}
/**
- * Set filterRuleName.
+ * Set filterScorecardDescription.
*
- * @param filterRuleName Filter outcomes based on rule name. (optional)
- * @return ListScorecardOutcomesOptionalParameters
+ * @param filterScorecardDescription Filter by scorecard description (partial match). (optional)
+ * @return ListScorecardsOptionalParameters
*/
- public ListScorecardOutcomesOptionalParameters filterRuleName(String filterRuleName) {
- this.filterRuleName = filterRuleName;
+ public ListScorecardsOptionalParameters filterScorecardDescription(
+ String filterScorecardDescription) {
+ this.filterScorecardDescription = filterScorecardDescription;
return this;
}
}
/**
- * List all rule outcomes.
- *
- * See {@link #listScorecardOutcomesWithHttpInfo}.
- *
- * @return OutcomesResponse
- * @throws ApiException if fails to make API call
- */
- public OutcomesResponse listScorecardOutcomes() throws ApiException {
- return listScorecardOutcomesWithHttpInfo(new ListScorecardOutcomesOptionalParameters())
- .getData();
- }
-
- /**
- * List all rule outcomes.
- *
- *
See {@link #listScorecardOutcomesWithHttpInfoAsync}.
+ * List all scorecards.
*
- * @return CompletableFuture<OutcomesResponse>
- */
- public CompletableFuture listScorecardOutcomesAsync() {
- return listScorecardOutcomesWithHttpInfoAsync(new ListScorecardOutcomesOptionalParameters())
- .thenApply(
- response -> {
- return response.getData();
- });
- }
-
- /**
- * List all rule outcomes.
+ * See {@link #listScorecardsWithHttpInfo}.
*
- *
See {@link #listScorecardOutcomesWithHttpInfo}.
- *
- * @param parameters Optional parameters for the request.
- * @return OutcomesResponse
+ * @return ListScorecardsResponse
* @throws ApiException if fails to make API call
*/
- public OutcomesResponse listScorecardOutcomes(ListScorecardOutcomesOptionalParameters parameters)
- throws ApiException {
- return listScorecardOutcomesWithHttpInfo(parameters).getData();
+ public ListScorecardsResponse listScorecards() throws ApiException {
+ return listScorecardsWithHttpInfo(new ListScorecardsOptionalParameters()).getData();
}
/**
- * List all rule outcomes.
+ * List all scorecards.
*
- *
See {@link #listScorecardOutcomesWithHttpInfoAsync}.
+ *
See {@link #listScorecardsWithHttpInfoAsync}.
*
- * @param parameters Optional parameters for the request.
- * @return CompletableFuture<OutcomesResponse>
+ * @return CompletableFuture<ListScorecardsResponse>
*/
- public CompletableFuture listScorecardOutcomesAsync(
- ListScorecardOutcomesOptionalParameters parameters) {
- return listScorecardOutcomesWithHttpInfoAsync(parameters)
+ public CompletableFuture listScorecardsAsync() {
+ return listScorecardsWithHttpInfoAsync(new ListScorecardsOptionalParameters())
.thenApply(
response -> {
return response.getData();
@@ -692,118 +3032,85 @@ public CompletableFuture listScorecardOutcomesAsync(
}
/**
- * List all rule outcomes.
+ * List all scorecards.
*
- * See {@link #listScorecardOutcomesWithHttpInfo}.
+ *
See {@link #listScorecardsWithHttpInfo}.
*
- * @return PaginationIterable<OutcomesResponseDataItem>
+ * @param parameters Optional parameters for the request.
+ * @return ListScorecardsResponse
+ * @throws ApiException if fails to make API call
*/
- public PaginationIterable listScorecardOutcomesWithPagination() {
- ListScorecardOutcomesOptionalParameters parameters =
- new ListScorecardOutcomesOptionalParameters();
- return listScorecardOutcomesWithPagination(parameters);
+ public ListScorecardsResponse listScorecards(ListScorecardsOptionalParameters parameters)
+ throws ApiException {
+ return listScorecardsWithHttpInfo(parameters).getData();
}
/**
- * List all rule outcomes.
+ * List all scorecards.
*
- * See {@link #listScorecardOutcomesWithHttpInfo}.
+ *
See {@link #listScorecardsWithHttpInfoAsync}.
*
- * @return OutcomesResponse
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<ListScorecardsResponse>
*/
- public PaginationIterable