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 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; + public CompletableFuture listScorecardsAsync( + ListScorecardsOptionalParameters parameters) { + return listScorecardsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); } /** - * Fetches all rule outcomes. + * Fetches all scorecards. * * @param parameters Optional parameters for the request. - * @return ApiResponse<OutcomesResponse> + * @return ApiResponse<ListScorecardsResponse> * @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 { + public ApiResponse listScorecardsWithHttpInfo( + ListScorecardsOptionalParameters parameters) throws ApiException { // Check if unstable operation is enabled - String operationId = "listScorecardOutcomes"; + String operationId = "listScorecards"; 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; + Long pageSize = parameters.pageSize; + String filterScorecardId = parameters.filterScorecardId; + String filterScorecardName = parameters.filterScorecardName; + String filterScorecardDescription = parameters.filterScorecardDescription; // create path and map variables - String localVarPath = "/api/v2/scorecard/outcomes"; + String localVarPath = "/api/v2/scorecard/scorecards"; 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("", "page[size]", pageSize)); localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[outcome][state]", filterOutcomeState)); + apiClient.parameterToPairs("", "filter[scorecard][id]", filterScorecardId)); localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[rule][enabled]", filterRuleEnabled)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[rule][id]", filterRuleId)); + apiClient.parameterToPairs("", "filter[scorecard][name]", filterScorecardName)); localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[rule][name]", filterRuleName)); + apiClient.parameterToPairs( + "", "filter[scorecard][description]", filterScorecardDescription)); Invocation.Builder builder = apiClient.createBuilder( - "v2.ServiceScorecardsApi.listScorecardOutcomes", + "v2.ServiceScorecardsApi.listScorecards", localVarPath, localVarQueryParams, localVarHeaderParams, @@ -818,66 +3125,56 @@ public ApiResponse listScorecardOutcomesWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * List all rule outcomes. + * List all scorecards. * - *

See {@link #listScorecardOutcomesWithHttpInfo}. + *

See {@link #listScorecardsWithHttpInfo}. * * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<OutcomesResponse>> + * @return CompletableFuture<ApiResponse<ListScorecardsResponse>> */ - public CompletableFuture> listScorecardOutcomesWithHttpInfoAsync( - ListScorecardOutcomesOptionalParameters parameters) { + public CompletableFuture> listScorecardsWithHttpInfoAsync( + ListScorecardsOptionalParameters parameters) { // Check if unstable operation is enabled - String operationId = "listScorecardOutcomes"; + String operationId = "listScorecards"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = new CompletableFuture<>(); + 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; + Long pageSize = parameters.pageSize; + String filterScorecardId = parameters.filterScorecardId; + String filterScorecardName = parameters.filterScorecardName; + String filterScorecardDescription = parameters.filterScorecardDescription; // create path and map variables - String localVarPath = "/api/v2/scorecard/outcomes"; + String localVarPath = "/api/v2/scorecard/scorecards"; 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("", "page[size]", pageSize)); localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[outcome][state]", filterOutcomeState)); + apiClient.parameterToPairs("", "filter[scorecard][id]", filterScorecardId)); localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[rule][enabled]", filterRuleEnabled)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[rule][id]", filterRuleId)); + apiClient.parameterToPairs("", "filter[scorecard][name]", filterScorecardName)); localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[rule][name]", filterRuleName)); + apiClient.parameterToPairs( + "", "filter[scorecard][description]", filterScorecardDescription)); Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.ServiceScorecardsApi.listScorecardOutcomes", + "v2.ServiceScorecardsApi.listScorecards", localVarPath, localVarQueryParams, localVarHeaderParams, @@ -885,7 +3182,7 @@ public CompletableFuture> listScorecardOutcomesWit new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -897,64 +3194,59 @@ public CompletableFuture> listScorecardOutcomesWit localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } - /** Manage optional parameters to listScorecardRules. */ - public static class ListScorecardRulesOptionalParameters { - private Long pageSize; + /** Manage optional parameters to listScorecardScores. */ + public static class ListScorecardScoresOptionalParameters { + private Long pageLimit; private Long pageOffset; - private String include; + private String filterEntityQuery; private String filterRuleId; private Boolean filterRuleEnabled; private Boolean filterRuleCustom; - private String filterRuleName; - private String filterRuleDescription; - private String fieldsRule; - private String fieldsScorecard; + private String sort; /** - * Set pageSize. + * Set pageLimit. * - * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default - * to 10) - * @return ListScorecardRulesOptionalParameters + * @param pageLimit Maximum number of scores to return. (optional, default to 100) + * @return ListScorecardScoresOptionalParameters */ - public ListScorecardRulesOptionalParameters pageSize(Long pageSize) { - this.pageSize = pageSize; + public ListScorecardScoresOptionalParameters pageLimit(Long pageLimit) { + this.pageLimit = pageLimit; return this; } /** * Set pageOffset. * - * @param pageOffset Specific offset to use as the beginning of the returned page. (optional, - * default to 0) - * @return ListScorecardRulesOptionalParameters + * @param pageOffset Offset for pagination. (optional, default to 0) + * @return ListScorecardScoresOptionalParameters */ - public ListScorecardRulesOptionalParameters pageOffset(Long pageOffset) { + public ListScorecardScoresOptionalParameters pageOffset(Long pageOffset) { this.pageOffset = pageOffset; return this; } /** - * Set include. + * Set filterEntityQuery. * - * @param include Include related scorecard details in the response. (optional) - * @return ListScorecardRulesOptionalParameters + * @param filterEntityQuery Entity query filter. (optional) + * @return ListScorecardScoresOptionalParameters */ - public ListScorecardRulesOptionalParameters include(String include) { - this.include = include; + public ListScorecardScoresOptionalParameters filterEntityQuery(String filterEntityQuery) { + this.filterEntityQuery = filterEntityQuery; return this; } /** * Set filterRuleId. * - * @param filterRuleId Filter the rules on a rule ID. (optional) - * @return ListScorecardRulesOptionalParameters + * @param filterRuleId Filter by rule IDs (comma-separated). (optional) + * @return ListScorecardScoresOptionalParameters */ - public ListScorecardRulesOptionalParameters filterRuleId(String filterRuleId) { + public ListScorecardScoresOptionalParameters filterRuleId(String filterRuleId) { this.filterRuleId = filterRuleId; return this; } @@ -962,10 +3254,10 @@ public ListScorecardRulesOptionalParameters filterRuleId(String filterRuleId) { /** * Set filterRuleEnabled. * - * @param filterRuleEnabled Filter for enabled rules only. (optional) - * @return ListScorecardRulesOptionalParameters + * @param filterRuleEnabled Filter by rule enabled status. (optional) + * @return ListScorecardScoresOptionalParameters */ - public ListScorecardRulesOptionalParameters filterRuleEnabled(Boolean filterRuleEnabled) { + public ListScorecardScoresOptionalParameters filterRuleEnabled(Boolean filterRuleEnabled) { this.filterRuleEnabled = filterRuleEnabled; return this; } @@ -973,82 +3265,285 @@ public ListScorecardRulesOptionalParameters filterRuleEnabled(Boolean filterRule /** * Set filterRuleCustom. * - * @param filterRuleCustom Filter for custom rules only. (optional) - * @return ListScorecardRulesOptionalParameters + * @param filterRuleCustom Filter by custom rules. (optional) + * @return ListScorecardScoresOptionalParameters */ - public ListScorecardRulesOptionalParameters filterRuleCustom(Boolean filterRuleCustom) { + public ListScorecardScoresOptionalParameters 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 sort. + * + * @param sort Sort order (comma-separated list of fields; prefix a field with - for descending + * order). (optional) + * @return ListScorecardScoresOptionalParameters + */ + public ListScorecardScoresOptionalParameters sort(String sort) { + this.sort = sort; + return this; + } + } + + /** + * List scores by aggregation. + * + *

See {@link #listScorecardScoresWithHttpInfo}. + * + * @param aggregation Aggregation type (by-entity, by-rule, by-scorecard, by-service, by-team). + * (required) + * @return ListScoresResponse + * @throws ApiException if fails to make API call + */ + public ListScoresResponse listScorecardScores(String aggregation) throws ApiException { + return listScorecardScoresWithHttpInfo(aggregation, new ListScorecardScoresOptionalParameters()) + .getData(); + } + + /** + * List scores by aggregation. + * + *

See {@link #listScorecardScoresWithHttpInfoAsync}. + * + * @param aggregation Aggregation type (by-entity, by-rule, by-scorecard, by-service, by-team). + * (required) + * @return CompletableFuture<ListScoresResponse> + */ + public CompletableFuture listScorecardScoresAsync(String aggregation) { + return listScorecardScoresWithHttpInfoAsync( + aggregation, new ListScorecardScoresOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List scores by aggregation. + * + *

See {@link #listScorecardScoresWithHttpInfo}. + * + * @param aggregation Aggregation type (by-entity, by-rule, by-scorecard, by-service, by-team). + * (required) + * @param parameters Optional parameters for the request. + * @return ListScoresResponse + * @throws ApiException if fails to make API call + */ + public ListScoresResponse listScorecardScores( + String aggregation, ListScorecardScoresOptionalParameters parameters) throws ApiException { + return listScorecardScoresWithHttpInfo(aggregation, parameters).getData(); + } + + /** + * List scores by aggregation. + * + *

See {@link #listScorecardScoresWithHttpInfoAsync}. + * + * @param aggregation Aggregation type (by-entity, by-rule, by-scorecard, by-service, by-team). + * (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ListScoresResponse> + */ + public CompletableFuture listScorecardScoresAsync( + String aggregation, ListScorecardScoresOptionalParameters parameters) { + return listScorecardScoresWithHttpInfoAsync(aggregation, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Fetches scorecard scores aggregated by entity, rule, scorecard, service, or team. + * + * @param aggregation Aggregation type (by-entity, by-rule, by-scorecard, by-service, by-team). + * (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<ListScoresResponse> + * @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 listScorecardScoresWithHttpInfo( + String aggregation, ListScorecardScoresOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listScorecardScores"; + 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 'aggregation' is set + if (aggregation == null) { + throw new ApiException( + 400, "Missing the required parameter 'aggregation' when calling listScorecardScores"); + } + Long pageLimit = parameters.pageLimit; + Long pageOffset = parameters.pageOffset; + String filterEntityQuery = parameters.filterEntityQuery; + String filterRuleId = parameters.filterRuleId; + Boolean filterRuleEnabled = parameters.filterRuleEnabled; + Boolean filterRuleCustom = parameters.filterRuleCustom; + String sort = parameters.sort; + // create path and map variables + String localVarPath = + "/api/v2/scorecard/scores/{aggregation}" + .replaceAll( + "\\{" + "aggregation" + "\\}", apiClient.escapeString(aggregation.toString())); + + 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[entity][query]", filterEntityQuery)); + 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("", "sort", sort)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ServiceScorecardsApi.listScorecardScores", + 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 scores by aggregation. + * + *

See {@link #listScorecardScoresWithHttpInfo}. + * + * @param aggregation Aggregation type (by-entity, by-rule, by-scorecard, by-service, by-team). + * (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<ListScoresResponse>> + */ + public CompletableFuture> listScorecardScoresWithHttpInfoAsync( + String aggregation, ListScorecardScoresOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listScorecardScores"; + 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; - /** - * Set filterRuleDescription. - * - * @param filterRuleDescription Filter rules on the rule description. (optional) - * @return ListScorecardRulesOptionalParameters - */ - public ListScorecardRulesOptionalParameters filterRuleDescription( - String filterRuleDescription) { - this.filterRuleDescription = filterRuleDescription; - return this; + // verify the required parameter 'aggregation' is set + if (aggregation == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'aggregation' when calling listScorecardScores")); + return result; } + Long pageLimit = parameters.pageLimit; + Long pageOffset = parameters.pageOffset; + String filterEntityQuery = parameters.filterEntityQuery; + String filterRuleId = parameters.filterRuleId; + Boolean filterRuleEnabled = parameters.filterRuleEnabled; + Boolean filterRuleCustom = parameters.filterRuleCustom; + String sort = parameters.sort; + // create path and map variables + String localVarPath = + "/api/v2/scorecard/scores/{aggregation}" + .replaceAll( + "\\{" + "aggregation" + "\\}", apiClient.escapeString(aggregation.toString())); - /** - * 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; - } + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); - /** - * 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; + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[entity][query]", filterEntityQuery)); + 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("", "sort", sort)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ServiceScorecardsApi.listScorecardScores", + 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 all rules. + * Set up rules for organization. * - *

See {@link #listScorecardRulesWithHttpInfo}. + *

See {@link #setupScorecardRulesWithHttpInfo}. * - * @return ListRulesResponse + * @param body Setup rules request. (required) * @throws ApiException if fails to make API call */ - public ListRulesResponse listScorecardRules() throws ApiException { - return listScorecardRulesWithHttpInfo(new ListScorecardRulesOptionalParameters()).getData(); + public void setupScorecardRules(SetupRulesRequest body) throws ApiException { + setupScorecardRulesWithHttpInfo(body); } /** - * List all rules. + * Set up rules for organization. * - *

See {@link #listScorecardRulesWithHttpInfoAsync}. + *

See {@link #setupScorecardRulesWithHttpInfoAsync}. * - * @return CompletableFuture<ListRulesResponse> + * @param body Setup rules request. (required) + * @return CompletableFuture */ - public CompletableFuture listScorecardRulesAsync() { - return listScorecardRulesWithHttpInfoAsync(new ListScorecardRulesOptionalParameters()) + public CompletableFuture setupScorecardRulesAsync(SetupRulesRequest body) { + return setupScorecardRulesWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -1056,93 +3551,164 @@ public CompletableFuture listScorecardRulesAsync() { } /** - * List all rules. - * - *

See {@link #listScorecardRulesWithHttpInfo}. + * Sets up default scorecard rules for the organization. * - * @param parameters Optional parameters for the request. - * @return ListRulesResponse + * @param body Setup rules request. (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 ListRulesResponse listScorecardRules(ListScorecardRulesOptionalParameters parameters) + public ApiResponse setupScorecardRulesWithHttpInfo(SetupRulesRequest body) throws ApiException { - return listScorecardRulesWithHttpInfo(parameters).getData(); + // Check if unstable operation is enabled + String operationId = "setupScorecardRules"; + 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 setupScorecardRules"); + } + // create path and map variables + String localVarPath = "/api/v2/scorecard/setup"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ServiceScorecardsApi.setupScorecardRules", + 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); } /** - * List all rules. + * Set up rules for organization. * - *

See {@link #listScorecardRulesWithHttpInfoAsync}. + *

See {@link #setupScorecardRulesWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ListRulesResponse> + * @param body Setup rules request. (required) + * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture listScorecardRulesAsync( - ListScorecardRulesOptionalParameters parameters) { - return listScorecardRulesWithHttpInfoAsync(parameters) - .thenApply( - response -> { - return response.getData(); - }); + public CompletableFuture> setupScorecardRulesWithHttpInfoAsync( + SetupRulesRequest body) { + // Check if unstable operation is enabled + String operationId = "setupScorecardRules"; + 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 setupScorecardRules")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/scorecard/setup"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ServiceScorecardsApi.setupScorecardRules", + 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); } /** - * List all rules. + * Update a campaign. * - *

See {@link #listScorecardRulesWithHttpInfo}. + *

See {@link #updateScorecardCampaignWithHttpInfo}. * - * @return PaginationIterable<ListRulesResponseDataItem> + * @param campaignId Campaign ID or key. (required) + * @param body Campaign data. (required) + * @return CampaignResponse + * @throws ApiException if fails to make API call */ - public PaginationIterable listScorecardRulesWithPagination() { - ListScorecardRulesOptionalParameters parameters = new ListScorecardRulesOptionalParameters(); - return listScorecardRulesWithPagination(parameters); + public CampaignResponse updateScorecardCampaign(String campaignId, UpdateCampaignRequest body) + throws ApiException { + return updateScorecardCampaignWithHttpInfo(campaignId, body).getData(); } /** - * List all rules. + * Update a campaign. * - *

See {@link #listScorecardRulesWithHttpInfo}. + *

See {@link #updateScorecardCampaignWithHttpInfoAsync}. * - * @return ListRulesResponse + * @param campaignId Campaign ID or key. (required) + * @param body Campaign data. (required) + * @return CompletableFuture<CampaignResponse> */ - 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; + public CompletableFuture updateScorecardCampaignAsync( + String campaignId, UpdateCampaignRequest body) { + return updateScorecardCampaignWithHttpInfoAsync(campaignId, body) + .thenApply( + response -> { + return response.getData(); + }); } /** - * Fetch all rules. + * Updates an existing campaign. * - * @param parameters Optional parameters for the request. - * @return ApiResponse<ListRulesResponse> + * @param campaignId Campaign ID or key. (required) + * @param body Campaign data. (required) + * @return ApiResponse<CampaignResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -1151,149 +3717,134 @@ public PaginationIterable listScorecardRulesWithPagin * * * + * * *
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse listScorecardRulesWithHttpInfo( - ListScorecardRulesOptionalParameters parameters) throws ApiException { + public ApiResponse updateScorecardCampaignWithHttpInfo( + String campaignId, UpdateCampaignRequest body) throws ApiException { // Check if unstable operation is enabled - String operationId = "listScorecardRules"; + String operationId = "updateScorecardCampaign"; 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; + Object localVarPostBody = body; + + // verify the required parameter 'campaignId' is set + if (campaignId == null) { + throw new ApiException( + 400, "Missing the required parameter 'campaignId' when calling updateScorecardCampaign"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateScorecardCampaign"); + } // create path and map variables - String localVarPath = "/api/v2/scorecard/rules"; + 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("", "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", + "v2.ServiceScorecardsApi.updateScorecardCampaign", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "GET", + "PUT", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * List all rules. + * Update a campaign. * - *

See {@link #listScorecardRulesWithHttpInfo}. + *

See {@link #updateScorecardCampaignWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<ListRulesResponse>> + * @param campaignId Campaign ID or key. (required) + * @param body Campaign data. (required) + * @return CompletableFuture<ApiResponse<CampaignResponse>> */ - public CompletableFuture> listScorecardRulesWithHttpInfoAsync( - ListScorecardRulesOptionalParameters parameters) { + public CompletableFuture> updateScorecardCampaignWithHttpInfoAsync( + String campaignId, UpdateCampaignRequest body) { // Check if unstable operation is enabled - String operationId = "listScorecardRules"; + String operationId = "updateScorecardCampaign"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = new CompletableFuture<>(); + 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; + 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 updateScorecardCampaign")); + 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 updateScorecardCampaign")); + return result; + } // create path and map variables - String localVarPath = "/api/v2/scorecard/rules"; + 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("", "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", + "v2.ServiceScorecardsApi.updateScorecardCampaign", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "GET", + "PUT", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -1618,4 +4169,184 @@ public CompletableFuture> updateScorecardRuleWit false, new GenericType() {}); } + + /** + * Associate workflow with rule. + * + *

See {@link #updateScorecardRuleWorkflowWithHttpInfo}. + * + * @param ruleId The ID of the rule. (required) + * @param workflowId Workflow ID. (required) + * @throws ApiException if fails to make API call + */ + public void updateScorecardRuleWorkflow(String ruleId, String workflowId) throws ApiException { + updateScorecardRuleWorkflowWithHttpInfo(ruleId, workflowId); + } + + /** + * Associate workflow with rule. + * + *

See {@link #updateScorecardRuleWorkflowWithHttpInfoAsync}. + * + * @param ruleId The ID of the rule. (required) + * @param workflowId Workflow ID. (required) + * @return CompletableFuture + */ + public CompletableFuture updateScorecardRuleWorkflowAsync( + String ruleId, String workflowId) { + return updateScorecardRuleWorkflowWithHttpInfoAsync(ruleId, workflowId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Associates a workflow with a scorecard rule. + * + * @param ruleId The ID of the rule. (required) + * @param workflowId Workflow ID. (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 updateScorecardRuleWorkflowWithHttpInfo(String ruleId, String workflowId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateScorecardRuleWorkflow"; + 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 updateScorecardRuleWorkflow"); + } + + // verify the required parameter 'workflowId' is set + if (workflowId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'workflowId' when calling updateScorecardRuleWorkflow"); + } + // create path and map variables + String localVarPath = + "/api/v2/scorecard/rules/{rule_id}/workflow/{workflow_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())) + .replaceAll( + "\\{" + "workflow_id" + "\\}", apiClient.escapeString(workflowId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ServiceScorecardsApi.updateScorecardRuleWorkflow", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Associate workflow with rule. + * + *

See {@link #updateScorecardRuleWorkflowWithHttpInfo}. + * + * @param ruleId The ID of the rule. (required) + * @param workflowId Workflow ID. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> updateScorecardRuleWorkflowWithHttpInfoAsync( + String ruleId, String workflowId) { + // Check if unstable operation is enabled + String operationId = "updateScorecardRuleWorkflow"; + 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 updateScorecardRuleWorkflow")); + return result; + } + + // verify the required parameter 'workflowId' is set + if (workflowId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'workflowId' when calling" + + " updateScorecardRuleWorkflow")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/scorecard/rules/{rule_id}/workflow/{workflow_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())) + .replaceAll( + "\\{" + "workflow_id" + "\\}", apiClient.escapeString(workflowId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ServiceScorecardsApi.updateScorecardRuleWorkflow", + 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( + "PUT", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } } diff --git a/src/main/java/com/datadog/api/client/v2/model/CampaignResponse.java b/src/main/java/com/datadog/api/client/v2/model/CampaignResponse.java new file mode 100644 index 00000000000..d83a7f42252 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CampaignResponse.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response containing campaign data. */ +@JsonPropertyOrder({CampaignResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CampaignResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CampaignResponseData data; + + public CampaignResponse() {} + + @JsonCreator + public CampaignResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CampaignResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CampaignResponse data(CampaignResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Campaign data. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CampaignResponseData getData() { + return data; + } + + public void setData(CampaignResponseData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CampaignResponse + */ + @JsonAnySetter + public CampaignResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CampaignResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CampaignResponse campaignResponse = (CampaignResponse) o; + return Objects.equals(this.data, campaignResponse.data) + && Objects.equals(this.additionalProperties, campaignResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CampaignResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CampaignResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CampaignResponseAttributes.java new file mode 100644 index 00000000000..61569f033ef --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CampaignResponseAttributes.java @@ -0,0 +1,435 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Campaign attributes. */ +@JsonPropertyOrder({ + CampaignResponseAttributes.JSON_PROPERTY_CREATED_AT, + CampaignResponseAttributes.JSON_PROPERTY_DESCRIPTION, + CampaignResponseAttributes.JSON_PROPERTY_DUE_DATE, + CampaignResponseAttributes.JSON_PROPERTY_ENTITY_SCOPE, + CampaignResponseAttributes.JSON_PROPERTY_GUIDANCE, + CampaignResponseAttributes.JSON_PROPERTY_KEY, + CampaignResponseAttributes.JSON_PROPERTY_MODIFIED_AT, + CampaignResponseAttributes.JSON_PROPERTY_NAME, + CampaignResponseAttributes.JSON_PROPERTY_OWNER, + CampaignResponseAttributes.JSON_PROPERTY_START_DATE, + CampaignResponseAttributes.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CampaignResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_DUE_DATE = "due_date"; + private OffsetDateTime dueDate; + + public static final String JSON_PROPERTY_ENTITY_SCOPE = "entity_scope"; + private String entityScope; + + public static final String JSON_PROPERTY_GUIDANCE = "guidance"; + private String guidance; + + public static final String JSON_PROPERTY_KEY = "key"; + private String key; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_OWNER = "owner"; + private String owner; + + public static final String JSON_PROPERTY_START_DATE = "start_date"; + private OffsetDateTime startDate; + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public CampaignResponseAttributes() {} + + @JsonCreator + public CampaignResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_KEY) String key, + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_AT) OffsetDateTime modifiedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_OWNER) String owner, + @JsonProperty(required = true, value = JSON_PROPERTY_START_DATE) OffsetDateTime startDate, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) String status) { + this.createdAt = createdAt; + this.key = key; + this.modifiedAt = modifiedAt; + this.name = name; + this.owner = owner; + this.startDate = startDate; + this.status = status; + } + + public CampaignResponseAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Creation time of the campaign. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public CampaignResponseAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The description of the campaign. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public CampaignResponseAttributes dueDate(OffsetDateTime dueDate) { + this.dueDate = dueDate; + return this; + } + + /** + * The due date of the campaign. + * + * @return dueDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DUE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDueDate() { + return dueDate; + } + + public void setDueDate(OffsetDateTime dueDate) { + this.dueDate = dueDate; + } + + public CampaignResponseAttributes entityScope(String entityScope) { + this.entityScope = entityScope; + return this; + } + + /** + * Entity scope query to filter entities for this campaign. + * + * @return entityScope + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENTITY_SCOPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEntityScope() { + return entityScope; + } + + public void setEntityScope(String entityScope) { + this.entityScope = entityScope; + } + + public CampaignResponseAttributes guidance(String guidance) { + this.guidance = guidance; + return this; + } + + /** + * Guidance for the campaign. + * + * @return guidance + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GUIDANCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGuidance() { + return guidance; + } + + public void setGuidance(String guidance) { + this.guidance = guidance; + } + + public CampaignResponseAttributes key(String key) { + this.key = key; + return this; + } + + /** + * The unique key for the campaign. + * + * @return key + */ + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public CampaignResponseAttributes modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Time of last campaign modification. + * + * @return modifiedAt + */ + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public void setModifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + } + + public CampaignResponseAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the campaign. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CampaignResponseAttributes owner(String owner) { + this.owner = owner; + return this; + } + + /** + * The UUID of the campaign owner. + * + * @return owner + */ + @JsonProperty(JSON_PROPERTY_OWNER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public CampaignResponseAttributes startDate(OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * The start date of the campaign. + * + * @return startDate + */ + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(OffsetDateTime startDate) { + this.startDate = startDate; + } + + public CampaignResponseAttributes status(String status) { + this.status = status; + return this; + } + + /** + * The status of the campaign. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CampaignResponseAttributes + */ + @JsonAnySetter + public CampaignResponseAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CampaignResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CampaignResponseAttributes campaignResponseAttributes = (CampaignResponseAttributes) o; + return Objects.equals(this.createdAt, campaignResponseAttributes.createdAt) + && Objects.equals(this.description, campaignResponseAttributes.description) + && Objects.equals(this.dueDate, campaignResponseAttributes.dueDate) + && Objects.equals(this.entityScope, campaignResponseAttributes.entityScope) + && Objects.equals(this.guidance, campaignResponseAttributes.guidance) + && Objects.equals(this.key, campaignResponseAttributes.key) + && Objects.equals(this.modifiedAt, campaignResponseAttributes.modifiedAt) + && Objects.equals(this.name, campaignResponseAttributes.name) + && Objects.equals(this.owner, campaignResponseAttributes.owner) + && Objects.equals(this.startDate, campaignResponseAttributes.startDate) + && Objects.equals(this.status, campaignResponseAttributes.status) + && Objects.equals( + this.additionalProperties, campaignResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdAt, + description, + dueDate, + entityScope, + guidance, + key, + modifiedAt, + name, + owner, + startDate, + status, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CampaignResponseAttributes {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" dueDate: ").append(toIndentedString(dueDate)).append("\n"); + sb.append(" entityScope: ").append(toIndentedString(entityScope)).append("\n"); + sb.append(" guidance: ").append(toIndentedString(guidance)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" owner: ").append(toIndentedString(owner)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CampaignResponseData.java b/src/main/java/com/datadog/api/client/v2/model/CampaignResponseData.java new file mode 100644 index 00000000000..c2bb7b8f27a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CampaignResponseData.java @@ -0,0 +1,209 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Campaign data. */ +@JsonPropertyOrder({ + CampaignResponseData.JSON_PROPERTY_ATTRIBUTES, + CampaignResponseData.JSON_PROPERTY_ID, + CampaignResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CampaignResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CampaignResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CampaignType type; + + public CampaignResponseData() {} + + @JsonCreator + public CampaignResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CampaignResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CampaignType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CampaignResponseData attributes(CampaignResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Campaign attributes. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CampaignResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CampaignResponseAttributes attributes) { + this.attributes = attributes; + } + + public CampaignResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The unique ID of the campaign. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CampaignResponseData type(CampaignType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The JSON:API type for campaigns. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CampaignType getType() { + return type; + } + + public void setType(CampaignType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CampaignResponseData + */ + @JsonAnySetter + public CampaignResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CampaignResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CampaignResponseData campaignResponseData = (CampaignResponseData) o; + return Objects.equals(this.attributes, campaignResponseData.attributes) + && Objects.equals(this.id, campaignResponseData.id) + && Objects.equals(this.type, campaignResponseData.type) + && Objects.equals(this.additionalProperties, campaignResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CampaignResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CampaignStatus.java b/src/main/java/com/datadog/api/client/v2/model/CampaignStatus.java new file mode 100644 index 00000000000..ada94335c5a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CampaignStatus.java @@ -0,0 +1,56 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The status of the campaign. */ +@JsonSerialize(using = CampaignStatus.CampaignStatusSerializer.class) +public class CampaignStatus extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("in_progress", "not_started", "completed")); + + public static final CampaignStatus IN_PROGRESS = new CampaignStatus("in_progress"); + public static final CampaignStatus NOT_STARTED = new CampaignStatus("not_started"); + public static final CampaignStatus COMPLETED = new CampaignStatus("completed"); + + CampaignStatus(String value) { + super(value, allowedValues); + } + + public static class CampaignStatusSerializer extends StdSerializer { + public CampaignStatusSerializer(Class t) { + super(t); + } + + public CampaignStatusSerializer() { + this(null); + } + + @Override + public void serialize(CampaignStatus value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CampaignStatus fromValue(String value) { + return new CampaignStatus(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CampaignType.java b/src/main/java/com/datadog/api/client/v2/model/CampaignType.java new file mode 100644 index 00000000000..49b9e4ba2cf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CampaignType.java @@ -0,0 +1,53 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The JSON:API type for campaigns. */ +@JsonSerialize(using = CampaignType.CampaignTypeSerializer.class) +public class CampaignType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("campaign")); + + public static final CampaignType CAMPAIGN = new CampaignType("campaign"); + + CampaignType(String value) { + super(value, allowedValues); + } + + public static class CampaignTypeSerializer extends StdSerializer { + public CampaignTypeSerializer(Class t) { + super(t); + } + + public CampaignTypeSerializer() { + this(null); + } + + @Override + public void serialize(CampaignType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CampaignType fromValue(String value) { + return new CampaignType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateCampaignRequest.java b/src/main/java/com/datadog/api/client/v2/model/CreateCampaignRequest.java new file mode 100644 index 00000000000..a0aa71b2548 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateCampaignRequest.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request to create a new campaign. */ +@JsonPropertyOrder({CreateCampaignRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateCampaignRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CreateCampaignRequestData data; + + public CreateCampaignRequest() {} + + @JsonCreator + public CreateCampaignRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CreateCampaignRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CreateCampaignRequest data(CreateCampaignRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for creating a new campaign. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CreateCampaignRequestData getData() { + return data; + } + + public void setData(CreateCampaignRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateCampaignRequest + */ + @JsonAnySetter + public CreateCampaignRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateCampaignRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateCampaignRequest createCampaignRequest = (CreateCampaignRequest) o; + return Objects.equals(this.data, createCampaignRequest.data) + && Objects.equals(this.additionalProperties, createCampaignRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateCampaignRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateCampaignRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateCampaignRequestAttributes.java new file mode 100644 index 00000000000..83b51b2684d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateCampaignRequestAttributes.java @@ -0,0 +1,417 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes for creating a new campaign. */ +@JsonPropertyOrder({ + CreateCampaignRequestAttributes.JSON_PROPERTY_DESCRIPTION, + CreateCampaignRequestAttributes.JSON_PROPERTY_DUE_DATE, + CreateCampaignRequestAttributes.JSON_PROPERTY_ENTITY_SCOPE, + CreateCampaignRequestAttributes.JSON_PROPERTY_GUIDANCE, + CreateCampaignRequestAttributes.JSON_PROPERTY_KEY, + CreateCampaignRequestAttributes.JSON_PROPERTY_NAME, + CreateCampaignRequestAttributes.JSON_PROPERTY_OWNER_ID, + CreateCampaignRequestAttributes.JSON_PROPERTY_RULE_IDS, + CreateCampaignRequestAttributes.JSON_PROPERTY_START_DATE, + CreateCampaignRequestAttributes.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateCampaignRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_DUE_DATE = "due_date"; + private OffsetDateTime dueDate; + + public static final String JSON_PROPERTY_ENTITY_SCOPE = "entity_scope"; + private String entityScope; + + public static final String JSON_PROPERTY_GUIDANCE = "guidance"; + private String guidance; + + public static final String JSON_PROPERTY_KEY = "key"; + private String key; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_OWNER_ID = "owner_id"; + private String ownerId; + + public static final String JSON_PROPERTY_RULE_IDS = "rule_ids"; + private List ruleIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_START_DATE = "start_date"; + private OffsetDateTime startDate; + + public static final String JSON_PROPERTY_STATUS = "status"; + private CampaignStatus status; + + public CreateCampaignRequestAttributes() {} + + @JsonCreator + public CreateCampaignRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_KEY) String key, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_OWNER_ID) String ownerId, + @JsonProperty(required = true, value = JSON_PROPERTY_RULE_IDS) List ruleIds, + @JsonProperty(required = true, value = JSON_PROPERTY_START_DATE) OffsetDateTime startDate) { + this.key = key; + this.name = name; + this.ownerId = ownerId; + this.ruleIds = ruleIds; + this.startDate = startDate; + } + + public CreateCampaignRequestAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The description of the campaign. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public CreateCampaignRequestAttributes dueDate(OffsetDateTime dueDate) { + this.dueDate = dueDate; + return this; + } + + /** + * The due date of the campaign. + * + * @return dueDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DUE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDueDate() { + return dueDate; + } + + public void setDueDate(OffsetDateTime dueDate) { + this.dueDate = dueDate; + } + + public CreateCampaignRequestAttributes entityScope(String entityScope) { + this.entityScope = entityScope; + return this; + } + + /** + * Entity scope query to filter entities for this campaign. + * + * @return entityScope + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENTITY_SCOPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEntityScope() { + return entityScope; + } + + public void setEntityScope(String entityScope) { + this.entityScope = entityScope; + } + + public CreateCampaignRequestAttributes guidance(String guidance) { + this.guidance = guidance; + return this; + } + + /** + * Guidance for the campaign. + * + * @return guidance + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GUIDANCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGuidance() { + return guidance; + } + + public void setGuidance(String guidance) { + this.guidance = guidance; + } + + public CreateCampaignRequestAttributes key(String key) { + this.key = key; + return this; + } + + /** + * The unique key for the campaign. + * + * @return key + */ + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public CreateCampaignRequestAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the campaign. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreateCampaignRequestAttributes ownerId(String ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * The UUID of the campaign owner. + * + * @return ownerId + */ + @JsonProperty(JSON_PROPERTY_OWNER_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getOwnerId() { + return ownerId; + } + + public void setOwnerId(String ownerId) { + this.ownerId = ownerId; + } + + public CreateCampaignRequestAttributes ruleIds(List ruleIds) { + this.ruleIds = ruleIds; + return this; + } + + public CreateCampaignRequestAttributes addRuleIdsItem(String ruleIdsItem) { + this.ruleIds.add(ruleIdsItem); + return this; + } + + /** + * Array of rule IDs associated with this campaign. + * + * @return ruleIds + */ + @JsonProperty(JSON_PROPERTY_RULE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getRuleIds() { + return ruleIds; + } + + public void setRuleIds(List ruleIds) { + this.ruleIds = ruleIds; + } + + public CreateCampaignRequestAttributes startDate(OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * The start date of the campaign. + * + * @return startDate + */ + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(OffsetDateTime startDate) { + this.startDate = startDate; + } + + public CreateCampaignRequestAttributes status(CampaignStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * The status of the campaign. + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CampaignStatus getStatus() { + return status; + } + + public void setStatus(CampaignStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateCampaignRequestAttributes + */ + @JsonAnySetter + public CreateCampaignRequestAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateCampaignRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateCampaignRequestAttributes createCampaignRequestAttributes = + (CreateCampaignRequestAttributes) o; + return Objects.equals(this.description, createCampaignRequestAttributes.description) + && Objects.equals(this.dueDate, createCampaignRequestAttributes.dueDate) + && Objects.equals(this.entityScope, createCampaignRequestAttributes.entityScope) + && Objects.equals(this.guidance, createCampaignRequestAttributes.guidance) + && Objects.equals(this.key, createCampaignRequestAttributes.key) + && Objects.equals(this.name, createCampaignRequestAttributes.name) + && Objects.equals(this.ownerId, createCampaignRequestAttributes.ownerId) + && Objects.equals(this.ruleIds, createCampaignRequestAttributes.ruleIds) + && Objects.equals(this.startDate, createCampaignRequestAttributes.startDate) + && Objects.equals(this.status, createCampaignRequestAttributes.status) + && Objects.equals( + this.additionalProperties, createCampaignRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + description, + dueDate, + entityScope, + guidance, + key, + name, + ownerId, + ruleIds, + startDate, + status, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateCampaignRequestAttributes {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" dueDate: ").append(toIndentedString(dueDate)).append("\n"); + sb.append(" entityScope: ").append(toIndentedString(entityScope)).append("\n"); + sb.append(" guidance: ").append(toIndentedString(guidance)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ownerId: ").append(toIndentedString(ownerId)).append("\n"); + sb.append(" ruleIds: ").append(toIndentedString(ruleIds)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateCampaignRequestData.java b/src/main/java/com/datadog/api/client/v2/model/CreateCampaignRequestData.java new file mode 100644 index 00000000000..08de24f1958 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateCampaignRequestData.java @@ -0,0 +1,182 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for creating a new campaign. */ +@JsonPropertyOrder({ + CreateCampaignRequestData.JSON_PROPERTY_ATTRIBUTES, + CreateCampaignRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateCampaignRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CreateCampaignRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CampaignType type; + + public CreateCampaignRequestData() {} + + @JsonCreator + public CreateCampaignRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CreateCampaignRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CampaignType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CreateCampaignRequestData attributes(CreateCampaignRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for creating a new campaign. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CreateCampaignRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CreateCampaignRequestAttributes attributes) { + this.attributes = attributes; + } + + public CreateCampaignRequestData type(CampaignType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The JSON:API type for campaigns. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CampaignType getType() { + return type; + } + + public void setType(CampaignType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateCampaignRequestData + */ + @JsonAnySetter + public CreateCampaignRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateCampaignRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateCampaignRequestData createCampaignRequestData = (CreateCampaignRequestData) o; + return Objects.equals(this.attributes, createCampaignRequestData.attributes) + && Objects.equals(this.type, createCampaignRequestData.type) + && Objects.equals( + this.additionalProperties, createCampaignRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateCampaignRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DefaultRuleResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DefaultRuleResponseAttributes.java new file mode 100644 index 00000000000..c42d0da34ee --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DefaultRuleResponseAttributes.java @@ -0,0 +1,292 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Default rule attributes. */ +@JsonPropertyOrder({ + DefaultRuleResponseAttributes.JSON_PROPERTY_DESCRIPTION, + DefaultRuleResponseAttributes.JSON_PROPERTY_LEVEL, + DefaultRuleResponseAttributes.JSON_PROPERTY_NAME, + DefaultRuleResponseAttributes.JSON_PROPERTY_SCOPE_REQUIRED, + DefaultRuleResponseAttributes.JSON_PROPERTY_SCORECARD_DESCRIPTION, + DefaultRuleResponseAttributes.JSON_PROPERTY_SCORECARD_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DefaultRuleResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_LEVEL = "level"; + private Long level; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SCOPE_REQUIRED = "scope_required"; + private String scopeRequired; + + public static final String JSON_PROPERTY_SCORECARD_DESCRIPTION = "scorecard_description"; + private String scorecardDescription; + + public static final String JSON_PROPERTY_SCORECARD_NAME = "scorecard_name"; + private String scorecardName; + + public DefaultRuleResponseAttributes() {} + + @JsonCreator + public DefaultRuleResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_SCORECARD_NAME) String scorecardName) { + this.name = name; + this.scorecardName = scorecardName; + } + + public DefaultRuleResponseAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The description of the default rule. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public DefaultRuleResponseAttributes level(Long level) { + this.level = level; + return this; + } + + /** + * The maturity level of the rule. + * + * @return level + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getLevel() { + return level; + } + + public void setLevel(Long level) { + this.level = level; + } + + public DefaultRuleResponseAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the default rule. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public DefaultRuleResponseAttributes scopeRequired(String scopeRequired) { + this.scopeRequired = scopeRequired; + return this; + } + + /** + * Required scope for the rule. + * + * @return scopeRequired + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCOPE_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScopeRequired() { + return scopeRequired; + } + + public void setScopeRequired(String scopeRequired) { + this.scopeRequired = scopeRequired; + } + + public DefaultRuleResponseAttributes scorecardDescription(String scorecardDescription) { + this.scorecardDescription = scorecardDescription; + return this; + } + + /** + * The description of the scorecard. + * + * @return scorecardDescription + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCORECARD_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScorecardDescription() { + return scorecardDescription; + } + + public void setScorecardDescription(String scorecardDescription) { + this.scorecardDescription = scorecardDescription; + } + + public DefaultRuleResponseAttributes scorecardName(String scorecardName) { + this.scorecardName = scorecardName; + return this; + } + + /** + * The scorecard this rule belongs to. + * + * @return scorecardName + */ + @JsonProperty(JSON_PROPERTY_SCORECARD_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getScorecardName() { + return scorecardName; + } + + public void setScorecardName(String scorecardName) { + this.scorecardName = scorecardName; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DefaultRuleResponseAttributes + */ + @JsonAnySetter + public DefaultRuleResponseAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DefaultRuleResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DefaultRuleResponseAttributes defaultRuleResponseAttributes = (DefaultRuleResponseAttributes) o; + return Objects.equals(this.description, defaultRuleResponseAttributes.description) + && Objects.equals(this.level, defaultRuleResponseAttributes.level) + && Objects.equals(this.name, defaultRuleResponseAttributes.name) + && Objects.equals(this.scopeRequired, defaultRuleResponseAttributes.scopeRequired) + && Objects.equals( + this.scorecardDescription, defaultRuleResponseAttributes.scorecardDescription) + && Objects.equals(this.scorecardName, defaultRuleResponseAttributes.scorecardName) + && Objects.equals( + this.additionalProperties, defaultRuleResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + description, + level, + name, + scopeRequired, + scorecardDescription, + scorecardName, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DefaultRuleResponseAttributes {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" level: ").append(toIndentedString(level)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" scopeRequired: ").append(toIndentedString(scopeRequired)).append("\n"); + sb.append(" scorecardDescription: ") + .append(toIndentedString(scorecardDescription)) + .append("\n"); + sb.append(" scorecardName: ").append(toIndentedString(scorecardName)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DefaultRuleResponseData.java b/src/main/java/com/datadog/api/client/v2/model/DefaultRuleResponseData.java new file mode 100644 index 00000000000..dd91683f82d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DefaultRuleResponseData.java @@ -0,0 +1,209 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Default rule data. */ +@JsonPropertyOrder({ + DefaultRuleResponseData.JSON_PROPERTY_ATTRIBUTES, + DefaultRuleResponseData.JSON_PROPERTY_ID, + DefaultRuleResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DefaultRuleResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private DefaultRuleResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DefaultRuleType type; + + public DefaultRuleResponseData() {} + + @JsonCreator + public DefaultRuleResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + DefaultRuleResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) DefaultRuleType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public DefaultRuleResponseData attributes(DefaultRuleResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Default rule attributes. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DefaultRuleResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(DefaultRuleResponseAttributes attributes) { + this.attributes = attributes; + } + + public DefaultRuleResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The unique ID of the default rule. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DefaultRuleResponseData type(DefaultRuleType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The JSON:API type for default rules. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DefaultRuleType getType() { + return type; + } + + public void setType(DefaultRuleType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DefaultRuleResponseData + */ + @JsonAnySetter + public DefaultRuleResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DefaultRuleResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DefaultRuleResponseData defaultRuleResponseData = (DefaultRuleResponseData) o; + return Objects.equals(this.attributes, defaultRuleResponseData.attributes) + && Objects.equals(this.id, defaultRuleResponseData.id) + && Objects.equals(this.type, defaultRuleResponseData.type) + && Objects.equals(this.additionalProperties, defaultRuleResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DefaultRuleResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DefaultRuleType.java b/src/main/java/com/datadog/api/client/v2/model/DefaultRuleType.java new file mode 100644 index 00000000000..415bf13bf69 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DefaultRuleType.java @@ -0,0 +1,54 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The JSON:API type for default rules. */ +@JsonSerialize(using = DefaultRuleType.DefaultRuleTypeSerializer.class) +public class DefaultRuleType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("default-rule")); + + public static final DefaultRuleType DEFAULT_RULE = new DefaultRuleType("default-rule"); + + DefaultRuleType(String value) { + super(value, allowedValues); + } + + public static class DefaultRuleTypeSerializer extends StdSerializer { + public DefaultRuleTypeSerializer(Class t) { + super(t); + } + + public DefaultRuleTypeSerializer() { + this(null); + } + + @Override + public void serialize(DefaultRuleType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DefaultRuleType fromValue(String value) { + return new DefaultRuleType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/EntityOwnerDestination.java b/src/main/java/com/datadog/api/client/v2/model/EntityOwnerDestination.java new file mode 100644 index 00000000000..66a5b01bcee --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/EntityOwnerDestination.java @@ -0,0 +1,175 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Entity owner and Slack destination for team reports. */ +@JsonPropertyOrder({ + EntityOwnerDestination.JSON_PROPERTY_SLACK, + EntityOwnerDestination.JSON_PROPERTY_TEAM_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EntityOwnerDestination { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SLACK = "slack"; + private SlackRoutingOptions slack; + + public static final String JSON_PROPERTY_TEAM_ID = "team_id"; + private String teamId; + + public EntityOwnerDestination() {} + + @JsonCreator + public EntityOwnerDestination( + @JsonProperty(required = true, value = JSON_PROPERTY_SLACK) SlackRoutingOptions slack, + @JsonProperty(required = true, value = JSON_PROPERTY_TEAM_ID) String teamId) { + this.slack = slack; + this.unparsed |= slack.unparsed; + this.teamId = teamId; + } + + public EntityOwnerDestination slack(SlackRoutingOptions slack) { + this.slack = slack; + this.unparsed |= slack.unparsed; + return this; + } + + /** + * Slack routing options for report delivery. + * + * @return slack + */ + @JsonProperty(JSON_PROPERTY_SLACK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SlackRoutingOptions getSlack() { + return slack; + } + + public void setSlack(SlackRoutingOptions slack) { + this.slack = slack; + } + + public EntityOwnerDestination teamId(String teamId) { + this.teamId = teamId; + return this; + } + + /** + * Team UUID. + * + * @return teamId + */ + @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTeamId() { + return teamId; + } + + public void setTeamId(String teamId) { + this.teamId = teamId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return EntityOwnerDestination + */ + @JsonAnySetter + public EntityOwnerDestination putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this EntityOwnerDestination object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EntityOwnerDestination entityOwnerDestination = (EntityOwnerDestination) o; + return Objects.equals(this.slack, entityOwnerDestination.slack) + && Objects.equals(this.teamId, entityOwnerDestination.teamId) + && Objects.equals(this.additionalProperties, entityOwnerDestination.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(slack, teamId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EntityOwnerDestination {\n"); + sb.append(" slack: ").append(toIndentedString(slack)).append("\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FacetItem.java b/src/main/java/com/datadog/api/client/v2/model/FacetItem.java new file mode 100644 index 00000000000..ef78fe3a404 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FacetItem.java @@ -0,0 +1,170 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Facet item with count. */ +@JsonPropertyOrder({FacetItem.JSON_PROPERTY_NAME, FacetItem.JSON_PROPERTY_VALUE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FacetItem { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Long value; + + public FacetItem() {} + + @JsonCreator + public FacetItem( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) Long value) { + this.name = name; + this.value = value; + } + + public FacetItem name(String name) { + this.name = name; + return this; + } + + /** + * The name of the facet value. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public FacetItem value(Long value) { + this.value = value; + return this; + } + + /** + * The count for this facet value. + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getValue() { + return value; + } + + public void setValue(Long value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FacetItem + */ + @JsonAnySetter + public FacetItem putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FacetItem object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FacetItem facetItem = (FacetItem) o; + return Objects.equals(this.name, facetItem.name) + && Objects.equals(this.value, facetItem.value) + && Objects.equals(this.additionalProperties, facetItem.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FacetItem {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FacetResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/FacetResponseAttributes.java new file mode 100644 index 00000000000..f33cada9c33 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FacetResponseAttributes.java @@ -0,0 +1,211 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Facet attributes. */ +@JsonPropertyOrder({ + FacetResponseAttributes.JSON_PROPERTY_ITEMS, + FacetResponseAttributes.JSON_PROPERTY_KEY, + FacetResponseAttributes.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FacetResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ITEMS = "items"; + private List items = new ArrayList<>(); + + public static final String JSON_PROPERTY_KEY = "key"; + private String key; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public FacetResponseAttributes() {} + + @JsonCreator + public FacetResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ITEMS) List items, + @JsonProperty(required = true, value = JSON_PROPERTY_KEY) String key) { + this.items = items; + this.key = key; + } + + public FacetResponseAttributes items(List items) { + this.items = items; + for (FacetItem item : items) { + this.unparsed |= item.unparsed; + } + return this; + } + + public FacetResponseAttributes addItemsItem(FacetItem itemsItem) { + this.items.add(itemsItem); + this.unparsed |= itemsItem.unparsed; + return this; + } + + /** + * Array of facet values. + * + * @return items + */ + @JsonProperty(JSON_PROPERTY_ITEMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public FacetResponseAttributes key(String key) { + this.key = key; + return this; + } + + /** + * The key of the facet. + * + * @return key + */ + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public FacetResponseAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The display name of the facet. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FacetResponseAttributes + */ + @JsonAnySetter + public FacetResponseAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FacetResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FacetResponseAttributes facetResponseAttributes = (FacetResponseAttributes) o; + return Objects.equals(this.items, facetResponseAttributes.items) + && Objects.equals(this.key, facetResponseAttributes.key) + && Objects.equals(this.name, facetResponseAttributes.name) + && Objects.equals(this.additionalProperties, facetResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(items, key, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FacetResponseAttributes {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FacetResponseData.java b/src/main/java/com/datadog/api/client/v2/model/FacetResponseData.java new file mode 100644 index 00000000000..5f6694884c9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FacetResponseData.java @@ -0,0 +1,209 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Facet data. */ +@JsonPropertyOrder({ + FacetResponseData.JSON_PROPERTY_ATTRIBUTES, + FacetResponseData.JSON_PROPERTY_ID, + FacetResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FacetResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private FacetResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private FacetType type; + + public FacetResponseData() {} + + @JsonCreator + public FacetResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + FacetResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) FacetType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public FacetResponseData attributes(FacetResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Facet attributes. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public FacetResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(FacetResponseAttributes attributes) { + this.attributes = attributes; + } + + public FacetResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The unique ID of the facet. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public FacetResponseData type(FacetType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The JSON:API type for facets. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public FacetType getType() { + return type; + } + + public void setType(FacetType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FacetResponseData + */ + @JsonAnySetter + public FacetResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FacetResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FacetResponseData facetResponseData = (FacetResponseData) o; + return Objects.equals(this.attributes, facetResponseData.attributes) + && Objects.equals(this.id, facetResponseData.id) + && Objects.equals(this.type, facetResponseData.type) + && Objects.equals(this.additionalProperties, facetResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FacetResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FacetType.java b/src/main/java/com/datadog/api/client/v2/model/FacetType.java new file mode 100644 index 00000000000..bc52e5ff4d4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FacetType.java @@ -0,0 +1,53 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The JSON:API type for facets. */ +@JsonSerialize(using = FacetType.FacetTypeSerializer.class) +public class FacetType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("facet")); + + public static final FacetType FACET = new FacetType("facet"); + + FacetType(String value) { + super(value, allowedValues); + } + + public static class FacetTypeSerializer extends StdSerializer { + public FacetTypeSerializer(Class t) { + super(t); + } + + public FacetTypeSerializer() { + this(null); + } + + @Override + public void serialize(FacetType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static FacetType fromValue(String value) { + return new FacetType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignReportRequest.java b/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignReportRequest.java new file mode 100644 index 00000000000..57db0a00083 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignReportRequest.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request to generate a campaign report. */ +@JsonPropertyOrder({GenerateCampaignReportRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GenerateCampaignReportRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GenerateCampaignReportRequestData data; + + public GenerateCampaignReportRequest() {} + + @JsonCreator + public GenerateCampaignReportRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + GenerateCampaignReportRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public GenerateCampaignReportRequest data(GenerateCampaignReportRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for generating a campaign report. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GenerateCampaignReportRequestData getData() { + return data; + } + + public void setData(GenerateCampaignReportRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GenerateCampaignReportRequest + */ + @JsonAnySetter + public GenerateCampaignReportRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GenerateCampaignReportRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateCampaignReportRequest generateCampaignReportRequest = (GenerateCampaignReportRequest) o; + return Objects.equals(this.data, generateCampaignReportRequest.data) + && Objects.equals( + this.additionalProperties, generateCampaignReportRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenerateCampaignReportRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignReportRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignReportRequestAttributes.java new file mode 100644 index 00000000000..0e395d7f62f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignReportRequestAttributes.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for generating a campaign report. */ +@JsonPropertyOrder({GenerateCampaignReportRequestAttributes.JSON_PROPERTY_SLACK}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GenerateCampaignReportRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SLACK = "slack"; + private SlackRoutingOptions slack; + + public GenerateCampaignReportRequestAttributes() {} + + @JsonCreator + public GenerateCampaignReportRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_SLACK) SlackRoutingOptions slack) { + this.slack = slack; + this.unparsed |= slack.unparsed; + } + + public GenerateCampaignReportRequestAttributes slack(SlackRoutingOptions slack) { + this.slack = slack; + this.unparsed |= slack.unparsed; + return this; + } + + /** + * Slack routing options for report delivery. + * + * @return slack + */ + @JsonProperty(JSON_PROPERTY_SLACK) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SlackRoutingOptions getSlack() { + return slack; + } + + public void setSlack(SlackRoutingOptions slack) { + this.slack = slack; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GenerateCampaignReportRequestAttributes + */ + @JsonAnySetter + public GenerateCampaignReportRequestAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GenerateCampaignReportRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateCampaignReportRequestAttributes generateCampaignReportRequestAttributes = + (GenerateCampaignReportRequestAttributes) o; + return Objects.equals(this.slack, generateCampaignReportRequestAttributes.slack) + && Objects.equals( + this.additionalProperties, + generateCampaignReportRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(slack, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenerateCampaignReportRequestAttributes {\n"); + sb.append(" slack: ").append(toIndentedString(slack)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignReportRequestData.java b/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignReportRequestData.java new file mode 100644 index 00000000000..8dfd36d1701 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignReportRequestData.java @@ -0,0 +1,185 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for generating a campaign report. */ +@JsonPropertyOrder({ + GenerateCampaignReportRequestData.JSON_PROPERTY_ATTRIBUTES, + GenerateCampaignReportRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GenerateCampaignReportRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GenerateCampaignReportRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GenerateCampaignReportRequestDataType type; + + public GenerateCampaignReportRequestData() {} + + @JsonCreator + public GenerateCampaignReportRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + GenerateCampaignReportRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + GenerateCampaignReportRequestDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GenerateCampaignReportRequestData attributes( + GenerateCampaignReportRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for generating a campaign report. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GenerateCampaignReportRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(GenerateCampaignReportRequestAttributes attributes) { + this.attributes = attributes; + } + + public GenerateCampaignReportRequestData type(GenerateCampaignReportRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Gettype + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GenerateCampaignReportRequestDataType getType() { + return type; + } + + public void setType(GenerateCampaignReportRequestDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GenerateCampaignReportRequestData + */ + @JsonAnySetter + public GenerateCampaignReportRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GenerateCampaignReportRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateCampaignReportRequestData generateCampaignReportRequestData = + (GenerateCampaignReportRequestData) o; + return Objects.equals(this.attributes, generateCampaignReportRequestData.attributes) + && Objects.equals(this.type, generateCampaignReportRequestData.type) + && Objects.equals( + this.additionalProperties, generateCampaignReportRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenerateCampaignReportRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignReportRequestDataType.java b/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignReportRequestDataType.java new file mode 100644 index 00000000000..cbc9bbb268e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignReportRequestDataType.java @@ -0,0 +1,62 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** */ +@JsonSerialize( + using = + GenerateCampaignReportRequestDataType.GenerateCampaignReportRequestDataTypeSerializer.class) +public class GenerateCampaignReportRequestDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("campaign-report")); + + public static final GenerateCampaignReportRequestDataType CAMPAIGN_REPORT = + new GenerateCampaignReportRequestDataType("campaign-report"); + + GenerateCampaignReportRequestDataType(String value) { + super(value, allowedValues); + } + + public static class GenerateCampaignReportRequestDataTypeSerializer + extends StdSerializer { + public GenerateCampaignReportRequestDataTypeSerializer( + Class t) { + super(t); + } + + public GenerateCampaignReportRequestDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + GenerateCampaignReportRequestDataType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GenerateCampaignReportRequestDataType fromValue(String value) { + return new GenerateCampaignReportRequestDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignTeamReportsRequest.java b/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignTeamReportsRequest.java new file mode 100644 index 00000000000..7d292c72696 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignTeamReportsRequest.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request to generate team-specific campaign reports. */ +@JsonPropertyOrder({GenerateCampaignTeamReportsRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GenerateCampaignTeamReportsRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GenerateCampaignTeamReportsRequestData data; + + public GenerateCampaignTeamReportsRequest() {} + + @JsonCreator + public GenerateCampaignTeamReportsRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + GenerateCampaignTeamReportsRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public GenerateCampaignTeamReportsRequest data(GenerateCampaignTeamReportsRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for generating team campaign reports. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GenerateCampaignTeamReportsRequestData getData() { + return data; + } + + public void setData(GenerateCampaignTeamReportsRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GenerateCampaignTeamReportsRequest + */ + @JsonAnySetter + public GenerateCampaignTeamReportsRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GenerateCampaignTeamReportsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateCampaignTeamReportsRequest generateCampaignTeamReportsRequest = + (GenerateCampaignTeamReportsRequest) o; + return Objects.equals(this.data, generateCampaignTeamReportsRequest.data) + && Objects.equals( + this.additionalProperties, generateCampaignTeamReportsRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenerateCampaignTeamReportsRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignTeamReportsRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignTeamReportsRequestAttributes.java new file mode 100644 index 00000000000..180c54d6b7f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignTeamReportsRequestAttributes.java @@ -0,0 +1,162 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes for generating team campaign reports. */ +@JsonPropertyOrder({GenerateCampaignTeamReportsRequestAttributes.JSON_PROPERTY_ENTITY_OWNERS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GenerateCampaignTeamReportsRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ENTITY_OWNERS = "entity_owners"; + private List entityOwners = new ArrayList<>(); + + public GenerateCampaignTeamReportsRequestAttributes() {} + + @JsonCreator + public GenerateCampaignTeamReportsRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ENTITY_OWNERS) + List entityOwners) { + this.entityOwners = entityOwners; + } + + public GenerateCampaignTeamReportsRequestAttributes entityOwners( + List entityOwners) { + this.entityOwners = entityOwners; + for (EntityOwnerDestination item : entityOwners) { + this.unparsed |= item.unparsed; + } + return this; + } + + public GenerateCampaignTeamReportsRequestAttributes addEntityOwnersItem( + EntityOwnerDestination entityOwnersItem) { + this.entityOwners.add(entityOwnersItem); + this.unparsed |= entityOwnersItem.unparsed; + return this; + } + + /** + * List of entity owners and their Slack destinations. + * + * @return entityOwners + */ + @JsonProperty(JSON_PROPERTY_ENTITY_OWNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getEntityOwners() { + return entityOwners; + } + + public void setEntityOwners(List entityOwners) { + this.entityOwners = entityOwners; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GenerateCampaignTeamReportsRequestAttributes + */ + @JsonAnySetter + public GenerateCampaignTeamReportsRequestAttributes putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GenerateCampaignTeamReportsRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateCampaignTeamReportsRequestAttributes generateCampaignTeamReportsRequestAttributes = + (GenerateCampaignTeamReportsRequestAttributes) o; + return Objects.equals( + this.entityOwners, generateCampaignTeamReportsRequestAttributes.entityOwners) + && Objects.equals( + this.additionalProperties, + generateCampaignTeamReportsRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(entityOwners, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenerateCampaignTeamReportsRequestAttributes {\n"); + sb.append(" entityOwners: ").append(toIndentedString(entityOwners)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignTeamReportsRequestData.java b/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignTeamReportsRequestData.java new file mode 100644 index 00000000000..765e02fe954 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignTeamReportsRequestData.java @@ -0,0 +1,186 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for generating team campaign reports. */ +@JsonPropertyOrder({ + GenerateCampaignTeamReportsRequestData.JSON_PROPERTY_ATTRIBUTES, + GenerateCampaignTeamReportsRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GenerateCampaignTeamReportsRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GenerateCampaignTeamReportsRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GenerateCampaignTeamReportsRequestDataType type; + + public GenerateCampaignTeamReportsRequestData() {} + + @JsonCreator + public GenerateCampaignTeamReportsRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + GenerateCampaignTeamReportsRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + GenerateCampaignTeamReportsRequestDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GenerateCampaignTeamReportsRequestData attributes( + GenerateCampaignTeamReportsRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for generating team campaign reports. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GenerateCampaignTeamReportsRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(GenerateCampaignTeamReportsRequestAttributes attributes) { + this.attributes = attributes; + } + + public GenerateCampaignTeamReportsRequestData type( + GenerateCampaignTeamReportsRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Gettype + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GenerateCampaignTeamReportsRequestDataType getType() { + return type; + } + + public void setType(GenerateCampaignTeamReportsRequestDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GenerateCampaignTeamReportsRequestData + */ + @JsonAnySetter + public GenerateCampaignTeamReportsRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GenerateCampaignTeamReportsRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateCampaignTeamReportsRequestData generateCampaignTeamReportsRequestData = + (GenerateCampaignTeamReportsRequestData) o; + return Objects.equals(this.attributes, generateCampaignTeamReportsRequestData.attributes) + && Objects.equals(this.type, generateCampaignTeamReportsRequestData.type) + && Objects.equals( + this.additionalProperties, generateCampaignTeamReportsRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenerateCampaignTeamReportsRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignTeamReportsRequestDataType.java b/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignTeamReportsRequestDataType.java new file mode 100644 index 00000000000..79f73332cf8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GenerateCampaignTeamReportsRequestDataType.java @@ -0,0 +1,63 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** */ +@JsonSerialize( + using = + GenerateCampaignTeamReportsRequestDataType + .GenerateCampaignTeamReportsRequestDataTypeSerializer.class) +public class GenerateCampaignTeamReportsRequestDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("campaign-team-report")); + + public static final GenerateCampaignTeamReportsRequestDataType CAMPAIGN_TEAM_REPORT = + new GenerateCampaignTeamReportsRequestDataType("campaign-team-report"); + + GenerateCampaignTeamReportsRequestDataType(String value) { + super(value, allowedValues); + } + + public static class GenerateCampaignTeamReportsRequestDataTypeSerializer + extends StdSerializer { + public GenerateCampaignTeamReportsRequestDataTypeSerializer( + Class t) { + super(t); + } + + public GenerateCampaignTeamReportsRequestDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + GenerateCampaignTeamReportsRequestDataType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GenerateCampaignTeamReportsRequestDataType fromValue(String value) { + return new GenerateCampaignTeamReportsRequestDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ListCampaignsResponse.java b/src/main/java/com/datadog/api/client/v2/model/ListCampaignsResponse.java new file mode 100644 index 00000000000..c3993665950 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListCampaignsResponse.java @@ -0,0 +1,186 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing a list of campaigns. */ +@JsonPropertyOrder({ + ListCampaignsResponse.JSON_PROPERTY_DATA, + ListCampaignsResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListCampaignsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_META = "meta"; + private PaginatedResponseMeta meta; + + public ListCampaignsResponse() {} + + @JsonCreator + public ListCampaignsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data, + @JsonProperty(required = true, value = JSON_PROPERTY_META) PaginatedResponseMeta meta) { + this.data = data; + this.meta = meta; + this.unparsed |= meta.unparsed; + } + + public ListCampaignsResponse data(List data) { + this.data = data; + for (CampaignResponseData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ListCampaignsResponse addDataItem(CampaignResponseData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of campaigns. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public ListCampaignsResponse meta(PaginatedResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata for scores response. + * + * @return meta + */ + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PaginatedResponseMeta getMeta() { + return meta; + } + + public void setMeta(PaginatedResponseMeta meta) { + this.meta = meta; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ListCampaignsResponse + */ + @JsonAnySetter + public ListCampaignsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ListCampaignsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListCampaignsResponse listCampaignsResponse = (ListCampaignsResponse) o; + return Objects.equals(this.data, listCampaignsResponse.data) + && Objects.equals(this.meta, listCampaignsResponse.meta) + && Objects.equals(this.additionalProperties, listCampaignsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListCampaignsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ListDefaultRulesResponse.java b/src/main/java/com/datadog/api/client/v2/model/ListDefaultRulesResponse.java new file mode 100644 index 00000000000..26fb838a1c6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListDefaultRulesResponse.java @@ -0,0 +1,155 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing a list of default rules. */ +@JsonPropertyOrder({ListDefaultRulesResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListDefaultRulesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public ListDefaultRulesResponse() {} + + @JsonCreator + public ListDefaultRulesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public ListDefaultRulesResponse data(List data) { + this.data = data; + for (DefaultRuleResponseData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ListDefaultRulesResponse addDataItem(DefaultRuleResponseData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of default rules. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ListDefaultRulesResponse + */ + @JsonAnySetter + public ListDefaultRulesResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ListDefaultRulesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListDefaultRulesResponse listDefaultRulesResponse = (ListDefaultRulesResponse) o; + return Objects.equals(this.data, listDefaultRulesResponse.data) + && Objects.equals(this.additionalProperties, listDefaultRulesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListDefaultRulesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ListFacetsResponse.java b/src/main/java/com/datadog/api/client/v2/model/ListFacetsResponse.java new file mode 100644 index 00000000000..f98cdec1908 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListFacetsResponse.java @@ -0,0 +1,183 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing a list of facets. */ +@JsonPropertyOrder({ListFacetsResponse.JSON_PROPERTY_DATA, ListFacetsResponse.JSON_PROPERTY_META}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListFacetsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_META = "meta"; + private ListFacetsResponseMeta meta; + + public ListFacetsResponse() {} + + @JsonCreator + public ListFacetsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data, + @JsonProperty(required = true, value = JSON_PROPERTY_META) ListFacetsResponseMeta meta) { + this.data = data; + this.meta = meta; + this.unparsed |= meta.unparsed; + } + + public ListFacetsResponse data(List data) { + this.data = data; + for (FacetResponseData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ListFacetsResponse addDataItem(FacetResponseData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of facets. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public ListFacetsResponse meta(ListFacetsResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata for facets response. + * + * @return meta + */ + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ListFacetsResponseMeta getMeta() { + return meta; + } + + public void setMeta(ListFacetsResponseMeta meta) { + this.meta = meta; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ListFacetsResponse + */ + @JsonAnySetter + public ListFacetsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ListFacetsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListFacetsResponse listFacetsResponse = (ListFacetsResponse) o; + return Objects.equals(this.data, listFacetsResponse.data) + && Objects.equals(this.meta, listFacetsResponse.meta) + && Objects.equals(this.additionalProperties, listFacetsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListFacetsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ListFacetsResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/ListFacetsResponseMeta.java new file mode 100644 index 00000000000..62a93352d85 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListFacetsResponseMeta.java @@ -0,0 +1,143 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Metadata for facets response. */ +@JsonPropertyOrder({ListFacetsResponseMeta.JSON_PROPERTY_TOTAL_ENTITIES}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListFacetsResponseMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TOTAL_ENTITIES = "total_entities"; + private Long totalEntities; + + public ListFacetsResponseMeta() {} + + @JsonCreator + public ListFacetsResponseMeta( + @JsonProperty(required = true, value = JSON_PROPERTY_TOTAL_ENTITIES) Long totalEntities) { + this.totalEntities = totalEntities; + } + + public ListFacetsResponseMeta totalEntities(Long totalEntities) { + this.totalEntities = totalEntities; + return this; + } + + /** + * Total number of entities. + * + * @return totalEntities + */ + @JsonProperty(JSON_PROPERTY_TOTAL_ENTITIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTotalEntities() { + return totalEntities; + } + + public void setTotalEntities(Long totalEntities) { + this.totalEntities = totalEntities; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ListFacetsResponseMeta + */ + @JsonAnySetter + public ListFacetsResponseMeta putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ListFacetsResponseMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListFacetsResponseMeta listFacetsResponseMeta = (ListFacetsResponseMeta) o; + return Objects.equals(this.totalEntities, listFacetsResponseMeta.totalEntities) + && Objects.equals(this.additionalProperties, listFacetsResponseMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(totalEntities, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListFacetsResponseMeta {\n"); + sb.append(" totalEntities: ").append(toIndentedString(totalEntities)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ListScorecardsResponse.java b/src/main/java/com/datadog/api/client/v2/model/ListScorecardsResponse.java new file mode 100644 index 00000000000..0c347578822 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListScorecardsResponse.java @@ -0,0 +1,155 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing a list of scorecards. */ +@JsonPropertyOrder({ListScorecardsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListScorecardsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public ListScorecardsResponse() {} + + @JsonCreator + public ListScorecardsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public ListScorecardsResponse data(List data) { + this.data = data; + for (ScorecardListResponseData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ListScorecardsResponse addDataItem(ScorecardListResponseData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of scorecards. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ListScorecardsResponse + */ + @JsonAnySetter + public ListScorecardsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ListScorecardsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListScorecardsResponse listScorecardsResponse = (ListScorecardsResponse) o; + return Objects.equals(this.data, listScorecardsResponse.data) + && Objects.equals(this.additionalProperties, listScorecardsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListScorecardsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ListScoresResponse.java b/src/main/java/com/datadog/api/client/v2/model/ListScoresResponse.java new file mode 100644 index 00000000000..3c2918e8769 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListScoresResponse.java @@ -0,0 +1,183 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing a list of scores. */ +@JsonPropertyOrder({ListScoresResponse.JSON_PROPERTY_DATA, ListScoresResponse.JSON_PROPERTY_META}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListScoresResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_META = "meta"; + private PaginatedResponseMeta meta; + + public ListScoresResponse() {} + + @JsonCreator + public ListScoresResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data, + @JsonProperty(required = true, value = JSON_PROPERTY_META) PaginatedResponseMeta meta) { + this.data = data; + this.meta = meta; + this.unparsed |= meta.unparsed; + } + + public ListScoresResponse data(List data) { + this.data = data; + for (ScoreResponseData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ListScoresResponse addDataItem(ScoreResponseData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of scores. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public ListScoresResponse meta(PaginatedResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata for scores response. + * + * @return meta + */ + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PaginatedResponseMeta getMeta() { + return meta; + } + + public void setMeta(PaginatedResponseMeta meta) { + this.meta = meta; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ListScoresResponse + */ + @JsonAnySetter + public ListScoresResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ListScoresResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListScoresResponse listScoresResponse = (ListScoresResponse) o; + return Objects.equals(this.data, listScoresResponse.data) + && Objects.equals(this.meta, listScoresResponse.meta) + && Objects.equals(this.additionalProperties, listScoresResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListScoresResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PaginatedResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/PaginatedResponseMeta.java new file mode 100644 index 00000000000..e1523c95961 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PaginatedResponseMeta.java @@ -0,0 +1,229 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Metadata for scores response. */ +@JsonPropertyOrder({ + PaginatedResponseMeta.JSON_PROPERTY_COUNT, + PaginatedResponseMeta.JSON_PROPERTY_LIMIT, + PaginatedResponseMeta.JSON_PROPERTY_OFFSET, + PaginatedResponseMeta.JSON_PROPERTY_TOTAL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PaginatedResponseMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public static final String JSON_PROPERTY_LIMIT = "limit"; + private Long limit; + + public static final String JSON_PROPERTY_OFFSET = "offset"; + private Long offset; + + public static final String JSON_PROPERTY_TOTAL = "total"; + private Long total; + + public PaginatedResponseMeta() {} + + @JsonCreator + public PaginatedResponseMeta( + @JsonProperty(required = true, value = JSON_PROPERTY_COUNT) Long count, + @JsonProperty(required = true, value = JSON_PROPERTY_LIMIT) Long limit, + @JsonProperty(required = true, value = JSON_PROPERTY_OFFSET) Long offset, + @JsonProperty(required = true, value = JSON_PROPERTY_TOTAL) Long total) { + this.count = count; + this.limit = limit; + this.offset = offset; + this.total = total; + } + + public PaginatedResponseMeta count(Long count) { + this.count = count; + return this; + } + + /** + * Number of entities in this response. + * + * @return count + */ + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getCount() { + return count; + } + + public void setCount(Long count) { + this.count = count; + } + + public PaginatedResponseMeta limit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Pagination limit. + * + * @return limit + */ + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getLimit() { + return limit; + } + + public void setLimit(Long limit) { + this.limit = limit; + } + + public PaginatedResponseMeta offset(Long offset) { + this.offset = offset; + return this; + } + + /** + * Pagination offset. + * + * @return offset + */ + @JsonProperty(JSON_PROPERTY_OFFSET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getOffset() { + return offset; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public PaginatedResponseMeta total(Long total) { + this.total = total; + return this; + } + + /** + * Total number of entities available. + * + * @return total + */ + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTotal() { + return total; + } + + public void setTotal(Long total) { + this.total = total; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PaginatedResponseMeta + */ + @JsonAnySetter + public PaginatedResponseMeta putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PaginatedResponseMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaginatedResponseMeta paginatedResponseMeta = (PaginatedResponseMeta) o; + return Objects.equals(this.count, paginatedResponseMeta.count) + && Objects.equals(this.limit, paginatedResponseMeta.limit) + && Objects.equals(this.offset, paginatedResponseMeta.offset) + && Objects.equals(this.total, paginatedResponseMeta.total) + && Objects.equals(this.additionalProperties, paginatedResponseMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(count, limit, offset, total, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaginatedResponseMeta {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" offset: ").append(toIndentedString(offset)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ScoreResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ScoreResponseAttributes.java new file mode 100644 index 00000000000..fba818c8bac --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ScoreResponseAttributes.java @@ -0,0 +1,350 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Score attributes. */ +@JsonPropertyOrder({ + ScoreResponseAttributes.JSON_PROPERTY_AGGREGATION, + ScoreResponseAttributes.JSON_PROPERTY_DENOMINATOR, + ScoreResponseAttributes.JSON_PROPERTY_NUMERATOR, + ScoreResponseAttributes.JSON_PROPERTY_SCORE, + ScoreResponseAttributes.JSON_PROPERTY_TOTAL_FAIL, + ScoreResponseAttributes.JSON_PROPERTY_TOTAL_NO_DATA, + ScoreResponseAttributes.JSON_PROPERTY_TOTAL_PASS, + ScoreResponseAttributes.JSON_PROPERTY_TOTAL_SKIP +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ScoreResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AGGREGATION = "aggregation"; + private String aggregation; + + public static final String JSON_PROPERTY_DENOMINATOR = "denominator"; + private Long denominator; + + public static final String JSON_PROPERTY_NUMERATOR = "numerator"; + private Long numerator; + + public static final String JSON_PROPERTY_SCORE = "score"; + private Double score; + + public static final String JSON_PROPERTY_TOTAL_FAIL = "total_fail"; + private Long totalFail; + + public static final String JSON_PROPERTY_TOTAL_NO_DATA = "total_no_data"; + private Long totalNoData; + + public static final String JSON_PROPERTY_TOTAL_PASS = "total_pass"; + private Long totalPass; + + public static final String JSON_PROPERTY_TOTAL_SKIP = "total_skip"; + private Long totalSkip; + + public ScoreResponseAttributes() {} + + @JsonCreator + public ScoreResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_AGGREGATION) String aggregation, + @JsonProperty(required = true, value = JSON_PROPERTY_DENOMINATOR) Long denominator, + @JsonProperty(required = true, value = JSON_PROPERTY_NUMERATOR) Long numerator, + @JsonProperty(required = true, value = JSON_PROPERTY_SCORE) Double score, + @JsonProperty(required = true, value = JSON_PROPERTY_TOTAL_FAIL) Long totalFail, + @JsonProperty(required = true, value = JSON_PROPERTY_TOTAL_NO_DATA) Long totalNoData, + @JsonProperty(required = true, value = JSON_PROPERTY_TOTAL_PASS) Long totalPass, + @JsonProperty(required = true, value = JSON_PROPERTY_TOTAL_SKIP) Long totalSkip) { + this.aggregation = aggregation; + this.denominator = denominator; + this.numerator = numerator; + this.score = score; + this.totalFail = totalFail; + this.totalNoData = totalNoData; + this.totalPass = totalPass; + this.totalSkip = totalSkip; + } + + public ScoreResponseAttributes aggregation(String aggregation) { + this.aggregation = aggregation; + return this; + } + + /** + * The aggregation type. + * + * @return aggregation + */ + @JsonProperty(JSON_PROPERTY_AGGREGATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAggregation() { + return aggregation; + } + + public void setAggregation(String aggregation) { + this.aggregation = aggregation; + } + + public ScoreResponseAttributes denominator(Long denominator) { + this.denominator = denominator; + return this; + } + + /** + * Score denominator. + * + * @return denominator + */ + @JsonProperty(JSON_PROPERTY_DENOMINATOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getDenominator() { + return denominator; + } + + public void setDenominator(Long denominator) { + this.denominator = denominator; + } + + public ScoreResponseAttributes numerator(Long numerator) { + this.numerator = numerator; + return this; + } + + /** + * Score numerator. + * + * @return numerator + */ + @JsonProperty(JSON_PROPERTY_NUMERATOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getNumerator() { + return numerator; + } + + public void setNumerator(Long numerator) { + this.numerator = numerator; + } + + public ScoreResponseAttributes score(Double score) { + this.score = score; + return this; + } + + /** + * Calculated score value. + * + * @return score + */ + @JsonProperty(JSON_PROPERTY_SCORE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getScore() { + return score; + } + + public void setScore(Double score) { + this.score = score; + } + + public ScoreResponseAttributes totalFail(Long totalFail) { + this.totalFail = totalFail; + return this; + } + + /** + * Total number of failing rules. + * + * @return totalFail + */ + @JsonProperty(JSON_PROPERTY_TOTAL_FAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTotalFail() { + return totalFail; + } + + public void setTotalFail(Long totalFail) { + this.totalFail = totalFail; + } + + public ScoreResponseAttributes totalNoData(Long totalNoData) { + this.totalNoData = totalNoData; + return this; + } + + /** + * Total number of rules with no data. + * + * @return totalNoData + */ + @JsonProperty(JSON_PROPERTY_TOTAL_NO_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTotalNoData() { + return totalNoData; + } + + public void setTotalNoData(Long totalNoData) { + this.totalNoData = totalNoData; + } + + public ScoreResponseAttributes totalPass(Long totalPass) { + this.totalPass = totalPass; + return this; + } + + /** + * Total number of passing rules. + * + * @return totalPass + */ + @JsonProperty(JSON_PROPERTY_TOTAL_PASS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTotalPass() { + return totalPass; + } + + public void setTotalPass(Long totalPass) { + this.totalPass = totalPass; + } + + public ScoreResponseAttributes totalSkip(Long totalSkip) { + this.totalSkip = totalSkip; + return this; + } + + /** + * Total number of skipped rules. + * + * @return totalSkip + */ + @JsonProperty(JSON_PROPERTY_TOTAL_SKIP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTotalSkip() { + return totalSkip; + } + + public void setTotalSkip(Long totalSkip) { + this.totalSkip = totalSkip; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ScoreResponseAttributes + */ + @JsonAnySetter + public ScoreResponseAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ScoreResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScoreResponseAttributes scoreResponseAttributes = (ScoreResponseAttributes) o; + return Objects.equals(this.aggregation, scoreResponseAttributes.aggregation) + && Objects.equals(this.denominator, scoreResponseAttributes.denominator) + && Objects.equals(this.numerator, scoreResponseAttributes.numerator) + && Objects.equals(this.score, scoreResponseAttributes.score) + && Objects.equals(this.totalFail, scoreResponseAttributes.totalFail) + && Objects.equals(this.totalNoData, scoreResponseAttributes.totalNoData) + && Objects.equals(this.totalPass, scoreResponseAttributes.totalPass) + && Objects.equals(this.totalSkip, scoreResponseAttributes.totalSkip) + && Objects.equals(this.additionalProperties, scoreResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + aggregation, + denominator, + numerator, + score, + totalFail, + totalNoData, + totalPass, + totalSkip, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScoreResponseAttributes {\n"); + sb.append(" aggregation: ").append(toIndentedString(aggregation)).append("\n"); + sb.append(" denominator: ").append(toIndentedString(denominator)).append("\n"); + sb.append(" numerator: ").append(toIndentedString(numerator)).append("\n"); + sb.append(" score: ").append(toIndentedString(score)).append("\n"); + sb.append(" totalFail: ").append(toIndentedString(totalFail)).append("\n"); + sb.append(" totalNoData: ").append(toIndentedString(totalNoData)).append("\n"); + sb.append(" totalPass: ").append(toIndentedString(totalPass)).append("\n"); + sb.append(" totalSkip: ").append(toIndentedString(totalSkip)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ScoreResponseData.java b/src/main/java/com/datadog/api/client/v2/model/ScoreResponseData.java new file mode 100644 index 00000000000..e5a8124f844 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ScoreResponseData.java @@ -0,0 +1,209 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Score data. */ +@JsonPropertyOrder({ + ScoreResponseData.JSON_PROPERTY_ATTRIBUTES, + ScoreResponseData.JSON_PROPERTY_ID, + ScoreResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ScoreResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ScoreResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ScoreType type; + + public ScoreResponseData() {} + + @JsonCreator + public ScoreResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ScoreResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ScoreType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ScoreResponseData attributes(ScoreResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Score attributes. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ScoreResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ScoreResponseAttributes attributes) { + this.attributes = attributes; + } + + public ScoreResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The unique ID of the score entity. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ScoreResponseData type(ScoreType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The JSON:API type for scores. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ScoreType getType() { + return type; + } + + public void setType(ScoreType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ScoreResponseData + */ + @JsonAnySetter + public ScoreResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ScoreResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScoreResponseData scoreResponseData = (ScoreResponseData) o; + return Objects.equals(this.attributes, scoreResponseData.attributes) + && Objects.equals(this.id, scoreResponseData.id) + && Objects.equals(this.type, scoreResponseData.type) + && Objects.equals(this.additionalProperties, scoreResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScoreResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ScoreType.java b/src/main/java/com/datadog/api/client/v2/model/ScoreType.java new file mode 100644 index 00000000000..55a17452adc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ScoreType.java @@ -0,0 +1,53 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The JSON:API type for scores. */ +@JsonSerialize(using = ScoreType.ScoreTypeSerializer.class) +public class ScoreType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("score")); + + public static final ScoreType SCORE = new ScoreType("score"); + + ScoreType(String value) { + super(value, allowedValues); + } + + public static class ScoreTypeSerializer extends StdSerializer { + public ScoreTypeSerializer(Class t) { + super(t); + } + + public ScoreTypeSerializer() { + this(null); + } + + @Override + public void serialize(ScoreType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ScoreType fromValue(String value) { + return new ScoreType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ScorecardListResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ScorecardListResponseAttributes.java new file mode 100644 index 00000000000..d2180ca542d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ScorecardListResponseAttributes.java @@ -0,0 +1,231 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Scorecard attributes. */ +@JsonPropertyOrder({ + ScorecardListResponseAttributes.JSON_PROPERTY_CREATED_AT, + ScorecardListResponseAttributes.JSON_PROPERTY_DESCRIPTION, + ScorecardListResponseAttributes.JSON_PROPERTY_MODIFIED_AT, + ScorecardListResponseAttributes.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ScorecardListResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public ScorecardListResponseAttributes() {} + + @JsonCreator + public ScorecardListResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_AT) OffsetDateTime modifiedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + } + + public ScorecardListResponseAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Creation time of the scorecard. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public ScorecardListResponseAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The description of the scorecard. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ScorecardListResponseAttributes modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Time of last scorecard modification. + * + * @return modifiedAt + */ + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public void setModifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + } + + public ScorecardListResponseAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the scorecard. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ScorecardListResponseAttributes + */ + @JsonAnySetter + public ScorecardListResponseAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ScorecardListResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScorecardListResponseAttributes scorecardListResponseAttributes = + (ScorecardListResponseAttributes) o; + return Objects.equals(this.createdAt, scorecardListResponseAttributes.createdAt) + && Objects.equals(this.description, scorecardListResponseAttributes.description) + && Objects.equals(this.modifiedAt, scorecardListResponseAttributes.modifiedAt) + && Objects.equals(this.name, scorecardListResponseAttributes.name) + && Objects.equals( + this.additionalProperties, scorecardListResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, description, modifiedAt, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScorecardListResponseAttributes {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ScorecardListResponseData.java b/src/main/java/com/datadog/api/client/v2/model/ScorecardListResponseData.java new file mode 100644 index 00000000000..1dd93902b2f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ScorecardListResponseData.java @@ -0,0 +1,210 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Scorecard data. */ +@JsonPropertyOrder({ + ScorecardListResponseData.JSON_PROPERTY_ATTRIBUTES, + ScorecardListResponseData.JSON_PROPERTY_ID, + ScorecardListResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ScorecardListResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ScorecardListResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ScorecardListType type; + + public ScorecardListResponseData() {} + + @JsonCreator + public ScorecardListResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ScorecardListResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ScorecardListType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ScorecardListResponseData attributes(ScorecardListResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Scorecard attributes. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ScorecardListResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ScorecardListResponseAttributes attributes) { + this.attributes = attributes; + } + + public ScorecardListResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The unique ID of the scorecard. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ScorecardListResponseData type(ScorecardListType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The JSON:API type for scorecard list. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ScorecardListType getType() { + return type; + } + + public void setType(ScorecardListType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ScorecardListResponseData + */ + @JsonAnySetter + public ScorecardListResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ScorecardListResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScorecardListResponseData scorecardListResponseData = (ScorecardListResponseData) o; + return Objects.equals(this.attributes, scorecardListResponseData.attributes) + && Objects.equals(this.id, scorecardListResponseData.id) + && Objects.equals(this.type, scorecardListResponseData.type) + && Objects.equals( + this.additionalProperties, scorecardListResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScorecardListResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ScorecardListType.java b/src/main/java/com/datadog/api/client/v2/model/ScorecardListType.java new file mode 100644 index 00000000000..f1ac545ccde --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ScorecardListType.java @@ -0,0 +1,53 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The JSON:API type for scorecard list. */ +@JsonSerialize(using = ScorecardListType.ScorecardListTypeSerializer.class) +public class ScorecardListType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("scorecard")); + + public static final ScorecardListType SCORECARD = new ScorecardListType("scorecard"); + + ScorecardListType(String value) { + super(value, allowedValues); + } + + public static class ScorecardListTypeSerializer extends StdSerializer { + public ScorecardListTypeSerializer(Class t) { + super(t); + } + + public ScorecardListTypeSerializer() { + this(null); + } + + @Override + public void serialize(ScorecardListType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ScorecardListType fromValue(String value) { + return new ScorecardListType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SetupRulesRequest.java b/src/main/java/com/datadog/api/client/v2/model/SetupRulesRequest.java new file mode 100644 index 00000000000..7f966921761 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SetupRulesRequest.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request to set up rules for an organization. */ +@JsonPropertyOrder({SetupRulesRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SetupRulesRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private SetupRulesRequestData data; + + public SetupRulesRequest() {} + + @JsonCreator + public SetupRulesRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) SetupRulesRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public SetupRulesRequest data(SetupRulesRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for setting up rules. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SetupRulesRequestData getData() { + return data; + } + + public void setData(SetupRulesRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SetupRulesRequest + */ + @JsonAnySetter + public SetupRulesRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SetupRulesRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetupRulesRequest setupRulesRequest = (SetupRulesRequest) o; + return Objects.equals(this.data, setupRulesRequest.data) + && Objects.equals(this.additionalProperties, setupRulesRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetupRulesRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SetupRulesRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SetupRulesRequestAttributes.java new file mode 100644 index 00000000000..8939937be86 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SetupRulesRequestAttributes.java @@ -0,0 +1,149 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes for setting up rules. */ +@JsonPropertyOrder({SetupRulesRequestAttributes.JSON_PROPERTY_DISABLED_DEFAULT_RULES}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SetupRulesRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DISABLED_DEFAULT_RULES = "disabled_default_rules"; + private List disabledDefaultRules = null; + + public SetupRulesRequestAttributes disabledDefaultRules(List disabledDefaultRules) { + this.disabledDefaultRules = disabledDefaultRules; + return this; + } + + public SetupRulesRequestAttributes addDisabledDefaultRulesItem(String disabledDefaultRulesItem) { + if (this.disabledDefaultRules == null) { + this.disabledDefaultRules = new ArrayList<>(); + } + this.disabledDefaultRules.add(disabledDefaultRulesItem); + return this; + } + + /** + * Array of default rule IDs to disable. + * + * @return disabledDefaultRules + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DISABLED_DEFAULT_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDisabledDefaultRules() { + return disabledDefaultRules; + } + + public void setDisabledDefaultRules(List disabledDefaultRules) { + this.disabledDefaultRules = disabledDefaultRules; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SetupRulesRequestAttributes + */ + @JsonAnySetter + public SetupRulesRequestAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SetupRulesRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetupRulesRequestAttributes setupRulesRequestAttributes = (SetupRulesRequestAttributes) o; + return Objects.equals( + this.disabledDefaultRules, setupRulesRequestAttributes.disabledDefaultRules) + && Objects.equals( + this.additionalProperties, setupRulesRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(disabledDefaultRules, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetupRulesRequestAttributes {\n"); + sb.append(" disabledDefaultRules: ") + .append(toIndentedString(disabledDefaultRules)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SetupRulesRequestData.java b/src/main/java/com/datadog/api/client/v2/model/SetupRulesRequestData.java new file mode 100644 index 00000000000..0ebaa03bb8e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SetupRulesRequestData.java @@ -0,0 +1,181 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for setting up rules. */ +@JsonPropertyOrder({ + SetupRulesRequestData.JSON_PROPERTY_ATTRIBUTES, + SetupRulesRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SetupRulesRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private SetupRulesRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SetupRulesRequestDataType type; + + public SetupRulesRequestData() {} + + @JsonCreator + public SetupRulesRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + SetupRulesRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) SetupRulesRequestDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public SetupRulesRequestData attributes(SetupRulesRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for setting up rules. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SetupRulesRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(SetupRulesRequestAttributes attributes) { + this.attributes = attributes; + } + + public SetupRulesRequestData type(SetupRulesRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Gettype + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SetupRulesRequestDataType getType() { + return type; + } + + public void setType(SetupRulesRequestDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SetupRulesRequestData + */ + @JsonAnySetter + public SetupRulesRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SetupRulesRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetupRulesRequestData setupRulesRequestData = (SetupRulesRequestData) o; + return Objects.equals(this.attributes, setupRulesRequestData.attributes) + && Objects.equals(this.type, setupRulesRequestData.type) + && Objects.equals(this.additionalProperties, setupRulesRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetupRulesRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SetupRulesRequestDataType.java b/src/main/java/com/datadog/api/client/v2/model/SetupRulesRequestDataType.java new file mode 100644 index 00000000000..9bf6af1e3c5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SetupRulesRequestDataType.java @@ -0,0 +1,55 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** */ +@JsonSerialize(using = SetupRulesRequestDataType.SetupRulesRequestDataTypeSerializer.class) +public class SetupRulesRequestDataType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("setup")); + + public static final SetupRulesRequestDataType SETUP = new SetupRulesRequestDataType("setup"); + + SetupRulesRequestDataType(String value) { + super(value, allowedValues); + } + + public static class SetupRulesRequestDataTypeSerializer + extends StdSerializer { + public SetupRulesRequestDataTypeSerializer(Class t) { + super(t); + } + + public SetupRulesRequestDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SetupRulesRequestDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SetupRulesRequestDataType fromValue(String value) { + return new SetupRulesRequestDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SlackRoutingOptions.java b/src/main/java/com/datadog/api/client/v2/model/SlackRoutingOptions.java new file mode 100644 index 00000000000..c86b908c441 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SlackRoutingOptions.java @@ -0,0 +1,218 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Slack routing options for report delivery. */ +@JsonPropertyOrder({ + SlackRoutingOptions.JSON_PROPERTY_CHANNEL_ID, + SlackRoutingOptions.JSON_PROPERTY_CHANNEL_NAME, + SlackRoutingOptions.JSON_PROPERTY_WORKSPACE_ID, + SlackRoutingOptions.JSON_PROPERTY_WORKSPACE_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SlackRoutingOptions { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CHANNEL_ID = "channel_id"; + private String channelId; + + public static final String JSON_PROPERTY_CHANNEL_NAME = "channel_name"; + private String channelName; + + public static final String JSON_PROPERTY_WORKSPACE_ID = "workspace_id"; + private String workspaceId; + + public static final String JSON_PROPERTY_WORKSPACE_NAME = "workspace_name"; + private String workspaceName; + + public SlackRoutingOptions channelId(String channelId) { + this.channelId = channelId; + return this; + } + + /** + * Slack channel ID. + * + * @return channelId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANNEL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelId() { + return channelId; + } + + public void setChannelId(String channelId) { + this.channelId = channelId; + } + + public SlackRoutingOptions channelName(String channelName) { + this.channelName = channelName; + return this; + } + + /** + * Slack channel name. + * + * @return channelName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANNEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannelName() { + return channelName; + } + + public void setChannelName(String channelName) { + this.channelName = channelName; + } + + public SlackRoutingOptions workspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Slack workspace ID. + * + * @return workspaceId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WORKSPACE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + } + + public SlackRoutingOptions workspaceName(String workspaceName) { + this.workspaceName = workspaceName; + return this; + } + + /** + * Slack workspace name. + * + * @return workspaceName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WORKSPACE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWorkspaceName() { + return workspaceName; + } + + public void setWorkspaceName(String workspaceName) { + this.workspaceName = workspaceName; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SlackRoutingOptions + */ + @JsonAnySetter + public SlackRoutingOptions putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SlackRoutingOptions object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SlackRoutingOptions slackRoutingOptions = (SlackRoutingOptions) o; + return Objects.equals(this.channelId, slackRoutingOptions.channelId) + && Objects.equals(this.channelName, slackRoutingOptions.channelName) + && Objects.equals(this.workspaceId, slackRoutingOptions.workspaceId) + && Objects.equals(this.workspaceName, slackRoutingOptions.workspaceName) + && Objects.equals(this.additionalProperties, slackRoutingOptions.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(channelId, channelName, workspaceId, workspaceName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SlackRoutingOptions {\n"); + sb.append(" channelId: ").append(toIndentedString(channelId)).append("\n"); + sb.append(" channelName: ").append(toIndentedString(channelName)).append("\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" workspaceName: ").append(toIndentedString(workspaceName)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateCampaignRequest.java b/src/main/java/com/datadog/api/client/v2/model/UpdateCampaignRequest.java new file mode 100644 index 00000000000..c25a634ba05 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateCampaignRequest.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request to update a campaign. */ +@JsonPropertyOrder({UpdateCampaignRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateCampaignRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UpdateCampaignRequestData data; + + public UpdateCampaignRequest() {} + + @JsonCreator + public UpdateCampaignRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) UpdateCampaignRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public UpdateCampaignRequest data(UpdateCampaignRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for updating a campaign. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UpdateCampaignRequestData getData() { + return data; + } + + public void setData(UpdateCampaignRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateCampaignRequest + */ + @JsonAnySetter + public UpdateCampaignRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateCampaignRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateCampaignRequest updateCampaignRequest = (UpdateCampaignRequest) o; + return Objects.equals(this.data, updateCampaignRequest.data) + && Objects.equals(this.additionalProperties, updateCampaignRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateCampaignRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateCampaignRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UpdateCampaignRequestAttributes.java new file mode 100644 index 00000000000..38e0a84fbd5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateCampaignRequestAttributes.java @@ -0,0 +1,413 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes for updating a campaign. */ +@JsonPropertyOrder({ + UpdateCampaignRequestAttributes.JSON_PROPERTY_DESCRIPTION, + UpdateCampaignRequestAttributes.JSON_PROPERTY_DUE_DATE, + UpdateCampaignRequestAttributes.JSON_PROPERTY_ENTITY_SCOPE, + UpdateCampaignRequestAttributes.JSON_PROPERTY_GUIDANCE, + UpdateCampaignRequestAttributes.JSON_PROPERTY_KEY, + UpdateCampaignRequestAttributes.JSON_PROPERTY_NAME, + UpdateCampaignRequestAttributes.JSON_PROPERTY_OWNER_ID, + UpdateCampaignRequestAttributes.JSON_PROPERTY_RULE_IDS, + UpdateCampaignRequestAttributes.JSON_PROPERTY_START_DATE, + UpdateCampaignRequestAttributes.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateCampaignRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_DUE_DATE = "due_date"; + private OffsetDateTime dueDate; + + public static final String JSON_PROPERTY_ENTITY_SCOPE = "entity_scope"; + private String entityScope; + + public static final String JSON_PROPERTY_GUIDANCE = "guidance"; + private String guidance; + + public static final String JSON_PROPERTY_KEY = "key"; + private String key; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_OWNER_ID = "owner_id"; + private String ownerId; + + public static final String JSON_PROPERTY_RULE_IDS = "rule_ids"; + private List ruleIds = new ArrayList<>(); + + public static final String JSON_PROPERTY_START_DATE = "start_date"; + private OffsetDateTime startDate; + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public UpdateCampaignRequestAttributes() {} + + @JsonCreator + public UpdateCampaignRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_OWNER_ID) String ownerId, + @JsonProperty(required = true, value = JSON_PROPERTY_RULE_IDS) List ruleIds, + @JsonProperty(required = true, value = JSON_PROPERTY_START_DATE) OffsetDateTime startDate, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) String status) { + this.name = name; + this.ownerId = ownerId; + this.ruleIds = ruleIds; + this.startDate = startDate; + this.status = status; + } + + public UpdateCampaignRequestAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The description of the campaign. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public UpdateCampaignRequestAttributes dueDate(OffsetDateTime dueDate) { + this.dueDate = dueDate; + return this; + } + + /** + * The due date of the campaign. + * + * @return dueDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DUE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDueDate() { + return dueDate; + } + + public void setDueDate(OffsetDateTime dueDate) { + this.dueDate = dueDate; + } + + public UpdateCampaignRequestAttributes entityScope(String entityScope) { + this.entityScope = entityScope; + return this; + } + + /** + * Entity scope query to filter entities for this campaign. + * + * @return entityScope + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENTITY_SCOPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEntityScope() { + return entityScope; + } + + public void setEntityScope(String entityScope) { + this.entityScope = entityScope; + } + + public UpdateCampaignRequestAttributes guidance(String guidance) { + this.guidance = guidance; + return this; + } + + /** + * Guidance for the campaign. + * + * @return guidance + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GUIDANCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGuidance() { + return guidance; + } + + public void setGuidance(String guidance) { + this.guidance = guidance; + } + + public UpdateCampaignRequestAttributes key(String key) { + this.key = key; + return this; + } + + /** + * The unique key for the campaign. + * + * @return key + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public UpdateCampaignRequestAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the campaign. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public UpdateCampaignRequestAttributes ownerId(String ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * The UUID of the campaign owner. + * + * @return ownerId + */ + @JsonProperty(JSON_PROPERTY_OWNER_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getOwnerId() { + return ownerId; + } + + public void setOwnerId(String ownerId) { + this.ownerId = ownerId; + } + + public UpdateCampaignRequestAttributes ruleIds(List ruleIds) { + this.ruleIds = ruleIds; + return this; + } + + public UpdateCampaignRequestAttributes addRuleIdsItem(String ruleIdsItem) { + this.ruleIds.add(ruleIdsItem); + return this; + } + + /** + * Array of rule IDs associated with this campaign. + * + * @return ruleIds + */ + @JsonProperty(JSON_PROPERTY_RULE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getRuleIds() { + return ruleIds; + } + + public void setRuleIds(List ruleIds) { + this.ruleIds = ruleIds; + } + + public UpdateCampaignRequestAttributes startDate(OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * The start date of the campaign. + * + * @return startDate + */ + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(OffsetDateTime startDate) { + this.startDate = startDate; + } + + public UpdateCampaignRequestAttributes status(String status) { + this.status = status; + return this; + } + + /** + * The status of the campaign. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateCampaignRequestAttributes + */ + @JsonAnySetter + public UpdateCampaignRequestAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateCampaignRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateCampaignRequestAttributes updateCampaignRequestAttributes = + (UpdateCampaignRequestAttributes) o; + return Objects.equals(this.description, updateCampaignRequestAttributes.description) + && Objects.equals(this.dueDate, updateCampaignRequestAttributes.dueDate) + && Objects.equals(this.entityScope, updateCampaignRequestAttributes.entityScope) + && Objects.equals(this.guidance, updateCampaignRequestAttributes.guidance) + && Objects.equals(this.key, updateCampaignRequestAttributes.key) + && Objects.equals(this.name, updateCampaignRequestAttributes.name) + && Objects.equals(this.ownerId, updateCampaignRequestAttributes.ownerId) + && Objects.equals(this.ruleIds, updateCampaignRequestAttributes.ruleIds) + && Objects.equals(this.startDate, updateCampaignRequestAttributes.startDate) + && Objects.equals(this.status, updateCampaignRequestAttributes.status) + && Objects.equals( + this.additionalProperties, updateCampaignRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + description, + dueDate, + entityScope, + guidance, + key, + name, + ownerId, + ruleIds, + startDate, + status, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateCampaignRequestAttributes {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" dueDate: ").append(toIndentedString(dueDate)).append("\n"); + sb.append(" entityScope: ").append(toIndentedString(entityScope)).append("\n"); + sb.append(" guidance: ").append(toIndentedString(guidance)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ownerId: ").append(toIndentedString(ownerId)).append("\n"); + sb.append(" ruleIds: ").append(toIndentedString(ruleIds)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateCampaignRequestData.java b/src/main/java/com/datadog/api/client/v2/model/UpdateCampaignRequestData.java new file mode 100644 index 00000000000..d02fddcfca5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateCampaignRequestData.java @@ -0,0 +1,182 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for updating a campaign. */ +@JsonPropertyOrder({ + UpdateCampaignRequestData.JSON_PROPERTY_ATTRIBUTES, + UpdateCampaignRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateCampaignRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private UpdateCampaignRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CampaignType type; + + public UpdateCampaignRequestData() {} + + @JsonCreator + public UpdateCampaignRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + UpdateCampaignRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CampaignType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public UpdateCampaignRequestData attributes(UpdateCampaignRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for updating a campaign. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UpdateCampaignRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(UpdateCampaignRequestAttributes attributes) { + this.attributes = attributes; + } + + public UpdateCampaignRequestData type(CampaignType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The JSON:API type for campaigns. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CampaignType getType() { + return type; + } + + public void setType(CampaignType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateCampaignRequestData + */ + @JsonAnySetter + public UpdateCampaignRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateCampaignRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateCampaignRequestData updateCampaignRequestData = (UpdateCampaignRequestData) o; + return Objects.equals(this.attributes, updateCampaignRequestData.attributes) + && Objects.equals(this.type, updateCampaignRequestData.type) + && Objects.equals( + this.additionalProperties, updateCampaignRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateCampaignRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/service_scorecards.feature b/src/test/resources/com/datadog/api/client/v2/api/service_scorecards.feature index 387f04cf711..c9a57e036ce 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/service_scorecards.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/service_scorecards.feature @@ -10,6 +10,49 @@ Feature: Service Scorecards And a valid "appKeyAuth" key in the system And an instance of "ServiceScorecards" API + @generated @skip @team:DataDog/service-catalog + Scenario: Associate workflow with rule returns "Bad Request" response + Given operation "UpdateScorecardRuleWorkflow" enabled + And new "UpdateScorecardRuleWorkflow" request + And request contains "rule_id" parameter from "REPLACE.ME" + And request contains "workflow_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Associate workflow with rule returns "No Content" response + Given operation "UpdateScorecardRuleWorkflow" enabled + And new "UpdateScorecardRuleWorkflow" request + And request contains "rule_id" parameter from "REPLACE.ME" + And request contains "workflow_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/service-catalog + Scenario: Associate workflow with rule returns "Not Found" response + Given operation "UpdateScorecardRuleWorkflow" enabled + And new "UpdateScorecardRuleWorkflow" request + And request contains "rule_id" parameter from "REPLACE.ME" + And request contains "workflow_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/service-catalog + Scenario: Create a new campaign returns "Bad Request" response + Given operation "CreateScorecardCampaign" enabled + And new "CreateScorecardCampaign" request + And body with value {"data": {"attributes": {"description": "Campaign to improve security posture for Q1 2024.", "due_date": "2024-03-31T23:59:59Z", "entity_scope": "kind:service AND team:platform", "guidance": "Please ensure all services pass the security requirements.", "key": "q1-security-2024", "name": "Q1 Security Campaign", "owner_id": "550e8400-e29b-41d4-a716-446655440000", "rule_ids": ["q8MQxk8TCqrHnWkx", "r9NRyl9UDrsIoXly"], "start_date": "2024-01-01T00:00:00Z", "status": "in_progress"}, "type": "campaign"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Create a new campaign returns "Created" response + Given operation "CreateScorecardCampaign" enabled + And new "CreateScorecardCampaign" request + And body with value {"data": {"attributes": {"description": "Campaign to improve security posture for Q1 2024.", "due_date": "2024-03-31T23:59:59Z", "entity_scope": "kind:service AND team:platform", "guidance": "Please ensure all services pass the security requirements.", "key": "q1-security-2024", "name": "Q1 Security Campaign", "owner_id": "550e8400-e29b-41d4-a716-446655440000", "rule_ids": ["q8MQxk8TCqrHnWkx", "r9NRyl9UDrsIoXly"], "start_date": "2024-01-01T00:00:00Z", "status": "in_progress"}, "type": "campaign"}} + When the request is sent + Then the response status is 201 Created + @team:DataDog/service-catalog Scenario: Create a new rule returns "Bad Request" response Given operation "CreateScorecardRule" enabled @@ -46,6 +89,30 @@ Feature: Service Scorecards When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/service-catalog + Scenario: Delete a campaign returns "Bad Request" response + Given operation "DeleteScorecardCampaign" enabled + And new "DeleteScorecardCampaign" request + And request contains "campaign_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Delete a campaign returns "No Content" response + Given operation "DeleteScorecardCampaign" enabled + And new "DeleteScorecardCampaign" request + And request contains "campaign_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/service-catalog + Scenario: Delete a campaign returns "Not Found" response + Given operation "DeleteScorecardCampaign" enabled + And new "DeleteScorecardCampaign" request + And request contains "campaign_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/service-catalog Scenario: Delete a rule returns "Bad Request" response Given operation "DeleteScorecardRule" enabled @@ -71,6 +138,122 @@ Feature: Service Scorecards When the request is sent Then the response status is 204 OK + @generated @skip @team:DataDog/service-catalog + Scenario: Delete rule workflow returns "Bad Request" response + Given operation "DeleteScorecardRuleWorkflow" enabled + And new "DeleteScorecardRuleWorkflow" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Delete rule workflow returns "No Content" response + Given operation "DeleteScorecardRuleWorkflow" enabled + And new "DeleteScorecardRuleWorkflow" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/service-catalog + Scenario: Delete rule workflow returns "Not Found" response + Given operation "DeleteScorecardRuleWorkflow" enabled + And new "DeleteScorecardRuleWorkflow" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/service-catalog + Scenario: Generate campaign report returns "Accepted" response + Given operation "GenerateScorecardCampaignReport" enabled + And new "GenerateScorecardCampaignReport" request + And request contains "campaign_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"slack": {"channel_id": "C024BDQ4N", "channel_name": "service-scorecards", "workspace_id": "T024BDQ4N", "workspace_name": "datadog-workspace"}}, "type": "campaign-report"}} + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:DataDog/service-catalog + Scenario: Generate campaign report returns "Bad Request" response + Given operation "GenerateScorecardCampaignReport" enabled + And new "GenerateScorecardCampaignReport" request + And request contains "campaign_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"slack": {"channel_id": "C024BDQ4N", "channel_name": "service-scorecards", "workspace_id": "T024BDQ4N", "workspace_name": "datadog-workspace"}}, "type": "campaign-report"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Generate campaign report returns "Not Found" response + Given operation "GenerateScorecardCampaignReport" enabled + And new "GenerateScorecardCampaignReport" request + And request contains "campaign_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"slack": {"channel_id": "C024BDQ4N", "channel_name": "service-scorecards", "workspace_id": "T024BDQ4N", "workspace_name": "datadog-workspace"}}, "type": "campaign-report"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/service-catalog + Scenario: Generate team-specific campaign reports returns "Accepted" response + Given operation "GenerateScorecardCampaignTeamReports" enabled + And new "GenerateScorecardCampaignTeamReports" request + And request contains "campaign_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"entity_owners": [{"slack": {"channel_id": "C024BDQ4N", "workspace_id": "T024BDQ4N"}, "team_id": "550e8400-e29b-41d4-a716-446655440000"}]}, "type": "campaign-team-report"}} + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:DataDog/service-catalog + Scenario: Generate team-specific campaign reports returns "Bad Request" response + Given operation "GenerateScorecardCampaignTeamReports" enabled + And new "GenerateScorecardCampaignTeamReports" request + And request contains "campaign_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"entity_owners": [{"slack": {"channel_id": "C024BDQ4N", "workspace_id": "T024BDQ4N"}, "team_id": "550e8400-e29b-41d4-a716-446655440000"}]}, "type": "campaign-team-report"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Generate team-specific campaign reports returns "Not Found" response + Given operation "GenerateScorecardCampaignTeamReports" enabled + And new "GenerateScorecardCampaignTeamReports" request + And request contains "campaign_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"entity_owners": [{"slack": {"channel_id": "C024BDQ4N", "workspace_id": "T024BDQ4N"}, "team_id": "550e8400-e29b-41d4-a716-446655440000"}]}, "type": "campaign-team-report"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/service-catalog + Scenario: Get a campaign returns "Bad Request" response + Given operation "GetScorecardCampaign" enabled + And new "GetScorecardCampaign" request + And request contains "campaign_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Get a campaign returns "Not Found" response + Given operation "GetScorecardCampaign" enabled + And new "GetScorecardCampaign" request + And request contains "campaign_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/service-catalog + Scenario: Get a campaign returns "OK" response + Given operation "GetScorecardCampaign" enabled + And new "GetScorecardCampaign" request + And request contains "campaign_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/service-catalog + Scenario: List all campaigns returns "Bad Request" response + Given operation "ListScorecardCampaigns" enabled + And new "ListScorecardCampaigns" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: List all campaigns returns "OK" response + Given operation "ListScorecardCampaigns" enabled + And new "ListScorecardCampaigns" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/service-catalog Scenario: List all rule outcomes returns "Bad Request" response Given operation "ListScorecardOutcomes" enabled @@ -121,6 +304,74 @@ Feature: Service Scorecards Then the response status is 200 OK And the response has 4 items + @generated @skip @team:DataDog/service-catalog + Scenario: List all scorecards returns "OK" response + Given operation "ListScorecards" enabled + And new "ListScorecards" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/service-catalog + Scenario: List default rules returns "OK" response + Given operation "ListScorecardDefaultRules" enabled + And new "ListScorecardDefaultRules" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/service-catalog + Scenario: List entity facets returns "Bad Request" response + Given operation "ListScorecardFacets" enabled + And new "ListScorecardFacets" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: List entity facets returns "OK" response + Given operation "ListScorecardFacets" enabled + And new "ListScorecardFacets" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/service-catalog + Scenario: List scores by aggregation returns "Bad Request" response + Given operation "ListScorecardScores" enabled + And new "ListScorecardScores" request + And request contains "aggregation" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: List scores by aggregation returns "OK" response + Given operation "ListScorecardScores" enabled + And new "ListScorecardScores" request + And request contains "aggregation" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/service-catalog + Scenario: Set up rules for organization returns "Bad Request" response + Given operation "SetupScorecardRules" enabled + And new "SetupScorecardRules" request + And body with value {"data": {"attributes": {"disabled_default_rules": ["q8MQxk8TCqrHnWkx", "r9NRyl9UDrsIoXly"]}, "type": "setup"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Set up rules for organization returns "No Content" response + Given operation "SetupScorecardRules" enabled + And new "SetupScorecardRules" request + And body with value {"data": {"attributes": {"disabled_default_rules": ["q8MQxk8TCqrHnWkx", "r9NRyl9UDrsIoXly"]}, "type": "setup"}} + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/service-catalog + Scenario: Set up rules for organization returns "Not Found" response + Given operation "SetupScorecardRules" enabled + And new "SetupScorecardRules" request + And body with value {"data": {"attributes": {"disabled_default_rules": ["q8MQxk8TCqrHnWkx", "r9NRyl9UDrsIoXly"]}, "type": "setup"}} + When the request is sent + Then the response status is 404 Not Found + @team:DataDog/service-catalog Scenario: Update Scorecard outcomes asynchronously returns "Accepted" response Given operation "UpdateScorecardOutcomesAsync" enabled @@ -150,6 +401,33 @@ Feature: Service Scorecards Then the response status is 409 Conflict And the response "errors" has length 1 + @generated @skip @team:DataDog/service-catalog + Scenario: Update a campaign returns "Bad Request" response + Given operation "UpdateScorecardCampaign" enabled + And new "UpdateScorecardCampaign" request + And request contains "campaign_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Campaign to improve security posture for Q1 2024.", "due_date": "2024-03-31T23:59:59Z", "entity_scope": "kind:service AND team:platform", "guidance": "Please ensure all services pass the security requirements.", "key": "q1-security-2024", "name": "Q1 Security Campaign", "owner_id": "550e8400-e29b-41d4-a716-446655440000", "rule_ids": ["q8MQxk8TCqrHnWkx", "r9NRyl9UDrsIoXly"], "start_date": "2024-01-01T00:00:00Z", "status": "in_progress"}, "type": "campaign"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Update a campaign returns "Not Found" response + Given operation "UpdateScorecardCampaign" enabled + And new "UpdateScorecardCampaign" request + And request contains "campaign_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Campaign to improve security posture for Q1 2024.", "due_date": "2024-03-31T23:59:59Z", "entity_scope": "kind:service AND team:platform", "guidance": "Please ensure all services pass the security requirements.", "key": "q1-security-2024", "name": "Q1 Security Campaign", "owner_id": "550e8400-e29b-41d4-a716-446655440000", "rule_ids": ["q8MQxk8TCqrHnWkx", "r9NRyl9UDrsIoXly"], "start_date": "2024-01-01T00:00:00Z", "status": "in_progress"}, "type": "campaign"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/service-catalog + Scenario: Update a campaign returns "OK" response + Given operation "UpdateScorecardCampaign" enabled + And new "UpdateScorecardCampaign" request + And request contains "campaign_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Campaign to improve security posture for Q1 2024.", "due_date": "2024-03-31T23:59:59Z", "entity_scope": "kind:service AND team:platform", "guidance": "Please ensure all services pass the security requirements.", "key": "q1-security-2024", "name": "Q1 Security Campaign", "owner_id": "550e8400-e29b-41d4-a716-446655440000", "rule_ids": ["q8MQxk8TCqrHnWkx", "r9NRyl9UDrsIoXly"], "start_date": "2024-01-01T00:00:00Z", "status": "in_progress"}, "type": "campaign"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/service-catalog Scenario: Update an existing rule returns "Bad Request" response Given operation "UpdateScorecardRule" enabled diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index c77dfee3356..c0df4e18f2c 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -4175,6 +4175,60 @@ "type": "idempotent" } }, + "ListScorecardCampaigns": { + "tag": "Service Scorecards", + "undo": { + "type": "safe" + } + }, + "CreateScorecardCampaign": { + "tag": "Service Scorecards", + "undo": { + "type": "unsafe" + } + }, + "DeleteScorecardCampaign": { + "tag": "Service Scorecards", + "undo": { + "type": "idempotent" + } + }, + "GetScorecardCampaign": { + "tag": "Service Scorecards", + "undo": { + "type": "safe" + } + }, + "UpdateScorecardCampaign": { + "tag": "Service Scorecards", + "undo": { + "type": "idempotent" + } + }, + "GenerateScorecardCampaignTeamReports": { + "tag": "Service Scorecards", + "undo": { + "type": "unsafe" + } + }, + "GenerateScorecardCampaignReport": { + "tag": "Service Scorecards", + "undo": { + "type": "unsafe" + } + }, + "ListScorecardDefaultRules": { + "tag": "Service Scorecards", + "undo": { + "type": "safe" + } + }, + "ListScorecardFacets": { + "tag": "Service Scorecards", + "undo": { + "type": "safe" + } + }, "ListScorecardOutcomes": { "tag": "Service Scorecards", "undo": { @@ -4224,6 +4278,36 @@ "type": "idempotent" } }, + "DeleteScorecardRuleWorkflow": { + "tag": "Service Scorecards", + "undo": { + "type": "idempotent" + } + }, + "UpdateScorecardRuleWorkflow": { + "tag": "Service Scorecards", + "undo": { + "type": "idempotent" + } + }, + "ListScorecards": { + "tag": "Service Scorecards", + "undo": { + "type": "safe" + } + }, + "ListScorecardScores": { + "tag": "Service Scorecards", + "undo": { + "type": "safe" + } + }, + "SetupScorecardRules": { + "tag": "Service Scorecards", + "undo": { + "type": "unsafe" + } + }, "ListEntityRiskScores": { "tag": "Entity Risk Scores", "undo": {