diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 6606535523d0..181506e0aada 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -9286,6 +9286,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: @@ -13731,6 +13835,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: @@ -19121,6 +19298,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: @@ -20886,6 +21119,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" @@ -23503,6 +23749,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: @@ -26796,6 +27102,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: @@ -33687,6 +34069,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: @@ -33785,6 +34183,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: @@ -33896,6 +34307,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: @@ -34073,6 +34511,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: @@ -44802,6 +45269,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: @@ -52486,6 +52982,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. @@ -58613,6 +59235,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: @@ -59001,6 +59661,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: @@ -64963,6 +65643,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: @@ -92723,6 +93478,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. @@ -92751,21 +93976,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 @@ -92811,7 +94036,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: @@ -92844,7 +94069,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: @@ -92880,7 +94105,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: @@ -92972,7 +94197,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: @@ -93007,7 +94232,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}: @@ -93035,7 +94260,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: @@ -93072,7 +94297,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.rb b/examples/v2/service-scorecards/CreateScorecardCampaign.rb new file mode 100644 index 000000000000..2c64c3fc1bce --- /dev/null +++ b/examples/v2/service-scorecards/CreateScorecardCampaign.rb @@ -0,0 +1,29 @@ +# Create a new campaign returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_scorecard_campaign".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceScorecardsAPI.new + +body = DatadogAPIClient::V2::CreateCampaignRequest.new({ + data: DatadogAPIClient::V2::CreateCampaignRequestData.new({ + attributes: DatadogAPIClient::V2::CreateCampaignRequestAttributes.new({ + 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: DatadogAPIClient::V2::CampaignStatus::IN_PROGRESS, + }), + type: DatadogAPIClient::V2::CampaignType::CAMPAIGN, + }), +}) +p api_instance.create_scorecard_campaign(body) diff --git a/examples/v2/service-scorecards/DeleteScorecardCampaign.rb b/examples/v2/service-scorecards/DeleteScorecardCampaign.rb new file mode 100644 index 000000000000..fe7cfe5d039a --- /dev/null +++ b/examples/v2/service-scorecards/DeleteScorecardCampaign.rb @@ -0,0 +1,8 @@ +# Delete a campaign returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_scorecard_campaign".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceScorecardsAPI.new +api_instance.delete_scorecard_campaign("c10ODp0VCrrIpXmz") diff --git a/examples/v2/service-scorecards/DeleteScorecardRuleWorkflow.rb b/examples/v2/service-scorecards/DeleteScorecardRuleWorkflow.rb new file mode 100644 index 000000000000..49a6f6e26484 --- /dev/null +++ b/examples/v2/service-scorecards/DeleteScorecardRuleWorkflow.rb @@ -0,0 +1,8 @@ +# Delete rule workflow returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_scorecard_rule_workflow".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceScorecardsAPI.new +api_instance.delete_scorecard_rule_workflow("rule_id") diff --git a/examples/v2/service-scorecards/GenerateScorecardCampaignReport.rb b/examples/v2/service-scorecards/GenerateScorecardCampaignReport.rb new file mode 100644 index 000000000000..e1a6a6bb18e6 --- /dev/null +++ b/examples/v2/service-scorecards/GenerateScorecardCampaignReport.rb @@ -0,0 +1,22 @@ +# Generate campaign report returns "Accepted" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.generate_scorecard_campaign_report".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceScorecardsAPI.new + +body = DatadogAPIClient::V2::GenerateCampaignReportRequest.new({ + data: DatadogAPIClient::V2::GenerateCampaignReportRequestData.new({ + attributes: DatadogAPIClient::V2::GenerateCampaignReportRequestAttributes.new({ + slack: DatadogAPIClient::V2::SlackRoutingOptions.new({ + channel_id: "C024BDQ4N", + channel_name: "service-scorecards", + workspace_id: "T024BDQ4N", + workspace_name: "datadog-workspace", + }), + }), + type: DatadogAPIClient::V2::GenerateCampaignReportRequestDataType::CAMPAIGN_REPORT, + }), +}) +p api_instance.generate_scorecard_campaign_report("c10ODp0VCrrIpXmz", body) diff --git a/examples/v2/service-scorecards/GenerateScorecardCampaignTeamReports.rb b/examples/v2/service-scorecards/GenerateScorecardCampaignTeamReports.rb new file mode 100644 index 000000000000..cf1359faf61e --- /dev/null +++ b/examples/v2/service-scorecards/GenerateScorecardCampaignTeamReports.rb @@ -0,0 +1,25 @@ +# Generate team-specific campaign reports returns "Accepted" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.generate_scorecard_campaign_team_reports".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceScorecardsAPI.new + +body = DatadogAPIClient::V2::GenerateCampaignTeamReportsRequest.new({ + data: DatadogAPIClient::V2::GenerateCampaignTeamReportsRequestData.new({ + attributes: DatadogAPIClient::V2::GenerateCampaignTeamReportsRequestAttributes.new({ + entity_owners: [ + DatadogAPIClient::V2::EntityOwnerDestination.new({ + slack: DatadogAPIClient::V2::SlackRoutingOptions.new({ + channel_id: "C024BDQ4N", + workspace_id: "T024BDQ4N", + }), + team_id: "550e8400-e29b-41d4-a716-446655440000", + }), + ], + }), + type: DatadogAPIClient::V2::GenerateCampaignTeamReportsRequestDataType::CAMPAIGN_TEAM_REPORT, + }), +}) +p api_instance.generate_scorecard_campaign_team_reports("c10ODp0VCrrIpXmz", body) diff --git a/examples/v2/service-scorecards/GetScorecardCampaign.rb b/examples/v2/service-scorecards/GetScorecardCampaign.rb new file mode 100644 index 000000000000..97cb200242b3 --- /dev/null +++ b/examples/v2/service-scorecards/GetScorecardCampaign.rb @@ -0,0 +1,8 @@ +# Get a campaign returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_scorecard_campaign".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceScorecardsAPI.new +p api_instance.get_scorecard_campaign("c10ODp0VCrrIpXmz") diff --git a/examples/v2/service-scorecards/ListScorecardCampaigns.rb b/examples/v2/service-scorecards/ListScorecardCampaigns.rb new file mode 100644 index 000000000000..1c06b82a2c83 --- /dev/null +++ b/examples/v2/service-scorecards/ListScorecardCampaigns.rb @@ -0,0 +1,8 @@ +# List all campaigns returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_scorecard_campaigns".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceScorecardsAPI.new +p api_instance.list_scorecard_campaigns() diff --git a/examples/v2/service-scorecards/ListScorecardDefaultRules.rb b/examples/v2/service-scorecards/ListScorecardDefaultRules.rb new file mode 100644 index 000000000000..2e89b003f9b4 --- /dev/null +++ b/examples/v2/service-scorecards/ListScorecardDefaultRules.rb @@ -0,0 +1,8 @@ +# List default rules returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_scorecard_default_rules".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceScorecardsAPI.new +p api_instance.list_scorecard_default_rules() diff --git a/examples/v2/service-scorecards/ListScorecardFacets.rb b/examples/v2/service-scorecards/ListScorecardFacets.rb new file mode 100644 index 000000000000..ac1d34231fee --- /dev/null +++ b/examples/v2/service-scorecards/ListScorecardFacets.rb @@ -0,0 +1,8 @@ +# List entity facets returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_scorecard_facets".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceScorecardsAPI.new +p api_instance.list_scorecard_facets() diff --git a/examples/v2/service-scorecards/ListScorecardScores.rb b/examples/v2/service-scorecards/ListScorecardScores.rb new file mode 100644 index 000000000000..3dc7019dca92 --- /dev/null +++ b/examples/v2/service-scorecards/ListScorecardScores.rb @@ -0,0 +1,8 @@ +# List scores by aggregation returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_scorecard_scores".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceScorecardsAPI.new +p api_instance.list_scorecard_scores("by-entity") diff --git a/examples/v2/service-scorecards/ListScorecards.rb b/examples/v2/service-scorecards/ListScorecards.rb new file mode 100644 index 000000000000..1004e47a7475 --- /dev/null +++ b/examples/v2/service-scorecards/ListScorecards.rb @@ -0,0 +1,8 @@ +# List all scorecards returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_scorecards".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceScorecardsAPI.new +p api_instance.list_scorecards() diff --git a/examples/v2/service-scorecards/SetupScorecardRules.rb b/examples/v2/service-scorecards/SetupScorecardRules.rb new file mode 100644 index 000000000000..08a87c9a8352 --- /dev/null +++ b/examples/v2/service-scorecards/SetupScorecardRules.rb @@ -0,0 +1,20 @@ +# Set up rules for organization returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.setup_scorecard_rules".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceScorecardsAPI.new + +body = DatadogAPIClient::V2::SetupRulesRequest.new({ + data: DatadogAPIClient::V2::SetupRulesRequestData.new({ + attributes: DatadogAPIClient::V2::SetupRulesRequestAttributes.new({ + disabled_default_rules: [ + "q8MQxk8TCqrHnWkx", + "r9NRyl9UDrsIoXly", + ], + }), + type: DatadogAPIClient::V2::SetupRulesRequestDataType::SETUP, + }), +}) +api_instance.setup_scorecard_rules(body) diff --git a/examples/v2/service-scorecards/UpdateScorecardCampaign.rb b/examples/v2/service-scorecards/UpdateScorecardCampaign.rb new file mode 100644 index 000000000000..7545b43b0926 --- /dev/null +++ b/examples/v2/service-scorecards/UpdateScorecardCampaign.rb @@ -0,0 +1,29 @@ +# Update a campaign returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_scorecard_campaign".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceScorecardsAPI.new + +body = DatadogAPIClient::V2::UpdateCampaignRequest.new({ + data: DatadogAPIClient::V2::UpdateCampaignRequestData.new({ + attributes: DatadogAPIClient::V2::UpdateCampaignRequestAttributes.new({ + 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: DatadogAPIClient::V2::CampaignType::CAMPAIGN, + }), +}) +p api_instance.update_scorecard_campaign("c10ODp0VCrrIpXmz", body) diff --git a/examples/v2/service-scorecards/UpdateScorecardRuleWorkflow.rb b/examples/v2/service-scorecards/UpdateScorecardRuleWorkflow.rb new file mode 100644 index 000000000000..bad8430090d5 --- /dev/null +++ b/examples/v2/service-scorecards/UpdateScorecardRuleWorkflow.rb @@ -0,0 +1,8 @@ +# Associate workflow with rule returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_scorecard_rule_workflow".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ServiceScorecardsAPI.new +api_instance.update_scorecard_rule_workflow("rule_id", "550e8400-e29b-41d4-a716-446655440000") diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index c226dd7a5165..ee00c6574c2d 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -3344,6 +3344,39 @@ "page_size" => "Integer", "filter_application_id" => "String", }, + "v2.ListScorecardCampaigns" => { + "page_limit" => "Integer", + "page_offset" => "Integer", + "filter_campaign_name" => "String", + "filter_campaign_status" => "String", + "filter_campaign_owner" => "String", + }, + "v2.CreateScorecardCampaign" => { + "body" => "CreateCampaignRequest", + }, + "v2.DeleteScorecardCampaign" => { + "campaign_id" => "String", + }, + "v2.GetScorecardCampaign" => { + "campaign_id" => "String", + "include" => "String", + "include_meta" => "Boolean", + }, + "v2.UpdateScorecardCampaign" => { + "campaign_id" => "String", + "body" => "UpdateCampaignRequest", + }, + "v2.GenerateScorecardCampaignTeamReports" => { + "campaign_id" => "String", + "body" => "GenerateCampaignTeamReportsRequest", + }, + "v2.GenerateScorecardCampaignReport" => { + "campaign_id" => "String", + "body" => "GenerateCampaignReportRequest", + }, + "v2.ListScorecardFacets" => { + "filter_entity_query" => "String", + }, "v2.ListScorecardOutcomes" => { "page_size" => "Integer", "page_offset" => "Integer", @@ -3384,6 +3417,33 @@ "rule_id" => "String", "body" => "UpdateRuleRequest", }, + "v2.DeleteScorecardRuleWorkflow" => { + "rule_id" => "String", + }, + "v2.UpdateScorecardRuleWorkflow" => { + "rule_id" => "String", + "workflow_id" => "String", + }, + "v2.ListScorecards" => { + "page_offset" => "Integer", + "page_size" => "Integer", + "filter_scorecard_id" => "String", + "filter_scorecard_name" => "String", + "filter_scorecard_description" => "String", + }, + "v2.ListScorecardScores" => { + "aggregation" => "String", + "page_limit" => "Integer", + "page_offset" => "Integer", + "filter_entity_query" => "String", + "filter_rule_id" => "String", + "filter_rule_enabled" => "Boolean", + "filter_rule_custom" => "Boolean", + "sort" => "String", + }, + "v2.SetupScorecardRules" => { + "body" => "SetupRulesRequest", + }, "v2.ListEntityRiskScores" => { "from" => "Integer", "to" => "Integer", diff --git a/features/v2/service_scorecards.feature b/features/v2/service_scorecards.feature index 387f04cf7113..c9a57e036ce1 100644 --- a/features/v2/service_scorecards.feature +++ b/features/v2/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/features/v2/undo.json b/features/v2/undo.json index 75d0d7f71ed7..84b9194dc78c 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -4237,6 +4237,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": { @@ -4286,6 +4340,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": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 7124bbe895fb..5608a69fbe66 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -352,13 +352,27 @@ def initialize "v2.query_event_filtered_users": false, "v2.query_users": false, "v2.update_connection": false, + "v2.create_scorecard_campaign": false, "v2.create_scorecard_outcomes_batch": false, "v2.create_scorecard_rule": false, + "v2.delete_scorecard_campaign": false, "v2.delete_scorecard_rule": false, + "v2.delete_scorecard_rule_workflow": false, + "v2.generate_scorecard_campaign_report": false, + "v2.generate_scorecard_campaign_team_reports": false, + "v2.get_scorecard_campaign": false, + "v2.list_scorecard_campaigns": false, + "v2.list_scorecard_default_rules": false, + "v2.list_scorecard_facets": false, "v2.list_scorecard_outcomes": false, "v2.list_scorecard_rules": false, + "v2.list_scorecards": false, + "v2.list_scorecard_scores": false, + "v2.setup_scorecard_rules": false, + "v2.update_scorecard_campaign": false, "v2.update_scorecard_outcomes_async": false, "v2.update_scorecard_rule": false, + "v2.update_scorecard_rule_workflow": false, "v2.list_entity_risk_scores": false, "v2.create_incident_service": false, "v2.delete_incident_service": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 4a0ac91fa81b..ee175dca7f5a 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1399,6 +1399,11 @@ def overrides "v2.bulk_put_apps_datastore_items_request_data" => "BulkPutAppsDatastoreItemsRequestData", "v2.bulk_put_apps_datastore_items_request_data_attributes" => "BulkPutAppsDatastoreItemsRequestDataAttributes", "v2.calculated_field" => "CalculatedField", + "v2.campaign_response" => "CampaignResponse", + "v2.campaign_response_attributes" => "CampaignResponseAttributes", + "v2.campaign_response_data" => "CampaignResponseData", + "v2.campaign_status" => "CampaignStatus", + "v2.campaign_type" => "CampaignType", "v2.cancel_data_deletion_response_body" => "CancelDataDeletionResponseBody", "v2.case" => "Case", "v2.case3rd_party_ticket_status" => "Case3rdPartyTicketStatus", @@ -1764,6 +1769,9 @@ def overrides "v2.create_attachment_request_data" => "CreateAttachmentRequestData", "v2.create_attachment_request_data_attributes" => "CreateAttachmentRequestDataAttributes", "v2.create_attachment_request_data_attributes_attachment" => "CreateAttachmentRequestDataAttributesAttachment", + "v2.create_campaign_request" => "CreateCampaignRequest", + "v2.create_campaign_request_attributes" => "CreateCampaignRequestAttributes", + "v2.create_campaign_request_data" => "CreateCampaignRequestData", "v2.create_case_request_array" => "CreateCaseRequestArray", "v2.create_case_request_data" => "CreateCaseRequestData", "v2.create_case_request_data_attributes" => "CreateCaseRequestDataAttributes", @@ -2047,6 +2055,9 @@ def overrides "v2.data_transform" => "DataTransform", "v2.data_transform_properties" => "DataTransformProperties", "v2.data_transform_type" => "DataTransformType", + "v2.default_rule_response_attributes" => "DefaultRuleResponseAttributes", + "v2.default_rule_response_data" => "DefaultRuleResponseData", + "v2.default_rule_type" => "DefaultRuleType", "v2.degradation" => "Degradation", "v2.degradation_array" => "DegradationArray", "v2.degradation_array_included" => "DegradationArrayIncluded", @@ -2198,6 +2209,7 @@ def overrides "v2.entity_attributes" => "EntityAttributes", "v2.entity_data" => "EntityData", "v2.entity_meta" => "EntityMeta", + "v2.entity_owner_destination" => "EntityOwnerDestination", "v2.entity_relationships" => "EntityRelationships", "v2.entity_response_array" => "EntityResponseArray", "v2.entity_response_data_attributes" => "EntityResponseDataAttributes", @@ -2376,6 +2388,10 @@ def overrides "v2.facet_info_response_data_attributes_result_range" => "FacetInfoResponseDataAttributesResultRange", "v2.facet_info_response_data_attributes_result_values_items" => "FacetInfoResponseDataAttributesResultValuesItems", "v2.facet_info_response_data_type" => "FacetInfoResponseDataType", + "v2.facet_item" => "FacetItem", + "v2.facet_response_attributes" => "FacetResponseAttributes", + "v2.facet_response_data" => "FacetResponseData", + "v2.facet_type" => "FacetType", "v2.fastly_accoun_response_attributes" => "FastlyAccounResponseAttributes", "v2.fastly_account_create_request" => "FastlyAccountCreateRequest", "v2.fastly_account_create_request_attributes" => "FastlyAccountCreateRequestAttributes", @@ -2568,6 +2584,14 @@ def overrides "v2.gemini_integration" => "GeminiIntegration", "v2.gemini_integration_type" => "GeminiIntegrationType", "v2.gemini_integration_update" => "GeminiIntegrationUpdate", + "v2.generate_campaign_report_request" => "GenerateCampaignReportRequest", + "v2.generate_campaign_report_request_attributes" => "GenerateCampaignReportRequestAttributes", + "v2.generate_campaign_report_request_data" => "GenerateCampaignReportRequestData", + "v2.generate_campaign_report_request_data_type" => "GenerateCampaignReportRequestDataType", + "v2.generate_campaign_team_reports_request" => "GenerateCampaignTeamReportsRequest", + "v2.generate_campaign_team_reports_request_attributes" => "GenerateCampaignTeamReportsRequestAttributes", + "v2.generate_campaign_team_reports_request_data" => "GenerateCampaignTeamReportsRequestData", + "v2.generate_campaign_team_reports_request_data_type" => "GenerateCampaignTeamReportsRequestDataType", "v2.get_action_connection_response" => "GetActionConnectionResponse", "v2.get_app_key_registration_response" => "GetAppKeyRegistrationResponse", "v2.get_app_response" => "GetAppResponse", @@ -3033,12 +3057,14 @@ def overrides "v2.list_apps_response_meta" => "ListAppsResponseMeta", "v2.list_apps_response_meta_page" => "ListAppsResponseMetaPage", "v2.list_assets_sbo_ms_response" => "ListAssetsSBOMsResponse", + "v2.list_campaigns_response" => "ListCampaignsResponse", "v2.list_connections_response" => "ListConnectionsResponse", "v2.list_connections_response_data" => "ListConnectionsResponseData", "v2.list_connections_response_data_attributes" => "ListConnectionsResponseDataAttributes", "v2.list_connections_response_data_attributes_connections_items" => "ListConnectionsResponseDataAttributesConnectionsItems", "v2.list_connections_response_data_attributes_connections_items_join" => "ListConnectionsResponseDataAttributesConnectionsItemsJoin", "v2.list_connections_response_data_type" => "ListConnectionsResponseDataType", + "v2.list_default_rules_response" => "ListDefaultRulesResponse", "v2.list_deployment_rule_response_data" => "ListDeploymentRuleResponseData", "v2.list_deployment_rules_data_type" => "ListDeploymentRulesDataType", "v2.list_deployment_rules_response_data_attributes" => "ListDeploymentRulesResponseDataAttributes", @@ -3049,6 +3075,8 @@ def overrides "v2.list_entity_catalog_response" => "ListEntityCatalogResponse", "v2.list_entity_catalog_response_included_item" => "ListEntityCatalogResponseIncludedItem", "v2.list_entity_catalog_response_links" => "ListEntityCatalogResponseLinks", + "v2.list_facets_response" => "ListFacetsResponse", + "v2.list_facets_response_meta" => "ListFacetsResponseMeta", "v2.list_findings_meta" => "ListFindingsMeta", "v2.list_findings_page" => "ListFindingsPage", "v2.list_findings_response" => "ListFindingsResponse", @@ -3063,6 +3091,8 @@ def overrides "v2.list_rules_response" => "ListRulesResponse", "v2.list_rules_response_data_item" => "ListRulesResponseDataItem", "v2.list_rules_response_links" => "ListRulesResponseLinks", + "v2.list_scorecards_response" => "ListScorecardsResponse", + "v2.list_scores_response" => "ListScoresResponse", "v2.list_security_findings_response" => "ListSecurityFindingsResponse", "v2.list_tags_response" => "ListTagsResponse", "v2.list_tags_response_data" => "ListTagsResponseData", @@ -3747,6 +3777,7 @@ def overrides "v2.output_schema_parameters" => "OutputSchemaParameters", "v2.output_schema_parameters_type" => "OutputSchemaParametersType", "v2.page_urgency" => "PageUrgency", + "v2.paginated_response_meta" => "PaginatedResponseMeta", "v2.pagination" => "Pagination", "v2.parameter" => "Parameter", "v2.partial_api_key" => "PartialAPIKey", @@ -4276,7 +4307,13 @@ def overrides "v2.schedule_user" => "ScheduleUser", "v2.schedule_user_attributes" => "ScheduleUserAttributes", "v2.schedule_user_type" => "ScheduleUserType", + "v2.scorecard_list_response_attributes" => "ScorecardListResponseAttributes", + "v2.scorecard_list_response_data" => "ScorecardListResponseData", + "v2.scorecard_list_type" => "ScorecardListType", "v2.scorecard_type" => "ScorecardType", + "v2.score_response_attributes" => "ScoreResponseAttributes", + "v2.score_response_data" => "ScoreResponseData", + "v2.score_type" => "ScoreType", "v2.search_issues_include_query_parameter_item" => "SearchIssuesIncludeQueryParameterItem", "v2.secret_rule_array" => "SecretRuleArray", "v2.secret_rule_data" => "SecretRuleData", @@ -4626,6 +4663,10 @@ def overrides "v2.service_now_user_type" => "ServiceNowUserType", "v2.session_id_array" => "SessionIdArray", "v2.session_id_data" => "SessionIdData", + "v2.setup_rules_request" => "SetupRulesRequest", + "v2.setup_rules_request_attributes" => "SetupRulesRequestAttributes", + "v2.setup_rules_request_data" => "SetupRulesRequestData", + "v2.setup_rules_request_data_type" => "SetupRulesRequestDataType", "v2.shift" => "Shift", "v2.shift_data" => "ShiftData", "v2.shift_data_attributes" => "ShiftDataAttributes", @@ -4648,6 +4689,7 @@ def overrides "v2.single_aggregated_dns_response_data_type" => "SingleAggregatedDnsResponseDataType", "v2.slack_integration_metadata" => "SlackIntegrationMetadata", "v2.slack_integration_metadata_channel_item" => "SlackIntegrationMetadataChannelItem", + "v2.slack_routing_options" => "SlackRoutingOptions", "v2.slack_trigger_wrapper" => "SlackTriggerWrapper", "v2.slo_report_create_request" => "SloReportCreateRequest", "v2.slo_report_create_request_attributes" => "SloReportCreateRequestAttributes", @@ -5047,6 +5089,9 @@ def overrides "v2.update_apps_datastore_request" => "UpdateAppsDatastoreRequest", "v2.update_apps_datastore_request_data" => "UpdateAppsDatastoreRequestData", "v2.update_apps_datastore_request_data_attributes" => "UpdateAppsDatastoreRequestDataAttributes", + "v2.update_campaign_request" => "UpdateCampaignRequest", + "v2.update_campaign_request_attributes" => "UpdateCampaignRequestAttributes", + "v2.update_campaign_request_data" => "UpdateCampaignRequestData", "v2.update_connection_request" => "UpdateConnectionRequest", "v2.update_connection_request_data" => "UpdateConnectionRequestData", "v2.update_connection_request_data_attributes" => "UpdateConnectionRequestDataAttributes", diff --git a/lib/datadog_api_client/v2/api/service_scorecards_api.rb b/lib/datadog_api_client/v2/api/service_scorecards_api.rb index b9ba3606557a..146d562a59d1 100644 --- a/lib/datadog_api_client/v2/api/service_scorecards_api.rb +++ b/lib/datadog_api_client/v2/api/service_scorecards_api.rb @@ -23,6 +23,79 @@ def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end + # Create a new campaign. + # + # @see #create_scorecard_campaign_with_http_info + def create_scorecard_campaign(body, opts = {}) + data, _status_code, _headers = create_scorecard_campaign_with_http_info(body, opts) + data + end + + # Create a new campaign. + # + # Creates a new scorecard campaign. + # + # @param body [CreateCampaignRequest] Campaign data. + # @param opts [Hash] the optional parameters + # @return [Array<(CampaignResponse, Integer, Hash)>] CampaignResponse data, response status code and response headers + def create_scorecard_campaign_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_scorecard_campaign".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_scorecard_campaign") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_scorecard_campaign")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.create_scorecard_campaign ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ServiceScorecardsAPI.create_scorecard_campaign" + end + # resource path + local_var_path = '/api/v2/scorecard/campaigns' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'CampaignResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_scorecard_campaign, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceScorecardsAPI#create_scorecard_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create outcomes batch. # # @see #create_scorecard_outcomes_batch_with_http_info @@ -169,38 +242,38 @@ def create_scorecard_rule_with_http_info(body, opts = {}) return data, status_code, headers end - # Delete a rule. + # Delete a campaign. # - # @see #delete_scorecard_rule_with_http_info - def delete_scorecard_rule(rule_id, opts = {}) - delete_scorecard_rule_with_http_info(rule_id, opts) + # @see #delete_scorecard_campaign_with_http_info + def delete_scorecard_campaign(campaign_id, opts = {}) + delete_scorecard_campaign_with_http_info(campaign_id, opts) nil end - # Delete a rule. + # Delete a campaign. # - # Deletes a single rule. + # Deletes a single campaign by ID or key. # - # @param rule_id [String] The ID of the rule. + # @param campaign_id [String] Campaign ID or key. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_scorecard_rule_with_http_info(rule_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.delete_scorecard_rule".to_sym] + def delete_scorecard_campaign_with_http_info(campaign_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_scorecard_campaign".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_scorecard_rule") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_scorecard_campaign") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_scorecard_rule")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_scorecard_campaign")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.delete_scorecard_rule ...' + @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.delete_scorecard_campaign ...' end - # verify the required parameter 'rule_id' is set - if @api_client.config.client_side_validation && rule_id.nil? - fail ArgumentError, "Missing the required parameter 'rule_id' when calling ServiceScorecardsAPI.delete_scorecard_rule" + # verify the required parameter 'campaign_id' is set + if @api_client.config.client_side_validation && campaign_id.nil? + fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ServiceScorecardsAPI.delete_scorecard_campaign" end # resource path - local_var_path = '/api/v2/scorecard/rules/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/scorecard/campaigns/{campaign_id}'.sub('{campaign_id}', CGI.escape(campaign_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -223,7 +296,7 @@ def delete_scorecard_rule_with_http_info(rule_id, opts = {}) auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :delete_scorecard_rule, + :operation => :delete_scorecard_campaign, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -235,66 +308,51 @@ def delete_scorecard_rule_with_http_info(rule_id, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ServiceScorecardsAPI#delete_scorecard_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ServiceScorecardsAPI#delete_scorecard_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # List all rule outcomes. + # Delete a rule. # - # @see #list_scorecard_outcomes_with_http_info - def list_scorecard_outcomes(opts = {}) - data, _status_code, _headers = list_scorecard_outcomes_with_http_info(opts) - data + # @see #delete_scorecard_rule_with_http_info + def delete_scorecard_rule(rule_id, opts = {}) + delete_scorecard_rule_with_http_info(rule_id, opts) + nil end - # List all rule outcomes. + # Delete a rule. # - # Fetches all rule outcomes. + # Deletes a single rule. # + # @param rule_id [String] The ID of the rule. # @param opts [Hash] the optional parameters - # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. - # @option opts [Integer] :page_offset Specific offset to use as the beginning of the returned page. - # @option opts [String] :include Include related rule details in the response. - # @option opts [String] :fields_outcome Return only specified values in the outcome attributes. - # @option opts [String] :fields_rule Return only specified values in the included rule details. - # @option opts [String] :filter_outcome_service_name Filter the outcomes on a specific service name. - # @option opts [String] :filter_outcome_state Filter the outcomes by a specific state. - # @option opts [Boolean] :filter_rule_enabled Filter outcomes on whether a rule is enabled/disabled. - # @option opts [String] :filter_rule_id Filter outcomes based on rule ID. - # @option opts [String] :filter_rule_name Filter outcomes based on rule name. - # @return [Array<(OutcomesResponse, Integer, Hash)>] OutcomesResponse data, response status code and response headers - def list_scorecard_outcomes_with_http_info(opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.list_scorecard_outcomes".to_sym] + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_scorecard_rule_with_http_info(rule_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_scorecard_rule".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_scorecard_outcomes") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_scorecard_rule") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_scorecard_outcomes")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_scorecard_rule")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.list_scorecard_outcomes ...' + @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.delete_scorecard_rule ...' + end + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling ServiceScorecardsAPI.delete_scorecard_rule" end # resource path - local_var_path = '/api/v2/scorecard/outcomes' + local_var_path = '/api/v2/scorecard/rules/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} - query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? - query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil? - query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? - query_params[:'fields[outcome]'] = opts[:'fields_outcome'] if !opts[:'fields_outcome'].nil? - query_params[:'fields[rule]'] = opts[:'fields_rule'] if !opts[:'fields_rule'].nil? - query_params[:'filter[outcome][service_name]'] = opts[:'filter_outcome_service_name'] if !opts[:'filter_outcome_service_name'].nil? - query_params[:'filter[outcome][state]'] = opts[:'filter_outcome_state'] if !opts[:'filter_outcome_state'].nil? - query_params[:'filter[rule][enabled]'] = opts[:'filter_rule_enabled'] if !opts[:'filter_rule_enabled'].nil? - query_params[:'filter[rule][id]'] = opts[:'filter_rule_id'] if !opts[:'filter_rule_id'].nil? - query_params[:'filter[rule][name]'] = opts[:'filter_rule_name'] if !opts[:'filter_rule_name'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} @@ -303,13 +361,13 @@ def list_scorecard_outcomes_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'OutcomesResponse' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :list_scorecard_outcomes, + :operation => :delete_scorecard_rule, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -319,89 +377,53 @@ def list_scorecard_outcomes_with_http_info(opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ServiceScorecardsAPI#list_scorecard_outcomes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ServiceScorecardsAPI#delete_scorecard_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # List all rule outcomes. - # - # Provide a paginated version of {#list_scorecard_outcomes}, returning all items. - # - # To use it you need to use a block: list_scorecard_outcomes_with_pagination { |item| p item } - # - # @yield [OutcomesResponseDataItem] Paginated items - def list_scorecard_outcomes_with_pagination(opts = {}) - api_version = "V2" - page_size = @api_client.get_attribute_from_path(opts, "page_size", 10) - @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size) - while true do - response = list_scorecard_outcomes(opts) - @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size - break - end - @api_client.set_attribute_from_path(api_version, opts, "page_offset", Integer, @api_client.get_attribute_from_path(opts, "page_offset", 0) + page_size) - end - end - - # List all rules. + # Delete rule workflow. # - # @see #list_scorecard_rules_with_http_info - def list_scorecard_rules(opts = {}) - data, _status_code, _headers = list_scorecard_rules_with_http_info(opts) - data + # @see #delete_scorecard_rule_workflow_with_http_info + def delete_scorecard_rule_workflow(rule_id, opts = {}) + delete_scorecard_rule_workflow_with_http_info(rule_id, opts) + nil end - # List all rules. + # Delete rule workflow. # - # Fetch all rules. + # Removes workflow association from a scorecard rule. # + # @param rule_id [String] The ID of the rule. # @param opts [Hash] the optional parameters - # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. - # @option opts [Integer] :page_offset Specific offset to use as the beginning of the returned page. - # @option opts [String] :include Include related scorecard details in the response. - # @option opts [String] :filter_rule_id Filter the rules on a rule ID. - # @option opts [Boolean] :filter_rule_enabled Filter for enabled rules only. - # @option opts [Boolean] :filter_rule_custom Filter for custom rules only. - # @option opts [String] :filter_rule_name Filter rules on the rule name. - # @option opts [String] :filter_rule_description Filter rules on the rule description. - # @option opts [String] :fields_rule Return only specific fields in the response for rule attributes. - # @option opts [String] :fields_scorecard Return only specific fields in the included response for scorecard attributes. - # @return [Array<(ListRulesResponse, Integer, Hash)>] ListRulesResponse data, response status code and response headers - def list_scorecard_rules_with_http_info(opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.list_scorecard_rules".to_sym] + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_scorecard_rule_workflow_with_http_info(rule_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_scorecard_rule_workflow".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_scorecard_rules") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_scorecard_rule_workflow") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_scorecard_rules")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_scorecard_rule_workflow")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.list_scorecard_rules ...' + @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.delete_scorecard_rule_workflow ...' + end + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling ServiceScorecardsAPI.delete_scorecard_rule_workflow" end # resource path - local_var_path = '/api/v2/scorecard/rules' + local_var_path = '/api/v2/scorecard/rules/{rule_id}/workflow'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} - query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? - query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil? - query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? - query_params[:'filter[rule][id]'] = opts[:'filter_rule_id'] if !opts[:'filter_rule_id'].nil? - query_params[:'filter[rule][enabled]'] = opts[:'filter_rule_enabled'] if !opts[:'filter_rule_enabled'].nil? - query_params[:'filter[rule][custom]'] = opts[:'filter_rule_custom'] if !opts[:'filter_rule_custom'].nil? - query_params[:'filter[rule][name]'] = opts[:'filter_rule_name'] if !opts[:'filter_rule_name'].nil? - query_params[:'filter[rule][description]'] = opts[:'filter_rule_description'] if !opts[:'filter_rule_description'].nil? - query_params[:'fields[rule]'] = opts[:'fields_rule'] if !opts[:'fields_rule'].nil? - query_params[:'fields[scorecard]'] = opts[:'fields_scorecard'] if !opts[:'fields_scorecard'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} @@ -410,13 +432,13 @@ def list_scorecard_rules_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'ListRulesResponse' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :list_scorecard_rules, + :operation => :delete_scorecard_rule_workflow, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -426,66 +448,50 @@ def list_scorecard_rules_with_http_info(opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ServiceScorecardsAPI#list_scorecard_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ServiceScorecardsAPI#delete_scorecard_rule_workflow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # List all rules. - # - # Provide a paginated version of {#list_scorecard_rules}, returning all items. - # - # To use it you need to use a block: list_scorecard_rules_with_pagination { |item| p item } - # - # @yield [ListRulesResponseDataItem] Paginated items - def list_scorecard_rules_with_pagination(opts = {}) - api_version = "V2" - page_size = @api_client.get_attribute_from_path(opts, "page_size", 10) - @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size) - while true do - response = list_scorecard_rules(opts) - @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size - break - end - @api_client.set_attribute_from_path(api_version, opts, "page_offset", Integer, @api_client.get_attribute_from_path(opts, "page_offset", 0) + page_size) - end - end - - # Update Scorecard outcomes asynchronously. + # Generate campaign report. # - # @see #update_scorecard_outcomes_async_with_http_info - def update_scorecard_outcomes_async(body, opts = {}) - update_scorecard_outcomes_async_with_http_info(body, opts) + # @see #generate_scorecard_campaign_report_with_http_info + def generate_scorecard_campaign_report(campaign_id, body, opts = {}) + generate_scorecard_campaign_report_with_http_info(campaign_id, body, opts) nil end - # Update Scorecard outcomes asynchronously. + # Generate campaign report. # - # Updates multiple scorecard rule outcomes in a single batched request. + # Generates and sends a campaign report to Slack. # - # @param body [UpdateOutcomesAsyncRequest] Set of scorecard outcomes. + # @param campaign_id [String] Campaign ID. + # @param body [GenerateCampaignReportRequest] Report generation request. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def update_scorecard_outcomes_async_with_http_info(body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.update_scorecard_outcomes_async".to_sym] + def generate_scorecard_campaign_report_with_http_info(campaign_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.generate_scorecard_campaign_report".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_scorecard_outcomes_async") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.generate_scorecard_campaign_report") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_scorecard_outcomes_async")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.generate_scorecard_campaign_report")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.update_scorecard_outcomes_async ...' + @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.generate_scorecard_campaign_report ...' + end + # verify the required parameter 'campaign_id' is set + if @api_client.config.client_side_validation && campaign_id.nil? + fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ServiceScorecardsAPI.generate_scorecard_campaign_report" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling ServiceScorecardsAPI.update_scorecard_outcomes_async" + fail ArgumentError, "Missing the required parameter 'body' when calling ServiceScorecardsAPI.generate_scorecard_campaign_report" end # resource path - local_var_path = '/api/v2/scorecard/outcomes' + local_var_path = '/api/v2/scorecard/campaigns/{campaign_id}/report'.sub('{campaign_id}', CGI.escape(campaign_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -510,7 +516,7 @@ def update_scorecard_outcomes_async_with_http_info(body, opts = {}) auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :update_scorecard_outcomes_async, + :operation => :generate_scorecard_campaign_report, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -522,33 +528,995 @@ def update_scorecard_outcomes_async_with_http_info(body, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ServiceScorecardsAPI#update_scorecard_outcomes_async\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ServiceScorecardsAPI#generate_scorecard_campaign_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Update an existing rule. + # Generate team-specific campaign reports. # - # @see #update_scorecard_rule_with_http_info - def update_scorecard_rule(rule_id, body, opts = {}) - data, _status_code, _headers = update_scorecard_rule_with_http_info(rule_id, body, opts) - data + # @see #generate_scorecard_campaign_team_reports_with_http_info + def generate_scorecard_campaign_team_reports(campaign_id, body, opts = {}) + generate_scorecard_campaign_team_reports_with_http_info(campaign_id, body, opts) + nil end - # Update an existing rule. + # Generate team-specific campaign reports. # - # Updates an existing rule. + # Generates and sends team-specific campaign reports to Slack. # - # @param rule_id [String] The ID of the rule. - # @param body [UpdateRuleRequest] Rule attributes. + # @param campaign_id [String] Campaign ID. + # @param body [GenerateCampaignTeamReportsRequest] Team report generation request. # @param opts [Hash] the optional parameters - # @return [Array<(UpdateRuleResponse, Integer, Hash)>] UpdateRuleResponse data, response status code and response headers - def update_scorecard_rule_with_http_info(rule_id, body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.update_scorecard_rule".to_sym] + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def generate_scorecard_campaign_team_reports_with_http_info(campaign_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.generate_scorecard_campaign_team_reports".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_scorecard_rule") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.generate_scorecard_campaign_team_reports") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_scorecard_rule")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.generate_scorecard_campaign_team_reports")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.generate_scorecard_campaign_team_reports ...' + end + # verify the required parameter 'campaign_id' is set + if @api_client.config.client_side_validation && campaign_id.nil? + fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ServiceScorecardsAPI.generate_scorecard_campaign_team_reports" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ServiceScorecardsAPI.generate_scorecard_campaign_team_reports" + end + # resource path + local_var_path = '/api/v2/scorecard/campaigns/{campaign_id}/entity-owner-report'.sub('{campaign_id}', CGI.escape(campaign_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :generate_scorecard_campaign_team_reports, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceScorecardsAPI#generate_scorecard_campaign_team_reports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a campaign. + # + # @see #get_scorecard_campaign_with_http_info + def get_scorecard_campaign(campaign_id, opts = {}) + data, _status_code, _headers = get_scorecard_campaign_with_http_info(campaign_id, opts) + data + end + + # Get a campaign. + # + # Fetches a single campaign by ID or key. + # + # @param campaign_id [String] Campaign ID or key. + # @param opts [Hash] the optional parameters + # @option opts [String] :include Include related data (for example, scores). + # @option opts [Boolean] :include_meta Include metadata (entity and rule counts). + # @return [Array<(CampaignResponse, Integer, Hash)>] CampaignResponse data, response status code and response headers + def get_scorecard_campaign_with_http_info(campaign_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_scorecard_campaign".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_scorecard_campaign") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_scorecard_campaign")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.get_scorecard_campaign ...' + end + # verify the required parameter 'campaign_id' is set + if @api_client.config.client_side_validation && campaign_id.nil? + fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ServiceScorecardsAPI.get_scorecard_campaign" + end + # resource path + local_var_path = '/api/v2/scorecard/campaigns/{campaign_id}'.sub('{campaign_id}', CGI.escape(campaign_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + query_params[:'include_meta'] = opts[:'include_meta'] if !opts[:'include_meta'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'CampaignResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_scorecard_campaign, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceScorecardsAPI#get_scorecard_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List all campaigns. + # + # @see #list_scorecard_campaigns_with_http_info + def list_scorecard_campaigns(opts = {}) + data, _status_code, _headers = list_scorecard_campaigns_with_http_info(opts) + data + end + + # List all campaigns. + # + # Fetches all scorecard campaigns. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_limit Maximum number of campaigns to return. + # @option opts [Integer] :page_offset Offset for pagination. + # @option opts [String] :filter_campaign_name Filter campaigns by name (full-text search). + # @option opts [String] :filter_campaign_status Filter campaigns by status. + # @option opts [String] :filter_campaign_owner Filter campaigns by owner UUID. + # @return [Array<(ListCampaignsResponse, Integer, Hash)>] ListCampaignsResponse data, response status code and response headers + def list_scorecard_campaigns_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_scorecard_campaigns".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_scorecard_campaigns") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_scorecard_campaigns")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.list_scorecard_campaigns ...' + end + # resource path + local_var_path = '/api/v2/scorecard/campaigns' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[limit]'] = opts[:'page_limit'] if !opts[:'page_limit'].nil? + query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil? + query_params[:'filter[campaign][name]'] = opts[:'filter_campaign_name'] if !opts[:'filter_campaign_name'].nil? + query_params[:'filter[campaign][status]'] = opts[:'filter_campaign_status'] if !opts[:'filter_campaign_status'].nil? + query_params[:'filter[campaign][owner]'] = opts[:'filter_campaign_owner'] if !opts[:'filter_campaign_owner'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListCampaignsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_scorecard_campaigns, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceScorecardsAPI#list_scorecard_campaigns\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List default rules. + # + # @see #list_scorecard_default_rules_with_http_info + def list_scorecard_default_rules(opts = {}) + data, _status_code, _headers = list_scorecard_default_rules_with_http_info(opts) + data + end + + # List default rules. + # + # Fetches all default scorecard rules available for the organization. + # + # @param opts [Hash] the optional parameters + # @return [Array<(ListDefaultRulesResponse, Integer, Hash)>] ListDefaultRulesResponse data, response status code and response headers + def list_scorecard_default_rules_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_scorecard_default_rules".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_scorecard_default_rules") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_scorecard_default_rules")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.list_scorecard_default_rules ...' + end + # resource path + local_var_path = '/api/v2/scorecard/default-rules' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListDefaultRulesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_scorecard_default_rules, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceScorecardsAPI#list_scorecard_default_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List entity facets. + # + # @see #list_scorecard_facets_with_http_info + def list_scorecard_facets(opts = {}) + data, _status_code, _headers = list_scorecard_facets_with_http_info(opts) + data + end + + # List entity facets. + # + # Fetches facets for scorecard entities with counts. + # + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_entity_query Entity query filter. + # @return [Array<(ListFacetsResponse, Integer, Hash)>] ListFacetsResponse data, response status code and response headers + def list_scorecard_facets_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_scorecard_facets".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_scorecard_facets") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_scorecard_facets")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.list_scorecard_facets ...' + end + # resource path + local_var_path = '/api/v2/scorecard/facets' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[entity][query]'] = opts[:'filter_entity_query'] if !opts[:'filter_entity_query'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListFacetsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_scorecard_facets, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceScorecardsAPI#list_scorecard_facets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List all rule outcomes. + # + # @see #list_scorecard_outcomes_with_http_info + def list_scorecard_outcomes(opts = {}) + data, _status_code, _headers = list_scorecard_outcomes_with_http_info(opts) + data + end + + # List all rule outcomes. + # + # Fetches all rule outcomes. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [Integer] :page_offset Specific offset to use as the beginning of the returned page. + # @option opts [String] :include Include related rule details in the response. + # @option opts [String] :fields_outcome Return only specified values in the outcome attributes. + # @option opts [String] :fields_rule Return only specified values in the included rule details. + # @option opts [String] :filter_outcome_service_name Filter outcomes on a specific service name. + # @option opts [String] :filter_outcome_state Filter outcomes by a specific state. + # @option opts [Boolean] :filter_rule_enabled Filter outcomes based on whether a rule is enabled or disabled. + # @option opts [String] :filter_rule_id Filter outcomes based on rule ID. + # @option opts [String] :filter_rule_name Filter outcomes based on rule name. + # @return [Array<(OutcomesResponse, Integer, Hash)>] OutcomesResponse data, response status code and response headers + def list_scorecard_outcomes_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_scorecard_outcomes".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_scorecard_outcomes") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_scorecard_outcomes")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.list_scorecard_outcomes ...' + end + # resource path + local_var_path = '/api/v2/scorecard/outcomes' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil? + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + query_params[:'fields[outcome]'] = opts[:'fields_outcome'] if !opts[:'fields_outcome'].nil? + query_params[:'fields[rule]'] = opts[:'fields_rule'] if !opts[:'fields_rule'].nil? + query_params[:'filter[outcome][service_name]'] = opts[:'filter_outcome_service_name'] if !opts[:'filter_outcome_service_name'].nil? + query_params[:'filter[outcome][state]'] = opts[:'filter_outcome_state'] if !opts[:'filter_outcome_state'].nil? + query_params[:'filter[rule][enabled]'] = opts[:'filter_rule_enabled'] if !opts[:'filter_rule_enabled'].nil? + query_params[:'filter[rule][id]'] = opts[:'filter_rule_id'] if !opts[:'filter_rule_id'].nil? + query_params[:'filter[rule][name]'] = opts[:'filter_rule_name'] if !opts[:'filter_rule_name'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'OutcomesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_scorecard_outcomes, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceScorecardsAPI#list_scorecard_outcomes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List all rule outcomes. + # + # Provide a paginated version of {#list_scorecard_outcomes}, returning all items. + # + # To use it you need to use a block: list_scorecard_outcomes_with_pagination { |item| p item } + # + # @yield [OutcomesResponseDataItem] Paginated items + def list_scorecard_outcomes_with_pagination(opts = {}) + api_version = "V2" + page_size = @api_client.get_attribute_from_path(opts, "page_size", 10) + @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size) + while true do + response = list_scorecard_outcomes(opts) + @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } + if @api_client.get_attribute_from_path(response, "data").length < page_size + break + end + @api_client.set_attribute_from_path(api_version, opts, "page_offset", Integer, @api_client.get_attribute_from_path(opts, "page_offset", 0) + page_size) + end + end + + # List all rules. + # + # @see #list_scorecard_rules_with_http_info + def list_scorecard_rules(opts = {}) + data, _status_code, _headers = list_scorecard_rules_with_http_info(opts) + data + end + + # List all rules. + # + # Fetch all rules. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [Integer] :page_offset Specific offset to use as the beginning of the returned page. + # @option opts [String] :include Include related scorecard details in the response. + # @option opts [String] :filter_rule_id Filter the rules on a rule ID. + # @option opts [Boolean] :filter_rule_enabled Filter for enabled rules only. + # @option opts [Boolean] :filter_rule_custom Filter for custom rules only. + # @option opts [String] :filter_rule_name Filter rules on the rule name. + # @option opts [String] :filter_rule_description Filter rules on the rule description. + # @option opts [String] :fields_rule Return only specific fields in the response for rule attributes. + # @option opts [String] :fields_scorecard Return only specific fields in the included response for scorecard attributes. + # @return [Array<(ListRulesResponse, Integer, Hash)>] ListRulesResponse data, response status code and response headers + def list_scorecard_rules_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_scorecard_rules".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_scorecard_rules") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_scorecard_rules")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.list_scorecard_rules ...' + end + # resource path + local_var_path = '/api/v2/scorecard/rules' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil? + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + query_params[:'filter[rule][id]'] = opts[:'filter_rule_id'] if !opts[:'filter_rule_id'].nil? + query_params[:'filter[rule][enabled]'] = opts[:'filter_rule_enabled'] if !opts[:'filter_rule_enabled'].nil? + query_params[:'filter[rule][custom]'] = opts[:'filter_rule_custom'] if !opts[:'filter_rule_custom'].nil? + query_params[:'filter[rule][name]'] = opts[:'filter_rule_name'] if !opts[:'filter_rule_name'].nil? + query_params[:'filter[rule][description]'] = opts[:'filter_rule_description'] if !opts[:'filter_rule_description'].nil? + query_params[:'fields[rule]'] = opts[:'fields_rule'] if !opts[:'fields_rule'].nil? + query_params[:'fields[scorecard]'] = opts[:'fields_scorecard'] if !opts[:'fields_scorecard'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListRulesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_scorecard_rules, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceScorecardsAPI#list_scorecard_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List all rules. + # + # Provide a paginated version of {#list_scorecard_rules}, returning all items. + # + # To use it you need to use a block: list_scorecard_rules_with_pagination { |item| p item } + # + # @yield [ListRulesResponseDataItem] Paginated items + def list_scorecard_rules_with_pagination(opts = {}) + api_version = "V2" + page_size = @api_client.get_attribute_from_path(opts, "page_size", 10) + @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size) + while true do + response = list_scorecard_rules(opts) + @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } + if @api_client.get_attribute_from_path(response, "data").length < page_size + break + end + @api_client.set_attribute_from_path(api_version, opts, "page_offset", Integer, @api_client.get_attribute_from_path(opts, "page_offset", 0) + page_size) + end + end + + # List all scorecards. + # + # @see #list_scorecards_with_http_info + def list_scorecards(opts = {}) + data, _status_code, _headers = list_scorecards_with_http_info(opts) + data + end + + # List all scorecards. + # + # Fetches all scorecards. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_offset Offset for pagination. + # @option opts [Integer] :page_size Maximum number of scorecards to return. + # @option opts [String] :filter_scorecard_id Filter by scorecard ID. + # @option opts [String] :filter_scorecard_name Filter by scorecard name (partial match). + # @option opts [String] :filter_scorecard_description Filter by scorecard description (partial match). + # @return [Array<(ListScorecardsResponse, Integer, Hash)>] ListScorecardsResponse data, response status code and response headers + def list_scorecards_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_scorecards".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_scorecards") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_scorecards")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.list_scorecards ...' + end + # resource path + local_var_path = '/api/v2/scorecard/scorecards' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil? + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'filter[scorecard][id]'] = opts[:'filter_scorecard_id'] if !opts[:'filter_scorecard_id'].nil? + query_params[:'filter[scorecard][name]'] = opts[:'filter_scorecard_name'] if !opts[:'filter_scorecard_name'].nil? + query_params[:'filter[scorecard][description]'] = opts[:'filter_scorecard_description'] if !opts[:'filter_scorecard_description'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListScorecardsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_scorecards, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceScorecardsAPI#list_scorecards\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List scores by aggregation. + # + # @see #list_scorecard_scores_with_http_info + def list_scorecard_scores(aggregation, opts = {}) + data, _status_code, _headers = list_scorecard_scores_with_http_info(aggregation, opts) + data + end + + # List scores by aggregation. + # + # Fetches scorecard scores aggregated by entity, rule, scorecard, service, or team. + # + # @param aggregation [String] Aggregation type (by-entity, by-rule, by-scorecard, by-service, by-team). + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_limit Maximum number of scores to return. + # @option opts [Integer] :page_offset Offset for pagination. + # @option opts [String] :filter_entity_query Entity query filter. + # @option opts [String] :filter_rule_id Filter by rule IDs (comma-separated). + # @option opts [Boolean] :filter_rule_enabled Filter by rule enabled status. + # @option opts [Boolean] :filter_rule_custom Filter by custom rules. + # @option opts [String] :sort Sort order (comma-separated list of fields; prefix a field with - for descending order). + # @return [Array<(ListScoresResponse, Integer, Hash)>] ListScoresResponse data, response status code and response headers + def list_scorecard_scores_with_http_info(aggregation, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_scorecard_scores".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_scorecard_scores") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_scorecard_scores")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.list_scorecard_scores ...' + end + # verify the required parameter 'aggregation' is set + if @api_client.config.client_side_validation && aggregation.nil? + fail ArgumentError, "Missing the required parameter 'aggregation' when calling ServiceScorecardsAPI.list_scorecard_scores" + end + # resource path + local_var_path = '/api/v2/scorecard/scores/{aggregation}'.sub('{aggregation}', CGI.escape(aggregation.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[limit]'] = opts[:'page_limit'] if !opts[:'page_limit'].nil? + query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil? + query_params[:'filter[entity][query]'] = opts[:'filter_entity_query'] if !opts[:'filter_entity_query'].nil? + query_params[:'filter[rule][id]'] = opts[:'filter_rule_id'] if !opts[:'filter_rule_id'].nil? + query_params[:'filter[rule][enabled]'] = opts[:'filter_rule_enabled'] if !opts[:'filter_rule_enabled'].nil? + query_params[:'filter[rule][custom]'] = opts[:'filter_rule_custom'] if !opts[:'filter_rule_custom'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListScoresResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_scorecard_scores, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceScorecardsAPI#list_scorecard_scores\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Set up rules for organization. + # + # @see #setup_scorecard_rules_with_http_info + def setup_scorecard_rules(body, opts = {}) + setup_scorecard_rules_with_http_info(body, opts) + nil + end + + # Set up rules for organization. + # + # Sets up default scorecard rules for the organization. + # + # @param body [SetupRulesRequest] Setup rules request. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def setup_scorecard_rules_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.setup_scorecard_rules".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.setup_scorecard_rules") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.setup_scorecard_rules")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.setup_scorecard_rules ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ServiceScorecardsAPI.setup_scorecard_rules" + end + # resource path + local_var_path = '/api/v2/scorecard/setup' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :setup_scorecard_rules, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceScorecardsAPI#setup_scorecard_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update a campaign. + # + # @see #update_scorecard_campaign_with_http_info + def update_scorecard_campaign(campaign_id, body, opts = {}) + data, _status_code, _headers = update_scorecard_campaign_with_http_info(campaign_id, body, opts) + data + end + + # Update a campaign. + # + # Updates an existing campaign. + # + # @param campaign_id [String] Campaign ID or key. + # @param body [UpdateCampaignRequest] Campaign data. + # @param opts [Hash] the optional parameters + # @return [Array<(CampaignResponse, Integer, Hash)>] CampaignResponse data, response status code and response headers + def update_scorecard_campaign_with_http_info(campaign_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_scorecard_campaign".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_scorecard_campaign") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_scorecard_campaign")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.update_scorecard_campaign ...' + end + # verify the required parameter 'campaign_id' is set + if @api_client.config.client_side_validation && campaign_id.nil? + fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ServiceScorecardsAPI.update_scorecard_campaign" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ServiceScorecardsAPI.update_scorecard_campaign" + end + # resource path + local_var_path = '/api/v2/scorecard/campaigns/{campaign_id}'.sub('{campaign_id}', CGI.escape(campaign_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'CampaignResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_scorecard_campaign, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceScorecardsAPI#update_scorecard_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update Scorecard outcomes asynchronously. + # + # @see #update_scorecard_outcomes_async_with_http_info + def update_scorecard_outcomes_async(body, opts = {}) + update_scorecard_outcomes_async_with_http_info(body, opts) + nil + end + + # Update Scorecard outcomes asynchronously. + # + # Updates multiple scorecard rule outcomes in a single batched request. + # + # @param body [UpdateOutcomesAsyncRequest] Set of scorecard outcomes. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_scorecard_outcomes_async_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_scorecard_outcomes_async".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_scorecard_outcomes_async") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_scorecard_outcomes_async")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.update_scorecard_outcomes_async ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ServiceScorecardsAPI.update_scorecard_outcomes_async" + end + # resource path + local_var_path = '/api/v2/scorecard/outcomes' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_scorecard_outcomes_async, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceScorecardsAPI#update_scorecard_outcomes_async\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update an existing rule. + # + # @see #update_scorecard_rule_with_http_info + def update_scorecard_rule(rule_id, body, opts = {}) + data, _status_code, _headers = update_scorecard_rule_with_http_info(rule_id, body, opts) + data + end + + # Update an existing rule. + # + # Updates an existing rule. + # + # @param rule_id [String] The ID of the rule. + # @param body [UpdateRuleRequest] Rule attributes. + # @param opts [Hash] the optional parameters + # @return [Array<(UpdateRuleResponse, Integer, Hash)>] UpdateRuleResponse data, response status code and response headers + def update_scorecard_rule_with_http_info(rule_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_scorecard_rule".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_scorecard_rule") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_scorecard_rule")) end if @api_client.config.debugging @@ -604,5 +1572,81 @@ def update_scorecard_rule_with_http_info(rule_id, body, opts = {}) end return data, status_code, headers end + + # Associate workflow with rule. + # + # @see #update_scorecard_rule_workflow_with_http_info + def update_scorecard_rule_workflow(rule_id, workflow_id, opts = {}) + update_scorecard_rule_workflow_with_http_info(rule_id, workflow_id, opts) + nil + end + + # Associate workflow with rule. + # + # Associates a workflow with a scorecard rule. + # + # @param rule_id [String] The ID of the rule. + # @param workflow_id [String] Workflow ID. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_scorecard_rule_workflow_with_http_info(rule_id, workflow_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_scorecard_rule_workflow".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_scorecard_rule_workflow") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_scorecard_rule_workflow")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceScorecardsAPI.update_scorecard_rule_workflow ...' + end + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling ServiceScorecardsAPI.update_scorecard_rule_workflow" + end + # verify the required parameter 'workflow_id' is set + if @api_client.config.client_side_validation && workflow_id.nil? + fail ArgumentError, "Missing the required parameter 'workflow_id' when calling ServiceScorecardsAPI.update_scorecard_rule_workflow" + end + # resource path + local_var_path = '/api/v2/scorecard/rules/{rule_id}/workflow/{workflow_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')).sub('{workflow_id}', CGI.escape(workflow_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_scorecard_rule_workflow, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceScorecardsAPI#update_scorecard_rule_workflow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/datadog_api_client/v2/models/campaign_response.rb b/lib/datadog_api_client/v2/models/campaign_response.rb new file mode 100644 index 000000000000..11f08c246bdf --- /dev/null +++ b/lib/datadog_api_client/v2/models/campaign_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing campaign data. + class CampaignResponse + include BaseGenericModel + + # Campaign data. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'CampaignResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CampaignResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/campaign_response_attributes.rb b/lib/datadog_api_client/v2/models/campaign_response_attributes.rb new file mode 100644 index 000000000000..ce333b32952c --- /dev/null +++ b/lib/datadog_api_client/v2/models/campaign_response_attributes.rb @@ -0,0 +1,289 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Campaign attributes. + class CampaignResponseAttributes + include BaseGenericModel + + # Creation time of the campaign. + attr_reader :created_at + + # The description of the campaign. + attr_accessor :description + + # The due date of the campaign. + attr_accessor :due_date + + # Entity scope query to filter entities for this campaign. + attr_accessor :entity_scope + + # Guidance for the campaign. + attr_accessor :guidance + + # The unique key for the campaign. + attr_reader :key + + # Time of last campaign modification. + attr_reader :modified_at + + # The name of the campaign. + attr_reader :name + + # The UUID of the campaign owner. + attr_reader :owner + + # The start date of the campaign. + attr_reader :start_date + + # The status of the campaign. + attr_reader :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'description' => :'description', + :'due_date' => :'due_date', + :'entity_scope' => :'entity_scope', + :'guidance' => :'guidance', + :'key' => :'key', + :'modified_at' => :'modified_at', + :'name' => :'name', + :'owner' => :'owner', + :'start_date' => :'start_date', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'description' => :'String', + :'due_date' => :'Time', + :'entity_scope' => :'String', + :'guidance' => :'String', + :'key' => :'String', + :'modified_at' => :'Time', + :'name' => :'String', + :'owner' => :'String', + :'start_date' => :'Time', + :'status' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CampaignResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'due_date') + self.due_date = attributes[:'due_date'] + end + + if attributes.key?(:'entity_scope') + self.entity_scope = attributes[:'entity_scope'] + end + + if attributes.key?(:'guidance') + self.guidance = attributes[:'guidance'] + end + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'owner') + self.owner = attributes[:'owner'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @key.nil? + return false if @modified_at.nil? + return false if @name.nil? + return false if @owner.nil? + return false if @start_date.nil? + return false if @status.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param key [Object] Object to be assigned + # @!visibility private + def key=(key) + if key.nil? + fail ArgumentError, 'invalid value for "key", key cannot be nil.' + end + @key = key + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param owner [Object] Object to be assigned + # @!visibility private + def owner=(owner) + if owner.nil? + fail ArgumentError, 'invalid value for "owner", owner cannot be nil.' + end + @owner = owner + end + + # Custom attribute writer method with validation + # @param start_date [Object] Object to be assigned + # @!visibility private + def start_date=(start_date) + if start_date.nil? + fail ArgumentError, 'invalid value for "start_date", start_date cannot be nil.' + end + @start_date = start_date + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + description == o.description && + due_date == o.due_date && + entity_scope == o.entity_scope && + guidance == o.guidance && + key == o.key && + modified_at == o.modified_at && + name == o.name && + owner == o.owner && + start_date == o.start_date && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, description, due_date, entity_scope, guidance, key, modified_at, name, owner, start_date, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/campaign_response_data.rb b/lib/datadog_api_client/v2/models/campaign_response_data.rb new file mode 100644 index 000000000000..fbe06241eeb2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/campaign_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Campaign data. + class CampaignResponseData + include BaseGenericModel + + # Campaign attributes. + attr_reader :attributes + + # The unique ID of the campaign. + attr_reader :id + + # The JSON:API type for campaigns. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CampaignResponseAttributes', + :'id' => :'String', + :'type' => :'CampaignType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CampaignResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/campaign_status.rb b/lib/datadog_api_client/v2/models/campaign_status.rb new file mode 100644 index 000000000000..e0c87ef9311d --- /dev/null +++ b/lib/datadog_api_client/v2/models/campaign_status.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The status of the campaign. + class CampaignStatus + include BaseEnumModel + + IN_PROGRESS = "in_progress".freeze + NOT_STARTED = "not_started".freeze + COMPLETED = "completed".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/campaign_type.rb b/lib/datadog_api_client/v2/models/campaign_type.rb new file mode 100644 index 000000000000..7fc87f03c39d --- /dev/null +++ b/lib/datadog_api_client/v2/models/campaign_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The JSON:API type for campaigns. + class CampaignType + include BaseEnumModel + + CAMPAIGN = "campaign".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/create_campaign_request.rb b/lib/datadog_api_client/v2/models/create_campaign_request.rb new file mode 100644 index 000000000000..8f75c5745cad --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_campaign_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to create a new campaign. + class CreateCampaignRequest + include BaseGenericModel + + # Data for creating a new campaign. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'CreateCampaignRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateCampaignRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_campaign_request_attributes.rb b/lib/datadog_api_client/v2/models/create_campaign_request_attributes.rb new file mode 100644 index 000000000000..f0ea0b600a93 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_campaign_request_attributes.rb @@ -0,0 +1,259 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating a new campaign. + class CreateCampaignRequestAttributes + include BaseGenericModel + + # The description of the campaign. + attr_accessor :description + + # The due date of the campaign. + attr_accessor :due_date + + # Entity scope query to filter entities for this campaign. + attr_accessor :entity_scope + + # Guidance for the campaign. + attr_accessor :guidance + + # The unique key for the campaign. + attr_reader :key + + # The name of the campaign. + attr_reader :name + + # The UUID of the campaign owner. + attr_reader :owner_id + + # Array of rule IDs associated with this campaign. + attr_reader :rule_ids + + # The start date of the campaign. + attr_reader :start_date + + # The status of the campaign. + attr_accessor :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'due_date' => :'due_date', + :'entity_scope' => :'entity_scope', + :'guidance' => :'guidance', + :'key' => :'key', + :'name' => :'name', + :'owner_id' => :'owner_id', + :'rule_ids' => :'rule_ids', + :'start_date' => :'start_date', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'due_date' => :'Time', + :'entity_scope' => :'String', + :'guidance' => :'String', + :'key' => :'String', + :'name' => :'String', + :'owner_id' => :'String', + :'rule_ids' => :'Array', + :'start_date' => :'Time', + :'status' => :'CampaignStatus' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateCampaignRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'due_date') + self.due_date = attributes[:'due_date'] + end + + if attributes.key?(:'entity_scope') + self.entity_scope = attributes[:'entity_scope'] + end + + if attributes.key?(:'guidance') + self.guidance = attributes[:'guidance'] + end + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'owner_id') + self.owner_id = attributes[:'owner_id'] + end + + if attributes.key?(:'rule_ids') + if (value = attributes[:'rule_ids']).is_a?(Array) + self.rule_ids = value + end + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @key.nil? + return false if @name.nil? + return false if @owner_id.nil? + return false if @rule_ids.nil? + return false if @start_date.nil? + true + end + + # Custom attribute writer method with validation + # @param key [Object] Object to be assigned + # @!visibility private + def key=(key) + if key.nil? + fail ArgumentError, 'invalid value for "key", key cannot be nil.' + end + @key = key + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param owner_id [Object] Object to be assigned + # @!visibility private + def owner_id=(owner_id) + if owner_id.nil? + fail ArgumentError, 'invalid value for "owner_id", owner_id cannot be nil.' + end + @owner_id = owner_id + end + + # Custom attribute writer method with validation + # @param rule_ids [Object] Object to be assigned + # @!visibility private + def rule_ids=(rule_ids) + if rule_ids.nil? + fail ArgumentError, 'invalid value for "rule_ids", rule_ids cannot be nil.' + end + @rule_ids = rule_ids + end + + # Custom attribute writer method with validation + # @param start_date [Object] Object to be assigned + # @!visibility private + def start_date=(start_date) + if start_date.nil? + fail ArgumentError, 'invalid value for "start_date", start_date cannot be nil.' + end + @start_date = start_date + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + due_date == o.due_date && + entity_scope == o.entity_scope && + guidance == o.guidance && + key == o.key && + name == o.name && + owner_id == o.owner_id && + rule_ids == o.rule_ids && + start_date == o.start_date && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, due_date, entity_scope, guidance, key, name, owner_id, rule_ids, start_date, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_campaign_request_data.rb b/lib/datadog_api_client/v2/models/create_campaign_request_data.rb new file mode 100644 index 000000000000..624d259cc11e --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_campaign_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for creating a new campaign. + class CreateCampaignRequestData + include BaseGenericModel + + # Attributes for creating a new campaign. + attr_reader :attributes + + # The JSON:API type for campaigns. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CreateCampaignRequestAttributes', + :'type' => :'CampaignType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateCampaignRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/default_rule_response_attributes.rb b/lib/datadog_api_client/v2/models/default_rule_response_attributes.rb new file mode 100644 index 000000000000..c2a03c9a8530 --- /dev/null +++ b/lib/datadog_api_client/v2/models/default_rule_response_attributes.rb @@ -0,0 +1,184 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Default rule attributes. + class DefaultRuleResponseAttributes + include BaseGenericModel + + # The description of the default rule. + attr_accessor :description + + # The maturity level of the rule. + attr_accessor :level + + # The name of the default rule. + attr_reader :name + + # Required scope for the rule. + attr_accessor :scope_required + + # The description of the scorecard. + attr_accessor :scorecard_description + + # The scorecard this rule belongs to. + attr_reader :scorecard_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'level' => :'level', + :'name' => :'name', + :'scope_required' => :'scope_required', + :'scorecard_description' => :'scorecard_description', + :'scorecard_name' => :'scorecard_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'level' => :'Integer', + :'name' => :'String', + :'scope_required' => :'String', + :'scorecard_description' => :'String', + :'scorecard_name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DefaultRuleResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'level') + self.level = attributes[:'level'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'scope_required') + self.scope_required = attributes[:'scope_required'] + end + + if attributes.key?(:'scorecard_description') + self.scorecard_description = attributes[:'scorecard_description'] + end + + if attributes.key?(:'scorecard_name') + self.scorecard_name = attributes[:'scorecard_name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @name.nil? + return false if @scorecard_name.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param scorecard_name [Object] Object to be assigned + # @!visibility private + def scorecard_name=(scorecard_name) + if scorecard_name.nil? + fail ArgumentError, 'invalid value for "scorecard_name", scorecard_name cannot be nil.' + end + @scorecard_name = scorecard_name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + level == o.level && + name == o.name && + scope_required == o.scope_required && + scorecard_description == o.scorecard_description && + scorecard_name == o.scorecard_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, level, name, scope_required, scorecard_description, scorecard_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/default_rule_response_data.rb b/lib/datadog_api_client/v2/models/default_rule_response_data.rb new file mode 100644 index 000000000000..a8fb3347f14d --- /dev/null +++ b/lib/datadog_api_client/v2/models/default_rule_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Default rule data. + class DefaultRuleResponseData + include BaseGenericModel + + # Default rule attributes. + attr_reader :attributes + + # The unique ID of the default rule. + attr_reader :id + + # The JSON:API type for default rules. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'DefaultRuleResponseAttributes', + :'id' => :'String', + :'type' => :'DefaultRuleType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DefaultRuleResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/default_rule_type.rb b/lib/datadog_api_client/v2/models/default_rule_type.rb new file mode 100644 index 000000000000..968bba277fab --- /dev/null +++ b/lib/datadog_api_client/v2/models/default_rule_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The JSON:API type for default rules. + class DefaultRuleType + include BaseEnumModel + + DEFAULT_RULE = "default-rule".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/entity_owner_destination.rb b/lib/datadog_api_client/v2/models/entity_owner_destination.rb new file mode 100644 index 000000000000..9de57f17c1dc --- /dev/null +++ b/lib/datadog_api_client/v2/models/entity_owner_destination.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Entity owner and Slack destination for team reports. + class EntityOwnerDestination + include BaseGenericModel + + # Slack routing options for report delivery. + attr_reader :slack + + # Team UUID. + attr_reader :team_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'slack' => :'slack', + :'team_id' => :'team_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'slack' => :'SlackRoutingOptions', + :'team_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::EntityOwnerDestination` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'slack') + self.slack = attributes[:'slack'] + end + + if attributes.key?(:'team_id') + self.team_id = attributes[:'team_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @slack.nil? + return false if @team_id.nil? + true + end + + # Custom attribute writer method with validation + # @param slack [Object] Object to be assigned + # @!visibility private + def slack=(slack) + if slack.nil? + fail ArgumentError, 'invalid value for "slack", slack cannot be nil.' + end + @slack = slack + end + + # Custom attribute writer method with validation + # @param team_id [Object] Object to be assigned + # @!visibility private + def team_id=(team_id) + if team_id.nil? + fail ArgumentError, 'invalid value for "team_id", team_id cannot be nil.' + end + @team_id = team_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + slack == o.slack && + team_id == o.team_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [slack, team_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/facet_item.rb b/lib/datadog_api_client/v2/models/facet_item.rb new file mode 100644 index 000000000000..286c77ee6ef3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/facet_item.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Facet item with count. + class FacetItem + include BaseGenericModel + + # The name of the facet value. + attr_reader :name + + # The count for this facet value. + attr_reader :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'value' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FacetItem` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @name.nil? + return false if @value.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param value [Object] Object to be assigned + # @!visibility private + def value=(value) + if value.nil? + fail ArgumentError, 'invalid value for "value", value cannot be nil.' + end + @value = value + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + value == o.value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/facet_response_attributes.rb b/lib/datadog_api_client/v2/models/facet_response_attributes.rb new file mode 100644 index 000000000000..558fbaa37691 --- /dev/null +++ b/lib/datadog_api_client/v2/models/facet_response_attributes.rb @@ -0,0 +1,156 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Facet attributes. + class FacetResponseAttributes + include BaseGenericModel + + # Array of facet values. + attr_reader :items + + # The key of the facet. + attr_reader :key + + # The display name of the facet. + attr_accessor :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'items' => :'items', + :'key' => :'key', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'items' => :'Array', + :'key' => :'String', + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FacetResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'items') + if (value = attributes[:'items']).is_a?(Array) + self.items = value + end + end + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @items.nil? + return false if @key.nil? + true + end + + # Custom attribute writer method with validation + # @param items [Object] Object to be assigned + # @!visibility private + def items=(items) + if items.nil? + fail ArgumentError, 'invalid value for "items", items cannot be nil.' + end + @items = items + end + + # Custom attribute writer method with validation + # @param key [Object] Object to be assigned + # @!visibility private + def key=(key) + if key.nil? + fail ArgumentError, 'invalid value for "key", key cannot be nil.' + end + @key = key + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + items == o.items && + key == o.key && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [items, key, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/facet_response_data.rb b/lib/datadog_api_client/v2/models/facet_response_data.rb new file mode 100644 index 000000000000..a9c30a930d2f --- /dev/null +++ b/lib/datadog_api_client/v2/models/facet_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Facet data. + class FacetResponseData + include BaseGenericModel + + # Facet attributes. + attr_reader :attributes + + # The unique ID of the facet. + attr_reader :id + + # The JSON:API type for facets. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'FacetResponseAttributes', + :'id' => :'String', + :'type' => :'FacetType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FacetResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/facet_type.rb b/lib/datadog_api_client/v2/models/facet_type.rb new file mode 100644 index 000000000000..7f636db8da12 --- /dev/null +++ b/lib/datadog_api_client/v2/models/facet_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The JSON:API type for facets. + class FacetType + include BaseEnumModel + + FACET = "facet".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/generate_campaign_report_request.rb b/lib/datadog_api_client/v2/models/generate_campaign_report_request.rb new file mode 100644 index 000000000000..2492e463c712 --- /dev/null +++ b/lib/datadog_api_client/v2/models/generate_campaign_report_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to generate a campaign report. + class GenerateCampaignReportRequest + include BaseGenericModel + + # Data for generating a campaign report. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'GenerateCampaignReportRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GenerateCampaignReportRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/generate_campaign_report_request_attributes.rb b/lib/datadog_api_client/v2/models/generate_campaign_report_request_attributes.rb new file mode 100644 index 000000000000..139744b4840d --- /dev/null +++ b/lib/datadog_api_client/v2/models/generate_campaign_report_request_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for generating a campaign report. + class GenerateCampaignReportRequestAttributes + include BaseGenericModel + + # Slack routing options for report delivery. + attr_reader :slack + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'slack' => :'slack' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'slack' => :'SlackRoutingOptions' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GenerateCampaignReportRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'slack') + self.slack = attributes[:'slack'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @slack.nil? + true + end + + # Custom attribute writer method with validation + # @param slack [Object] Object to be assigned + # @!visibility private + def slack=(slack) + if slack.nil? + fail ArgumentError, 'invalid value for "slack", slack cannot be nil.' + end + @slack = slack + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + slack == o.slack && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [slack, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/generate_campaign_report_request_data.rb b/lib/datadog_api_client/v2/models/generate_campaign_report_request_data.rb new file mode 100644 index 000000000000..9a25cf1f2bdf --- /dev/null +++ b/lib/datadog_api_client/v2/models/generate_campaign_report_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for generating a campaign report. + class GenerateCampaignReportRequestData + include BaseGenericModel + + # Attributes for generating a campaign report. + attr_reader :attributes + + # + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'GenerateCampaignReportRequestAttributes', + :'type' => :'GenerateCampaignReportRequestDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GenerateCampaignReportRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/generate_campaign_report_request_data_type.rb b/lib/datadog_api_client/v2/models/generate_campaign_report_request_data_type.rb new file mode 100644 index 000000000000..2876e31fd5e7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/generate_campaign_report_request_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class GenerateCampaignReportRequestDataType + include BaseEnumModel + + CAMPAIGN_REPORT = "campaign-report".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/generate_campaign_team_reports_request.rb b/lib/datadog_api_client/v2/models/generate_campaign_team_reports_request.rb new file mode 100644 index 000000000000..76078cb58453 --- /dev/null +++ b/lib/datadog_api_client/v2/models/generate_campaign_team_reports_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to generate team-specific campaign reports. + class GenerateCampaignTeamReportsRequest + include BaseGenericModel + + # Data for generating team campaign reports. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'GenerateCampaignTeamReportsRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GenerateCampaignTeamReportsRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/generate_campaign_team_reports_request_attributes.rb b/lib/datadog_api_client/v2/models/generate_campaign_team_reports_request_attributes.rb new file mode 100644 index 000000000000..a07cb4d91f50 --- /dev/null +++ b/lib/datadog_api_client/v2/models/generate_campaign_team_reports_request_attributes.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for generating team campaign reports. + class GenerateCampaignTeamReportsRequestAttributes + include BaseGenericModel + + # List of entity owners and their Slack destinations. + attr_reader :entity_owners + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'entity_owners' => :'entity_owners' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'entity_owners' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GenerateCampaignTeamReportsRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'entity_owners') + if (value = attributes[:'entity_owners']).is_a?(Array) + self.entity_owners = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @entity_owners.nil? + true + end + + # Custom attribute writer method with validation + # @param entity_owners [Object] Object to be assigned + # @!visibility private + def entity_owners=(entity_owners) + if entity_owners.nil? + fail ArgumentError, 'invalid value for "entity_owners", entity_owners cannot be nil.' + end + @entity_owners = entity_owners + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + entity_owners == o.entity_owners && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [entity_owners, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/generate_campaign_team_reports_request_data.rb b/lib/datadog_api_client/v2/models/generate_campaign_team_reports_request_data.rb new file mode 100644 index 000000000000..376fcbd17eed --- /dev/null +++ b/lib/datadog_api_client/v2/models/generate_campaign_team_reports_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for generating team campaign reports. + class GenerateCampaignTeamReportsRequestData + include BaseGenericModel + + # Attributes for generating team campaign reports. + attr_reader :attributes + + # + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'GenerateCampaignTeamReportsRequestAttributes', + :'type' => :'GenerateCampaignTeamReportsRequestDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GenerateCampaignTeamReportsRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/generate_campaign_team_reports_request_data_type.rb b/lib/datadog_api_client/v2/models/generate_campaign_team_reports_request_data_type.rb new file mode 100644 index 000000000000..c0997c162c9b --- /dev/null +++ b/lib/datadog_api_client/v2/models/generate_campaign_team_reports_request_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class GenerateCampaignTeamReportsRequestDataType + include BaseEnumModel + + CAMPAIGN_TEAM_REPORT = "campaign-team-report".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/list_campaigns_response.rb b/lib/datadog_api_client/v2/models/list_campaigns_response.rb new file mode 100644 index 000000000000..6c3cecb46d20 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_campaigns_response.rb @@ -0,0 +1,146 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of campaigns. + class ListCampaignsResponse + include BaseGenericModel + + # Array of campaigns. + attr_reader :data + + # Metadata for scores response. + attr_reader :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'PaginatedResponseMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ListCampaignsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + return false if @meta.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/list_default_rules_response.rb b/lib/datadog_api_client/v2/models/list_default_rules_response.rb new file mode 100644 index 000000000000..b55069d33c8e --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_default_rules_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of default rules. + class ListDefaultRulesResponse + include BaseGenericModel + + # Array of default rules. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ListDefaultRulesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/list_facets_response.rb b/lib/datadog_api_client/v2/models/list_facets_response.rb new file mode 100644 index 000000000000..df7efe30f963 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_facets_response.rb @@ -0,0 +1,146 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of facets. + class ListFacetsResponse + include BaseGenericModel + + # Array of facets. + attr_reader :data + + # Metadata for facets response. + attr_reader :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'ListFacetsResponseMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ListFacetsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + return false if @meta.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/list_facets_response_meta.rb b/lib/datadog_api_client/v2/models/list_facets_response_meta.rb new file mode 100644 index 000000000000..c153d9089705 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_facets_response_meta.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Metadata for facets response. + class ListFacetsResponseMeta + include BaseGenericModel + + # Total number of entities. + attr_reader :total_entities + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'total_entities' => :'total_entities' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'total_entities' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ListFacetsResponseMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'total_entities') + self.total_entities = attributes[:'total_entities'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @total_entities.nil? + true + end + + # Custom attribute writer method with validation + # @param total_entities [Object] Object to be assigned + # @!visibility private + def total_entities=(total_entities) + if total_entities.nil? + fail ArgumentError, 'invalid value for "total_entities", total_entities cannot be nil.' + end + @total_entities = total_entities + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + total_entities == o.total_entities && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [total_entities, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/list_scorecards_response.rb b/lib/datadog_api_client/v2/models/list_scorecards_response.rb new file mode 100644 index 000000000000..84320d61fd31 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_scorecards_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of scorecards. + class ListScorecardsResponse + include BaseGenericModel + + # Array of scorecards. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ListScorecardsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/list_scores_response.rb b/lib/datadog_api_client/v2/models/list_scores_response.rb new file mode 100644 index 000000000000..9b5abcd69240 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_scores_response.rb @@ -0,0 +1,146 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of scores. + class ListScoresResponse + include BaseGenericModel + + # Array of scores. + attr_reader :data + + # Metadata for scores response. + attr_reader :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'PaginatedResponseMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ListScoresResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + return false if @meta.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/paginated_response_meta.rb b/lib/datadog_api_client/v2/models/paginated_response_meta.rb new file mode 100644 index 000000000000..ebd135586ae3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/paginated_response_meta.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Metadata for scores response. + class PaginatedResponseMeta + include BaseGenericModel + + # Number of entities in this response. + attr_reader :count + + # Pagination limit. + attr_reader :limit + + # Pagination offset. + attr_reader :offset + + # Total number of entities available. + attr_reader :total + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'count' => :'count', + :'limit' => :'limit', + :'offset' => :'offset', + :'total' => :'total' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'count' => :'Integer', + :'limit' => :'Integer', + :'offset' => :'Integer', + :'total' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PaginatedResponseMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'count') + self.count = attributes[:'count'] + end + + if attributes.key?(:'limit') + self.limit = attributes[:'limit'] + end + + if attributes.key?(:'offset') + self.offset = attributes[:'offset'] + end + + if attributes.key?(:'total') + self.total = attributes[:'total'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @count.nil? + return false if @limit.nil? + return false if @offset.nil? + return false if @total.nil? + true + end + + # Custom attribute writer method with validation + # @param count [Object] Object to be assigned + # @!visibility private + def count=(count) + if count.nil? + fail ArgumentError, 'invalid value for "count", count cannot be nil.' + end + @count = count + end + + # Custom attribute writer method with validation + # @param limit [Object] Object to be assigned + # @!visibility private + def limit=(limit) + if limit.nil? + fail ArgumentError, 'invalid value for "limit", limit cannot be nil.' + end + @limit = limit + end + + # Custom attribute writer method with validation + # @param offset [Object] Object to be assigned + # @!visibility private + def offset=(offset) + if offset.nil? + fail ArgumentError, 'invalid value for "offset", offset cannot be nil.' + end + @offset = offset + end + + # Custom attribute writer method with validation + # @param total [Object] Object to be assigned + # @!visibility private + def total=(total) + if total.nil? + fail ArgumentError, 'invalid value for "total", total cannot be nil.' + end + @total = total + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + count == o.count && + limit == o.limit && + offset == o.offset && + total == o.total && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [count, limit, offset, total, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/score_response_attributes.rb b/lib/datadog_api_client/v2/models/score_response_attributes.rb new file mode 100644 index 000000000000..78ca0d9751e7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/score_response_attributes.rb @@ -0,0 +1,270 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Score attributes. + class ScoreResponseAttributes + include BaseGenericModel + + # The aggregation type. + attr_reader :aggregation + + # Score denominator. + attr_reader :denominator + + # Score numerator. + attr_reader :numerator + + # Calculated score value. + attr_reader :score + + # Total number of failing rules. + attr_reader :total_fail + + # Total number of rules with no data. + attr_reader :total_no_data + + # Total number of passing rules. + attr_reader :total_pass + + # Total number of skipped rules. + attr_reader :total_skip + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'aggregation' => :'aggregation', + :'denominator' => :'denominator', + :'numerator' => :'numerator', + :'score' => :'score', + :'total_fail' => :'total_fail', + :'total_no_data' => :'total_no_data', + :'total_pass' => :'total_pass', + :'total_skip' => :'total_skip' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'aggregation' => :'String', + :'denominator' => :'Integer', + :'numerator' => :'Integer', + :'score' => :'Float', + :'total_fail' => :'Integer', + :'total_no_data' => :'Integer', + :'total_pass' => :'Integer', + :'total_skip' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ScoreResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'aggregation') + self.aggregation = attributes[:'aggregation'] + end + + if attributes.key?(:'denominator') + self.denominator = attributes[:'denominator'] + end + + if attributes.key?(:'numerator') + self.numerator = attributes[:'numerator'] + end + + if attributes.key?(:'score') + self.score = attributes[:'score'] + end + + if attributes.key?(:'total_fail') + self.total_fail = attributes[:'total_fail'] + end + + if attributes.key?(:'total_no_data') + self.total_no_data = attributes[:'total_no_data'] + end + + if attributes.key?(:'total_pass') + self.total_pass = attributes[:'total_pass'] + end + + if attributes.key?(:'total_skip') + self.total_skip = attributes[:'total_skip'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @aggregation.nil? + return false if @denominator.nil? + return false if @numerator.nil? + return false if @score.nil? + return false if @total_fail.nil? + return false if @total_no_data.nil? + return false if @total_pass.nil? + return false if @total_skip.nil? + true + end + + # Custom attribute writer method with validation + # @param aggregation [Object] Object to be assigned + # @!visibility private + def aggregation=(aggregation) + if aggregation.nil? + fail ArgumentError, 'invalid value for "aggregation", aggregation cannot be nil.' + end + @aggregation = aggregation + end + + # Custom attribute writer method with validation + # @param denominator [Object] Object to be assigned + # @!visibility private + def denominator=(denominator) + if denominator.nil? + fail ArgumentError, 'invalid value for "denominator", denominator cannot be nil.' + end + @denominator = denominator + end + + # Custom attribute writer method with validation + # @param numerator [Object] Object to be assigned + # @!visibility private + def numerator=(numerator) + if numerator.nil? + fail ArgumentError, 'invalid value for "numerator", numerator cannot be nil.' + end + @numerator = numerator + end + + # Custom attribute writer method with validation + # @param score [Object] Object to be assigned + # @!visibility private + def score=(score) + if score.nil? + fail ArgumentError, 'invalid value for "score", score cannot be nil.' + end + @score = score + end + + # Custom attribute writer method with validation + # @param total_fail [Object] Object to be assigned + # @!visibility private + def total_fail=(total_fail) + if total_fail.nil? + fail ArgumentError, 'invalid value for "total_fail", total_fail cannot be nil.' + end + @total_fail = total_fail + end + + # Custom attribute writer method with validation + # @param total_no_data [Object] Object to be assigned + # @!visibility private + def total_no_data=(total_no_data) + if total_no_data.nil? + fail ArgumentError, 'invalid value for "total_no_data", total_no_data cannot be nil.' + end + @total_no_data = total_no_data + end + + # Custom attribute writer method with validation + # @param total_pass [Object] Object to be assigned + # @!visibility private + def total_pass=(total_pass) + if total_pass.nil? + fail ArgumentError, 'invalid value for "total_pass", total_pass cannot be nil.' + end + @total_pass = total_pass + end + + # Custom attribute writer method with validation + # @param total_skip [Object] Object to be assigned + # @!visibility private + def total_skip=(total_skip) + if total_skip.nil? + fail ArgumentError, 'invalid value for "total_skip", total_skip cannot be nil.' + end + @total_skip = total_skip + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + aggregation == o.aggregation && + denominator == o.denominator && + numerator == o.numerator && + score == o.score && + total_fail == o.total_fail && + total_no_data == o.total_no_data && + total_pass == o.total_pass && + total_skip == o.total_skip && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [aggregation, denominator, numerator, score, total_fail, total_no_data, total_pass, total_skip, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/score_response_data.rb b/lib/datadog_api_client/v2/models/score_response_data.rb new file mode 100644 index 000000000000..262fe5bbc1cd --- /dev/null +++ b/lib/datadog_api_client/v2/models/score_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Score data. + class ScoreResponseData + include BaseGenericModel + + # Score attributes. + attr_reader :attributes + + # The unique ID of the score entity. + attr_reader :id + + # The JSON:API type for scores. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ScoreResponseAttributes', + :'id' => :'String', + :'type' => :'ScoreType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ScoreResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/score_type.rb b/lib/datadog_api_client/v2/models/score_type.rb new file mode 100644 index 000000000000..d6ae84bf2ca5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/score_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The JSON:API type for scores. + class ScoreType + include BaseEnumModel + + SCORE = "score".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/scorecard_list_response_attributes.rb b/lib/datadog_api_client/v2/models/scorecard_list_response_attributes.rb new file mode 100644 index 000000000000..3c3af966bcb6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/scorecard_list_response_attributes.rb @@ -0,0 +1,175 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Scorecard attributes. + class ScorecardListResponseAttributes + include BaseGenericModel + + # Creation time of the scorecard. + attr_reader :created_at + + # The description of the scorecard. + attr_accessor :description + + # Time of last scorecard modification. + attr_reader :modified_at + + # The name of the scorecard. + attr_reader :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'description' => :'description', + :'modified_at' => :'modified_at', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'description' => :'String', + :'modified_at' => :'Time', + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ScorecardListResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @modified_at.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + description == o.description && + modified_at == o.modified_at && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, description, modified_at, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/scorecard_list_response_data.rb b/lib/datadog_api_client/v2/models/scorecard_list_response_data.rb new file mode 100644 index 000000000000..d91c980b37dd --- /dev/null +++ b/lib/datadog_api_client/v2/models/scorecard_list_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Scorecard data. + class ScorecardListResponseData + include BaseGenericModel + + # Scorecard attributes. + attr_reader :attributes + + # The unique ID of the scorecard. + attr_reader :id + + # The JSON:API type for scorecard list. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ScorecardListResponseAttributes', + :'id' => :'String', + :'type' => :'ScorecardListType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ScorecardListResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/scorecard_list_type.rb b/lib/datadog_api_client/v2/models/scorecard_list_type.rb new file mode 100644 index 000000000000..887c6824dc52 --- /dev/null +++ b/lib/datadog_api_client/v2/models/scorecard_list_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The JSON:API type for scorecard list. + class ScorecardListType + include BaseEnumModel + + SCORECARD = "scorecard".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/setup_rules_request.rb b/lib/datadog_api_client/v2/models/setup_rules_request.rb new file mode 100644 index 000000000000..37a42dbe1428 --- /dev/null +++ b/lib/datadog_api_client/v2/models/setup_rules_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to set up rules for an organization. + class SetupRulesRequest + include BaseGenericModel + + # Data for setting up rules. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SetupRulesRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SetupRulesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/setup_rules_request_attributes.rb b/lib/datadog_api_client/v2/models/setup_rules_request_attributes.rb new file mode 100644 index 000000000000..9d701452b20b --- /dev/null +++ b/lib/datadog_api_client/v2/models/setup_rules_request_attributes.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for setting up rules. + class SetupRulesRequestAttributes + include BaseGenericModel + + # Array of default rule IDs to disable. + attr_accessor :disabled_default_rules + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'disabled_default_rules' => :'disabled_default_rules' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'disabled_default_rules' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SetupRulesRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'disabled_default_rules') + if (value = attributes[:'disabled_default_rules']).is_a?(Array) + self.disabled_default_rules = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + disabled_default_rules == o.disabled_default_rules && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [disabled_default_rules, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/setup_rules_request_data.rb b/lib/datadog_api_client/v2/models/setup_rules_request_data.rb new file mode 100644 index 000000000000..0bd558bba330 --- /dev/null +++ b/lib/datadog_api_client/v2/models/setup_rules_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for setting up rules. + class SetupRulesRequestData + include BaseGenericModel + + # Attributes for setting up rules. + attr_reader :attributes + + # + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SetupRulesRequestAttributes', + :'type' => :'SetupRulesRequestDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SetupRulesRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/setup_rules_request_data_type.rb b/lib/datadog_api_client/v2/models/setup_rules_request_data_type.rb new file mode 100644 index 000000000000..9362b3778a48 --- /dev/null +++ b/lib/datadog_api_client/v2/models/setup_rules_request_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class SetupRulesRequestDataType + include BaseEnumModel + + SETUP = "setup".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/slack_routing_options.rb b/lib/datadog_api_client/v2/models/slack_routing_options.rb new file mode 100644 index 000000000000..daf500d59986 --- /dev/null +++ b/lib/datadog_api_client/v2/models/slack_routing_options.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Slack routing options for report delivery. + class SlackRoutingOptions + include BaseGenericModel + + # Slack channel ID. + attr_accessor :channel_id + + # Slack channel name. + attr_accessor :channel_name + + # Slack workspace ID. + attr_accessor :workspace_id + + # Slack workspace name. + attr_accessor :workspace_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'channel_id' => :'channel_id', + :'channel_name' => :'channel_name', + :'workspace_id' => :'workspace_id', + :'workspace_name' => :'workspace_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'channel_id' => :'String', + :'channel_name' => :'String', + :'workspace_id' => :'String', + :'workspace_name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SlackRoutingOptions` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'channel_id') + self.channel_id = attributes[:'channel_id'] + end + + if attributes.key?(:'channel_name') + self.channel_name = attributes[:'channel_name'] + end + + if attributes.key?(:'workspace_id') + self.workspace_id = attributes[:'workspace_id'] + end + + if attributes.key?(:'workspace_name') + self.workspace_name = attributes[:'workspace_name'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + channel_id == o.channel_id && + channel_name == o.channel_name && + workspace_id == o.workspace_id && + workspace_name == o.workspace_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [channel_id, channel_name, workspace_id, workspace_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_campaign_request.rb b/lib/datadog_api_client/v2/models/update_campaign_request.rb new file mode 100644 index 000000000000..c8cdc281aaba --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_campaign_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to update a campaign. + class UpdateCampaignRequest + include BaseGenericModel + + # Data for updating a campaign. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'UpdateCampaignRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateCampaignRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_campaign_request_attributes.rb b/lib/datadog_api_client/v2/models/update_campaign_request_attributes.rb new file mode 100644 index 000000000000..defcd1b7087f --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_campaign_request_attributes.rb @@ -0,0 +1,259 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for updating a campaign. + class UpdateCampaignRequestAttributes + include BaseGenericModel + + # The description of the campaign. + attr_accessor :description + + # The due date of the campaign. + attr_accessor :due_date + + # Entity scope query to filter entities for this campaign. + attr_accessor :entity_scope + + # Guidance for the campaign. + attr_accessor :guidance + + # The unique key for the campaign. + attr_accessor :key + + # The name of the campaign. + attr_reader :name + + # The UUID of the campaign owner. + attr_reader :owner_id + + # Array of rule IDs associated with this campaign. + attr_reader :rule_ids + + # The start date of the campaign. + attr_reader :start_date + + # The status of the campaign. + attr_reader :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'due_date' => :'due_date', + :'entity_scope' => :'entity_scope', + :'guidance' => :'guidance', + :'key' => :'key', + :'name' => :'name', + :'owner_id' => :'owner_id', + :'rule_ids' => :'rule_ids', + :'start_date' => :'start_date', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'due_date' => :'Time', + :'entity_scope' => :'String', + :'guidance' => :'String', + :'key' => :'String', + :'name' => :'String', + :'owner_id' => :'String', + :'rule_ids' => :'Array', + :'start_date' => :'Time', + :'status' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateCampaignRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'due_date') + self.due_date = attributes[:'due_date'] + end + + if attributes.key?(:'entity_scope') + self.entity_scope = attributes[:'entity_scope'] + end + + if attributes.key?(:'guidance') + self.guidance = attributes[:'guidance'] + end + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'owner_id') + self.owner_id = attributes[:'owner_id'] + end + + if attributes.key?(:'rule_ids') + if (value = attributes[:'rule_ids']).is_a?(Array) + self.rule_ids = value + end + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @name.nil? + return false if @owner_id.nil? + return false if @rule_ids.nil? + return false if @start_date.nil? + return false if @status.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param owner_id [Object] Object to be assigned + # @!visibility private + def owner_id=(owner_id) + if owner_id.nil? + fail ArgumentError, 'invalid value for "owner_id", owner_id cannot be nil.' + end + @owner_id = owner_id + end + + # Custom attribute writer method with validation + # @param rule_ids [Object] Object to be assigned + # @!visibility private + def rule_ids=(rule_ids) + if rule_ids.nil? + fail ArgumentError, 'invalid value for "rule_ids", rule_ids cannot be nil.' + end + @rule_ids = rule_ids + end + + # Custom attribute writer method with validation + # @param start_date [Object] Object to be assigned + # @!visibility private + def start_date=(start_date) + if start_date.nil? + fail ArgumentError, 'invalid value for "start_date", start_date cannot be nil.' + end + @start_date = start_date + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + due_date == o.due_date && + entity_scope == o.entity_scope && + guidance == o.guidance && + key == o.key && + name == o.name && + owner_id == o.owner_id && + rule_ids == o.rule_ids && + start_date == o.start_date && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, due_date, entity_scope, guidance, key, name, owner_id, rule_ids, start_date, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_campaign_request_data.rb b/lib/datadog_api_client/v2/models/update_campaign_request_data.rb new file mode 100644 index 000000000000..703916fb25c7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_campaign_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for updating a campaign. + class UpdateCampaignRequestData + include BaseGenericModel + + # Attributes for updating a campaign. + attr_reader :attributes + + # The JSON:API type for campaigns. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'UpdateCampaignRequestAttributes', + :'type' => :'CampaignType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateCampaignRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end